Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Clock too slow to detect rising/falling edge?

Status
Not open for further replies.

crz

Newbie level 1
Joined
Aug 21, 2010
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
IL
Activity points
1,295
I'm trying to sending a serial data out from a fpga to microprocessor.
uP sends a 8.4MHz bit clock to FPGA, and FPGA needs to send the data on the rising edge of the bit clock because uP samples the data on the falling edge of the bitclock.

bitclock is not synchronized to FPGA's internal 50MHz clock.

Is FPGA's internal 50MHz clock too slow to detect the rising edge of the bitclock?

Since bitclock is not synchronized to 50MHz, I am using double flip flops to detect the rising edge of bitclock.

under my process(ck_50mhz) I have:
...
bitclock_d <= bitclock;
bitclock_d2 <= bitclock_d;

if(ck_50mhz'event and ck_50mhz='1') then
if (bitclock_d = '1' and bitclock_d2 = '0') then
serial_data <= sh_reg;
...
end if;
end if;


My concern is:
worst case, serial_data will appear 60ns (20ns for 1st flop + 20ns for 2nd flop + 20ns later data will appear outside the fpga) after rising edge of bitclock, which is too late for the uP to latch the data since uP latches the data on the falling edge.

Is that true?

What can I do to resolve this? Updating clock's and the bitclock's frequencies is not an option.

Previously I tried using bitclock for my process, instead of using 50MHz internal clock, but that complicated the whole design and I got so much timing violations.

Thanks.
 

From a certain clock speed, the SPI slave SR must be clocked by the SPI clock directly. Of course the clock domain crossing must be realized properly, then it won't cause timing violations.

As another option, you can reduce the synchronous edge detection latency by using both edges of the 50 MHz system clock.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top