Hello,
I encounter a issue. When I initialize timer with "config->enableReloadOnTrigger = true;".
But in fact when a rising or falling edge is detected on the selected trigger input., the TPM counter will not reload with 0.
Do you know what should I configure?
Hi @rodger_an ,
Please check if
1. The trig pin is set to right function.
2. Please check TPMx_CONF[TRGSEL], [TRGSRC] and TRGPOL is correct.
3. The trigger input is ignored if the TPM counter is paused during debug mode or doze mode. This field
should only be changed when the TPM counter is disabled.
Regards,
Jing
Hi jingpan,
1. The trig pin is set to right function.
2. Please check TPMx_CONF[TRGSEL], [TRGSRC] and TRGPOL is correct.
This two item should be correct.
Because right now I reset CNT to 0 when interrupt happen, I can capture a fixed CNT value when the duty of input signal is fixed, also I calculate the time depended on timer frequency and CNT value, it is same with the period of waveform.
void TPM0_IRQHandler(void)
{
TPM0->CNT = 0; //reset counter
TPM_ClearStatusFlags(TPM0,kTPM_Chnl0Flag);
}
3. The trigger input is ignored if the TPM counter is paused during debug mode or doze mode. This field
should only be changed when the TPM counter is disabled.
I change this field before starting timer.