KLO3: Using TPM0 to trigger TPM1?

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

KLO3: Using TPM0 to trigger TPM1?

513 Views
sarastout-grand
Contributor III

Hello,

I'm using the KL03 on KDS. I'm trying create a BPSK output signal that is essentially an output from the TPM1 timer which would ideally flip phase based on an interrupt from TPM0 whenever required. To do this, I want to use the TPM0 overflow interrupt as a trigger source for the TPM1 timer to force it to reload it's counter and hence flip its phase. Is that possible? My attempts at it so far have not worked.

So, do you know if it is possible to trigger one timer off of an event generated on the other?

Thanks,

Sara

Labels (1)
0 Kudos
1 Reply

346 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hello Sara Stout-Grandy,

     As you know, the TPM counter has two modes of operations:

• up counting : SC[CPWMS] = 0.
• up-down counting :SC[CPWMS] = 1.

  So, if you want to force the TPM1 counter reload the data. What data you want to reload?

  The TPMx_CNT register, Writing any value to COUNT also clears the counter.

  If you just want to reload the TPM1 COUNT to 0 when the TPM0 overflow, you can write the TPM1 COUNT directly in the TPM0 overflow interrupt.

  If you want to modify the MOD register, please refer to the reference manual to operate it:

31.5.8.1 MOD Register Update
If (CMOD[1:0] = 0:0) then MOD register is updated when MOD register is written.
If (CMOD[1:0] ≠ 0:0), then MOD register is updated according to the CPWMS bit, that
is:
• If the selected mode is not CPWM then MOD register is updated after MOD register
was written and the TPM counter changes from MOD to zero.
• If the selected mode is CPWM then MOD register is updated after MOD register was
written and the TPM counter changes from MOD to (MOD – 1).

Wish it helps you!

If you still have question, please let me know!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos