HCS TPM Module Port Control

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HCS TPM Module Port Control

2,358 Views
FC
Contributor III
Hi,
 
I am using the input capture and output compare functions.  Basically, in the IC ISR, every 30th pulse, an led lights up for 500ms.  Using the captured time, an offset is added to the output compare registers.  In the OC ISR, the led turns off.
 
The led is turned off by port control, not using the toggle/set/clear feature of the output compare. 
 
Question:  if the port pin for the led is set and the clear on compare is set, does port value for the led remain latched?  
 
 
 
 
Labels (1)
0 Kudos
1 Reply

259 Views
bigmac
Specialist III

Hello FC,

I guess the two choices are to use the timer channel to directly control the channel pin, or to use the timer as an interrupt only source, without affecting the I/O pin.  It sounds like you require the second option.

With the direct control method, the interrupt latency does not affect the output waveform.  However, with the interrupt only method variations in the interrupt latency will affect the pulse timing.

When driving a visual LED, small variations likely do not matter.  For a non-critical 500 ms pulse, I would probably tend to use multiples of the timer overflow period to generated the pulse width timing, rather than a timer channel.  Simplest operation of the timer channel occurs for pulse widths less than the overflow period.

Regards,
Mac

 

 

0 Kudos