[an error occurred while processing this directive]
|
entity xxx is
port(
clk: in std_logic;
reset: in std_logic;--async reset active '1'
tx : in std_logic;--synchronous load data and start transfer
data:in std_logic_vector(7 downto 0);
sino : out std_logic
);
end xxx;
architecture xxx of xxx is
signal rgt:STD_LOGIC_VECTOR(7 downto 0);
signal o0,o1,odd:std_logic;
signal data_tx:STD_LOGIC_VECTOR(11 downto 0);
signal start_bit,stop_bit1,stop_bit2:std_logic;
signal line_idle:std_logic;
signal load:std_logic;
begin
start_bit<='0';
stop_bit1<='1';
stop_bit2<='1';
line_idle<='1';
o0<=data(0)xor data(1)xor data(2) xor data(3);
o1<=data(4)xor data(5)xor data(6) xor data(7);
x:process(clk,reset)
begin
if reset='1' then
load<='0';
elsif clk'event and clk='1' then
if tx='1' then
odd<=o0 xor o1;
rgt<=data;
end if;
load<=tx;
end if;
end process;
data_tx<=start_bit & rgt & odd & stop_bit1 & stop_bit2;
shift485: lpm_shiftreg
GENERIC MAP (
lpm_width => 12,
lpm_avalue => "4095",
lpm_direction=>"LEFT")
PORT MAP (
clock => clk,
aset =>reset,
load => load,
data => data_tx,
shiftin =>line_idle,
shiftout => sino);
end xxx;
E-mail: info@telesys.ru