How to make a counter that latches high?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
JoBr_1593366
Level 5
Level 5
100 sign-ins 50 questions asked 100 replies posted

The Counter datasheet (PSoC3) says

"Run Mode … One Shot – The Counter runs through a single period and stops at terminal count. …  On stop, …  for a fixed-function counter, the count register remains at terminal count."

"tc … goes high one clock cycle after the count value matches the terminal count and stays
high while the count value is equal to the terminal count."

So I would think that the tc output is low until it counts down to 0 (the terminal count) at which point the output switches to high, but in reality it only pulses high at that point and then goes low again, with these settings:

JoBr_1593366_0-1630593811255.pngJoBr_1593366_1-1630593818121.png

 

 

So I tried to latch it with an RS flip-flop, but it complains about "asynchronous clock domain crossing" and doesn't seem to work reliably.

JoBr_1593366_1-1630591891445.png

So I tried to use an asynchronous DFF to latch instead, but it complains about 'Control signal "dsrff(clock)" driving signal "Net_3998" is always "low".'

JoBr_1593366_0-1630591771567.png

Is there some better way?

0 Likes
1 Solution

Hello.

I did this with a PSoC 4.  I connected the counter OV output to the clk input of DFF.  Connect a '1' to the D input.  I used a Control Register component to reset the DFF (with AR on symbol).  Otherwise, you can't reset the DFF back to 0.

For your application, connect TC to the DFF clk input, etc.  I expect this will also work with PSoC 3.

View solution in original post

15 Replies