LPUART_IRQHandler is not getting working for the first one byte.

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

LPUART_IRQHandler is not getting working for the first one byte.

Jump to solution
1,541 Views
angaraltangerel
Contributor II

I'm a beginner in MCUXPresso and FRDM or kinetis microcontrollers. 

I'm trying to use a LPUART RX interrupt handler. But If I send a single character it doesn't work.

for example If I send 

'A' the interrupt handler doesn't work.

next

'B' interrupt handler works but LPUART_ReadByte returns 'A' (last byte).

I think it's FIFO related problem but I'm still not sure how to fix it.

OR

RxData Register doesn't get full. (I tried changing uart data bit size and stop bits but still doesn't work).

Experts please help me.

Thank you in advance.

Here is my LPUART init code.

pastedImage_1.png

0 Kudos
1 Solution
1,336 Views
angaraltangerel
Contributor II

Hello Edgar Eduardo.

I'm using MKE15Z256VLL7 (FRDM - KE02Z board).

I'm using getDefaultConfig

(which has

config.txFifoWatermark = 0;
config.rxFifoWatermark = 0; ) I've also tried adding these lines but still interrupt gets triggered at the second byte. 

:smileysad:

Regards.

View solution in original post

0 Kudos
4 Replies
1,337 Views
angaraltangerel
Contributor II

Hello Edgar Eduardo.

I'm using MKE15Z256VLL7 (FRDM - KE02Z board).

I'm using getDefaultConfig

(which has

config.txFifoWatermark = 0;
config.rxFifoWatermark = 0; ) I've also tried adding these lines but still interrupt gets triggered at the second byte. 

:smileysad:

Regards.

0 Kudos
1,336 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Angar,

Are you using MKE15Z device in a FRDM-KE02 board? I wouldn't recommend this, as KE15 and KE02 are not fully compatible devices.

Now, assuming that you are using SDK for KE15Z and that you already checked the lpuart_interrupt example, then, the way you received data will depend in your interrupt handler and in your while loop, for instance, the example implements a loopback, I would recommend you to check this example and verify if your interrupt is correctly triggered.

Best regards

0 Kudos
1,336 Views
angaraltangerel
Contributor II

Hi Jorge. 

I'm sorry what i meant was FRDM - KE15Z. yeah I checked the example. But still the interrupt gets triggerred only after it receives the 2nd byte. ..

0 Kudos
1,336 Views
EdgarLomeli
NXP Employee
NXP Employee

Hello Angar.


Try adding that instructions before calling LPUART_Init

config.txFifoWatermark = 0;
config.rxFifoWatermark = 0;

Watermark levels determinate how many bytes receive and transmit before executing IRQ handler.

Which MCU are you using?

Some Kinetis MCU's don't have FIFO functionality and the last corrections aren't going to fix your issue.      

Let me know your results.

Regards.

0 Kudos