Regarding the occurrence of LPUART interrupt? in 144k

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Regarding the occurrence of LPUART interrupt? in 144k

跳至解决方案
973 次查看
DKTempest
Contributor I

I was downloading some examples from this community.

And I did some modifications to fit the board I had.

But my question is at what point an interrupt occurs and sends data.

In the case of GPIO, I understand that it occurs via input, And Time interrupts occur according to the divided clock.

But I don't know the exact point of occurrence of UART interrupt.
I used an LCD with 4800 baud rate.

I didn't know the exact point even when I used step_into (F5) menu of debug menu.

I am attaching my code and operation picture below.

DKTempest_0-1621217637607.png

 

 

0 项奖励
回复
1 解答
960 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

there are several interrupt sources in LPUART. It is summarized in chapter 53.4.7 Interrupts and status flags of the RM. Also refer to STST and CTRL registers.

In your code you have just RIE bit set, so interrupt will be called after RDRF bit is set, indicating you have received data. You can put reading STAT register in beginning of you interrupt routine to know the interrupt source.

Seems you does not have RX pin configured, it may case module detect RX pin low, making character detection (RDFD set), thus you enter interrupt (unintentionally) and leave it after all is send as you are using polling for transmission.
So set RX pin, probably PC6 pin. You have PC9 and PC7, which both has just TX functionality. 

BR, Petr

在原帖中查看解决方案

0 项奖励
回复
3 回复数
961 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

there are several interrupt sources in LPUART. It is summarized in chapter 53.4.7 Interrupts and status flags of the RM. Also refer to STST and CTRL registers.

In your code you have just RIE bit set, so interrupt will be called after RDRF bit is set, indicating you have received data. You can put reading STAT register in beginning of you interrupt routine to know the interrupt source.

Seems you does not have RX pin configured, it may case module detect RX pin low, making character detection (RDFD set), thus you enter interrupt (unintentionally) and leave it after all is send as you are using polling for transmission.
So set RX pin, probably PC6 pin. You have PC9 and PC7, which both has just TX functionality. 

BR, Petr

0 项奖励
回复
947 次查看
DKTempest
Contributor I

I checked the part where I set the wrong port.

However, I didn't have to provide TX because the LCD of the board I use only provides RX ports.

Well, if I may apply your words, Is it correct that the RX pin of s32k144 is detected unconditionally because the TX of LCD does not exist?

0 项奖励
回复
927 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

if the LCD does not send anything, so RX pin on MCU is not used then keep it pulled high and do not use RX interrupt to send data to LCD. Either use polling or enable TX interrupt when transfer is desired.

BR, Petr

0 项奖励
回复