URL
https://opencores.org/ocsvn/uart_block/uart_block/trunk
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 10 |
Rev 12 |
Line 20... |
Line 20... |
signal current_s,next_s: rxStates;
|
signal current_s,next_s: rxStates;
|
signal filterRx : rxFilterStates;
|
signal filterRx : rxFilterStates;
|
signal syncDetected : std_logic;
|
signal syncDetected : std_logic;
|
|
|
begin
|
begin
|
-- First we need to oversample(8x baud rate) out serial channel to syncronize with the PC
|
-- First we need to oversample(4x baud rate) out serial channel to syncronize with the PC
|
process (rst, baudOverSampleClk, serial_in, current_s)
|
process (rst, baudOverSampleClk, serial_in, current_s)
|
begin
|
begin
|
if rst = '1' then
|
if rst = '1' then
|
filterRx <= s0;
|
filterRx <= s0;
|
syncDetected <= '0';
|
syncDetected <= '0';
|
elsif rising_edge(baudOverSampleClk) then
|
elsif rising_edge(baudOverSampleClk) then
|
case filterRx is
|
case filterRx is
|
when s0 =>
|
when s0 =>
|
syncDetected <= '0';
|
syncDetected <= '0';
|
-- Spike down detected, verify if it's valid for at least 3 cycles
|
-- Spike down detected, verify if it's valid for at least 3 cycles
|
|
-- We shoose a little bit on the end to enforce the baud clk to sample
|
|
-- the data at the right time... iE we're going to start sampling when
|
|
-- the stop has been detected and we already for some of the first bit
|
|
-- signal
|
if serial_in = '0' then
|
if serial_in = '0' then
|
filterRx <= s1;
|
filterRx <= s1;
|
else
|
else
|
filterRx <= s0;
|
filterRx <= s0;
|
end if;
|
end if;
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.