K66 UART1 TX Modulation wit FTM2_CH0 - looks to have an error

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

K66 UART1 TX Modulation wit FTM2_CH0 - looks to have an error

527 Views
mjbcswitzerland
Specialist V

Hi All

If I use TPM1_CH0 to multiplex LPUART0 Tx it works as expected:

pastedImage_1.png
Here I use the TPM1_CH0 output to generate an accurate break just before a Tx frame (SIM_SOPT5 has 0x00010000 set to select this).

pastedImage_2.png

When I did the same on UART1 with FTM2_CH0 there was no effect when SIM_SOPT5 has 0x00000020 set.

pastedImage_3.png

However, by chance, I found that there is an effect but it depends on "both" FTM2_CH0 AND FTM2_CH1!

pastedImage_4.png

The modulation on UART1 Tx is only present when FTM2_CH0 is low AND FTM2_CH1 is high!

Since I was also using FTM2_CH1 for another reason and it was low it was stopping output (doing the same with TPM1_CH1 didn't do the same - it had no effect).
(If I change the polarity of FTM2_CH1 it doesn't change the output - still does the same).
Since I need FTM2 CH1 (and it is longer than FTM2_CH0) this therefore doesn't allow the operation that is needed (it stops the modulation working).

Question:
Is this effect known or expected? Is it an error in the chip?

Regards

Mark

Labels (1)
0 Kudos
2 Replies

312 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Mark,

Not quite sure about your question.

I test the attached project on FRDM-K66F board.
The FTM2_CH0 can modulate UART1_TX when FTM2_CH1 is low.

You can see the images: when I increase the duty of FTM2_CH0 during FTM2_CH1 is low, UART1_TX can be modulated by FTM2_CH0.

imageFile.png

imageFile.png

imageFile.png

imageFile.pngimageFile.png

The MaskSet of K66 on FRDM-K66F is 0N65N.

FRDM-K66F.jpg

Best Regards,

Robin

 

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

0 Kudos

312 Views
mjbcswitzerland
Specialist V

Robin

Thanks for looking into this.

I think the difference is that I initially have the UART1 transmitter disabled. I use the FTM_CH1 to enable the Tx by DMA so that it starts transmitting data that has been prepared also via DMA. This gives a fixed 10 baud delay between enabling the Tx and it sending its first byte.
Looking at your timing, I expect that you are using the FTM_CH1 to start a UART transmission (whereby you have the UART1 transmitter always enabled - then the first byte starts quicker).

Therefore I expect that is you simply disable the UART1 transmitter (UART0_C2 with UART_C2_TE set to 0) you will then find that the modulation on the Tx line stops altogether. You don't need to send any UART data to test the modulation but I expect that you will now find that the "break condition" works when you have UART1 Tx enabled but doesn't when UART1 Tx is disabled - meaning that the modulation requires the Tx to be enabled!

I don't know whether this is expected or not but it is a different behavior to the LPUART, which 'does' continue the modulation on its Tx line even when its transmitter is disabled.

I didn't think of a dependency on the Tx being enabled before but as soon as I saw your results it looked to give the explanation.
For me it means that I can't use my technique on the UART (releasing the next frame by enabling the transmitter, which gives the ultimate accuracy) so I'll look for a different method to release the waiting DMA data (maybe I can use the interrupt enable rather than transmitter enable(?)).

Regards

Mark

0 Kudos