How to clear Timer using a TCPWM Component

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.
Doorknob
Level 4
Level 4
First solution authored 50 replies posted 25 replies posted

I am having a heck of a time trying to clear an interrupt using the timer function on a TCPPWM component.  The API states to use void ISR_ClearPending(void) but this does not appear in the API when i try to use it.  The data sheet also talks about block/status register needing to be read/cleared, but doe snot tell how this is done.  Could i get some help on how to do this properly. I will also attach my project for reference.

CLR_INT_API.png

0 Likes
1 Solution
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

May be this is supererogatory,

I always felt bewildered when I had to use <Module>_ClearInterrupt(interruptMask),

to find what is the "interruptMask".

Recently I found a way to find it, may be there is/are better ways, though.

(1) When I enter xxx_ClearInterrupt(),

     I notice that I must provide "interruptMask",

     but I have no idea what is the name/value of the interruptMask.

000-Timer_interrupt_mask.JPG

(2) So, to avoid "error" I fill "0' for the time being.

001-Clear_interrupt_0.JPG

(3)  Now as the line is grammatically correct, we can use the pull-down menu -> Go To Definition

002-goto_definition.JPG

(4) Then in the definition of ClearInterrupt() function, the comment shows the usable parameters.

    There I cheat to copy the "correct" defined value, this time "Tmer_INTR_MASK_TC".

002-definition.JPG

(5) Paste the correct mask value into my (or your) program

003-Flag_entered.JPG

moto

P.S.

Well, Today I learned "Timername_ClearInterrupt(Timername_GetInterruptSource())".

This will be better if possible interrupt source is only 1 or you have already taken care of each cases before clearing the flag.

View solution in original post

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

The interrupt has to be cleared at the TCPWM.

Use Timername_ClearInterrupt(Timername_GetInterruptSource()) to remove all interrupts.

Clearing the interrupt in the isr component is not required.

Bob

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

May be this is supererogatory,

I always felt bewildered when I had to use <Module>_ClearInterrupt(interruptMask),

to find what is the "interruptMask".

Recently I found a way to find it, may be there is/are better ways, though.

(1) When I enter xxx_ClearInterrupt(),

     I notice that I must provide "interruptMask",

     but I have no idea what is the name/value of the interruptMask.

000-Timer_interrupt_mask.JPG

(2) So, to avoid "error" I fill "0' for the time being.

001-Clear_interrupt_0.JPG

(3)  Now as the line is grammatically correct, we can use the pull-down menu -> Go To Definition

002-goto_definition.JPG

(4) Then in the definition of ClearInterrupt() function, the comment shows the usable parameters.

    There I cheat to copy the "correct" defined value, this time "Tmer_INTR_MASK_TC".

002-definition.JPG

(5) Paste the correct mask value into my (or your) program

003-Flag_entered.JPG

moto

P.S.

Well, Today I learned "Timername_ClearInterrupt(Timername_GetInterruptSource())".

This will be better if possible interrupt source is only 1 or you have already taken care of each cases before clearing the flag.

0 Likes

Well, Mr. Motoo

It is nice to see that even me could teach you new tricks by using _GetInterruptSource()

Happy coding

Bob

thank you so much for the help ... i actually was able to do it reading AN90799 on page 10 in regards to the interruptMask.

Interrupt Solution.png

and looking  at the XXX.h file i found the mask.

After reading your post your way sure seems easier!

thanks again

Scott

0 Likes