Resetting a Counter/Timer

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

cross mob
ThBa_282891
Level 3
Level 3
First like received First like given

I do have a very easy task that is driving me CRAZY!!!

   

I want a pin that is high for a certain time, every time it got triggered by software.

   

My approach:

   

Take a counter, set a period, make it one-shot, connect TC to the Pin and reset it every time I want to trigger.

   

The component takes "one-shot" very serious and is only performing the operation once and I am not able to reset it. I tried different API-Calls but none of them worked... How to prepare the Counter for the next shot?

   

Its a quiet complex overall design, so I do not have the resources to introduce control-registers and stuff around the module, also it should be possible to trigger the next shot with a single call as the application is timing critical....

   

 

   

Regards,
Thomas

0 Likes
4 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

The problem might be that the reset signal is synchronous in nature, thus needing a clock pulse after applied and kept high for a certain time (see datasheet). You may use some FFs or a Pulse Converter component.

   

 

   

Bob

0 Likes
ThBa_282891
Level 3
Level 3
First like received First like given

Hi Bob,

   

Thanks for your answer.

   

Yes I have read about the FF story but I would expect that there is a way to do it without any additional components (using the API of the module). In the end it would be ok to use a control-reg or writing a small user-module but this issue bugs me and I want to solve it in Software (without setting registers manually 😉 

   

 

   

EDIT: The Pulse converter is actually exactly what I was looking for, thanks!

0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Borstenhorst,

   

here is a collection of 1-shot timers with examples, select one you like

   

http://www.cypress.com/forum/psoc-4-architecture/one-shot-timer-delayed-code-execution#comment-28650...

0 Likes
ThBa_282891
Level 3
Level 3
First like received First like given

Solved it with pulsed control-regs:

   

http://www.psoc-community.de/viewtopic.php?f=11&t=51&p=294#p294

0 Likes