cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Participant
Participant
3,934 Views
Registered: ‎07-11-2009

10 ms clock

Hi!

     I'm trying to make a pulse generator which generates a pulse every 10 ms. I'm thinking to use a counter but it seems that I might really need to have a large counter with 31.25 ns FPGA clock. Is there any easy way to accomplish this?

0 Kudos
3 Replies
Highlighted
Advisor
Advisor
3,924 Views
Registered: ‎12-03-2007

You might consider using an LFSR counter, which requires less logic to implement.

Here is an online LFSR counter generator:  

http://outputlogic.com/?page_id=275

 

Hope that helps 

Tags (2)
0 Kudos
Highlighted
Teacher
Teacher
3,914 Views
Registered: ‎07-09-2009

Hi

 

 10 ms divided by 31.25 ns is 320000. So even a streight binary counter only needs to be 19 bits long, which is eaqsy in all but the smallest of cplds.

 

just count  0 to 4E1FF hex and wrap back to 0. gen a pulse on the wrap.

 

<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos
Highlighted
Professor
Professor
3,910 Views
Registered: ‎08-14-2007


evgenis1 wrote:

You might consider using an LFSR counter, which requires less logic to implement.

Here is an online LFSR counter generator:  

http://outputlogic.com/?page_id=275

 

Hope that helps 


That's a pretty neat program.  One other method that helps in CPLD's is to decode the end state

serially.  One of the problems with many CPLD's is the limit of the number of inputs to each

block of macrocells.  LFSR counters help reduce this over a binary counter, because each bit

only relies on the previous bit in the shift register, except for the XOR bit which should not

need more than 4 inputs for a maximal length count.  However if you need to count by some

other number and need to restart at a particular count, a parallel equality comparator needs

all of the bits of the register at once, which negates the gain in terms of inputs to a macrocell

block.  However because the state is contained in a simple shift register, you can use a

state machine to detect the end state (this is easiest if your end state is all ones or all zeroes)

using a single bit from the shift register.  For very long LFSR's this method reduces logic

significantly.  The fun part is determining the starting state of the LFSR to load when you

detect all ones (or all zeroes) to get the length you need.

 

Regards,

Gabor

-- Gabor
0 Kudos