Check Timer state before enabling it again

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

cross mob
Anonymous
Not applicable

Hi, 

   

I want to check Timer_1 component's state before re-enabling it again.

   

I find "Timer_1_ReadControlRegister();" but I dont know how to write code to check this enabling bit.

   

Any idea ?

   

Thanks so much !!

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Indeed to see if the timer is software enabled you will need to read back the control register.

   

On Creator Start page you will see an entry "Find Code Example" there you will get timer examples.

   

 

   

Bob

View solution in original post

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

Controlling the timer is done with a control register, to see what the state is you better use ReadStatusRegister(). Take care, some of the status bits are clear-on-read, so there is no second chance 😉

   

 

   

Bob

0 Likes
Anonymous
Not applicable

How could I see if Timer_1 is enabled or stop state ? Any code example ?

   

Thanks

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

Indeed to see if the timer is software enabled you will need to read back the control register.

   

On Creator Start page you will see an entry "Find Code Example" there you will get timer examples.

   

 

   

Bob

0 Likes