Reset a timer in one shot mode

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

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hello

   

I have a one shot timer that I want to start multiple times on my demands in software. I have the following setup

   

For TopDesign see attach picture.

   

The isr code:

   

 Timer_1_ReadStatusRegister();
/* Set the flag variable */
toggle_flag = 1;

   

the main code:

   

CyGlobalIntEnable; /* Uncomment this line to enable global interrupts. */

isr_1_Start();
Timer_1_Start();

for(;;)
{
if(toggle_flag == 1)
{
toggle_flag = 0;
Timer_1_Start();
}
}

   

But it will only goes into the isr once (because it is a one shot timer). How do I get it to go into the isr multiple time? what did I do wrong?

   

An other thing in the datasheet for the timer it state the following but it does make complete sence to me can anyone explain?

   

   

"Note In order to be sure that One Shot mode does not start prematurely, you should use a

   

Trigger Mode to control the start time, or use some form of software enable mode (Software

   

Only or Software and Hardware)."

   

Martin 

0 Likes
9 Replies