LPUART_IRQHandler is not getting working for the first one byte.

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPUART_IRQHandler is not getting working for the first one byte.

ソリューションへジャンプ
3,136件の閲覧回数
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 件の賞賛
返信
1 解決策
2,931件の閲覧回数
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 件の賞賛
返信
4 返答(返信)
2,932件の閲覧回数
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 件の賞賛
返信
2,931件の閲覧回数
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 件の賞賛
返信
2,931件の閲覧回数
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 件の賞賛
返信
2,931件の閲覧回数
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 件の賞賛
返信