Regarding the occurrence of LPUART interrupt? in 144k

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

Regarding the occurrence of LPUART interrupt? in 144k

Jump to solution
926 Views
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 Kudos
1 Solution
913 Views
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

View solution in original post

0 Kudos
3 Replies
914 Views
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 Kudos
900 Views
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 Kudos
880 Views
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 Kudos