Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Re: problem in different clock speed when reading and writing from ram

Reply
Thread Tools

Re: problem in different clock speed when reading and writing from ram

 
 
Chris Pruett
Guest
Posts: n/a
 
      08-14-2003

Sarah,

You need to generate a signal from the 10 MHz domain that is long
enough for the logic in the uart clock domain to capture. A rule of
thumb for two totally asynchronous clocks is that it must be at least
two of the destination clock cycles in length. What you do then is
synchronize the signal in the target clock domain and then edge-detect.
The edge-detection pulse is the signal to the UART to start.

A possible implementation:

process (clk_10, reset_10) is
begin
if (reset_10 = '1') then
toggle <= '0';
elseif (clk_10'event and clk_10='1') then
if (start_tx = '1') then
toggle <= not toggle;
end if;
end process;


process (clk_uart, reset_uart) is
begin
if (reset_uart = '1') then
toggle_meta <= '0';
toggle_sync <= '0';
toggle_delay <= '0';
uart_start_tx <= '0';
elseif (clk_uart'event and clk_uart='1') then
toggle_meta <= toggle; -- metastable
toggle_sync <= toggle_meta; -- synchronized
toggle_delay <= toggle_sync; -- delayed
uart_start_tx <= toggle_sync xor toggle_delay; -- edge
end if;
end process;

Then uart_start_tx can be used by the UART logic.

CP


In article <> , sarah
<> wrote:

> Hi,
>
> I have a clock problem when implementing reading and wrting data from
> ram in FPGA.
>
> First, write data to ram. The write clock is 10 Mhz. Then after
> finishing writing, read data from ram and send them to UART. The
> problem is here, the reading clock is the same as UART_clock, much
> slower than 10 Mhz. In the UART, the transmitter block is controlled
> by the signal: start_tx. It means when start_Tx is '1', the data can
> be trasmitted. But this signal is triggered by the high speed clock,
> 10 mhz. The transmitter block can work under the uart-clock. So, i
> need to keep the signal : start_tx longer until the rising endge of
> Uart_clcok.
>
> Does anyboday know how to slove this problem? Which logic should be
> used?
>
> Thank you very much.
>
> sarah

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
KV8 Pro - RAM Clock speed and CAS Latency tezza Computer Support 4 08-07-2007 12:35 PM
Single clock pulse transfer to different clock domains. himassk VHDL 1 05-16-2007 10:41 AM
speed of reading the real time clock? bugbear Java 7 05-21-2006 07:53 PM
speed speed speed a.metselaar Computer Support 14 12-30-2003 03:34 AM
Re: problem in different clock speed when reading and writing from ram Pieter Hulshoff VHDL 0 08-13-2003 08:54 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57