-- -----------------------------------------------------------------------------
--  IRDA2RXD - a IrDA 1.0 signal to RS232 TxD decoder                         -- 
-- -----------------------------------------------------------------------------
--
--  File        : 'irda2rxd.vhd'
--  Author      :  Lars Larsson 
-- 
--  Date        :  February 15, 1999
--
--  Description :  This converts an IrDA 1.0 RxD_A signal into a RS232 RxD 
--                 signal. The baud rate is adjusted by the bit time parameter T.
--
-- -----------------------------------------------------------------------------
--
-- Copyright (C) 1999 Lars Larsson, Dept. of Computer Science
--                                  University of Hamburg
--                                  Vogt-Koelln-Str. 30
--                                  D - 22041 Hamburg, Germany
--                                  larsson@informatik.uni-hamburg.de
--                                  http://tech-www.informatik.uni-hamburg.de/~larsson
--
-- This program is free software; you can redistribute it and/or modify it
-- under the terms of the GNU General Public License as published by the
-- Free Software Foundation; either version 2 of the License, or (at your
-- option) any later version.
--
-- This program is distributed in the hope that it will be useful, but
-- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-- for more details.
--
-- You should have received a copy of the GNU General Public License along
-- with this program; if not, write to the Free Software Foundation, Inc.,
-- 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
--
-- -----------------------------------------------------------------------------

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;

entity irda2rxd is
  port(         
                  t :  in time;             -- T_BAUD = 1/(baud rate)
          irda_rxda :  in std_ulogic;       -- IrDA 1.0 RxD_A input (low active)
          rs232_rxd : out std_ulogic        -- RS232 RxD output
      );
end irda2rxd;

architecture simulate of irda2rxd is

   signal baud_clk_s : std_ulogic; 
   signal irda_s : std_ulogic := '0';

   begin

       irda_p : process ( irda_rxda ) 
				begin
				   if (irda_rxda'event and irda_rxda='0') then
                       irda_s <= '0' after 0 ns, '1' after t/4; 
                   end if;
                end process;

       baud_p : process
                begin
                   wait on irda_s for 1 ns;
                   baud_clk_s <= '0'; wait for t/2; 
                   baud_clk_s <= '1'; wait for t/2;
                end process;

        rxd_p : process (baud_clk_s, irda_s)
                begin
				  if (baud_clk_s'event and baud_clk_s='1') then
					  rs232_rxd <= irda_rxda;
				  end if;
                end process;

   end simulate;

-- -----------------------------------------------------------------------------

<div align="center"><br /><script type="text/javascript"><!--
google_ad_client = "pub-7293844627074885";
//468x60, Created at 07. 11. 25
google_ad_slot = "8619794253";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />&nbsp;</div>