Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17267 Discussions

degedge count problem..

Altera_Forum
Honored Contributor II
1,499 Views

Hi, I have a very simple verilog code. But I get wrong result. When I look through the oscilloscope, I see 10 negative edges. But the result I get with a simple code that I write is sometimes 12, sometimes 13 or even more. The yellow graphic is scl.. 

 

reg[15:0] scl_clock_count=0; 

always @(negedge scl) 

scl_clock_count <= scl_clock_count + 1'b1;
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
648 Views

What is SCL? is it the clock from an SPI bus? for this, usually it is safer to use a fast system clock and sample the SCL with the fast system clock.

0 Kudos
Reply