lpuart_rcv

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

lpuart_rcv

1,446件の閲覧回数
intern_praveena
Contributor II

I m using S32K144_64 , i have  done uart send and recive using LPUART1,but nothing is displayed in putty but while debugging its working.here is my code, only send data is working.

#include "Cpu.h"

volatile int exit_code = 0;
uint8_t txbuff = 'A';
uint8_t rxbuff;
uint8_t rem_data;

CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT, g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);
CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_FORCIBLE);

PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);
PINS_DRV_SetPinsDirection(PTB,(1<<0));
PINS_DRV_SetPins(PTB,(1<<0));

LPUART_DRV_Init(INST_LPUART1, &lpuart1_State, &lpuart1_InitConfig0);
while(1)
{
//LPUART_DRV_SendData(INST_LPUART1,&txbuff,1);
PINS_DRV_WritePins(PTB,(0<<0));
LPUART_DRV_ReceiveData(INST_LPUART1,&rxbuff,1);
}

0 件の賞賛
返信
4 返答(返信)

1,194件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

if using non-blocking function you should add waiting for successful RX process. Try below code

uint32_t bytesRemaining;

while(1)
{
   PINS_DRV_WritePins(PTB,(0<<0));
   LPUART_DRV_ReceiveData(INST_LPUART1,&rxbuff,1);

   /* Wait for transfer to be completed */
   while(LPUART_DRV_GetReceiveStatus(INST_LPUART1, &bytesRemaining) == STATUS_BUSY);

   // process receive data here


}

BR, Petr

0 件の賞賛
返信

1,194件の閲覧回数
intern_praveena
Contributor II

Now its printing i changed putty settings but now microcontrlr is not receiving .

0 件の賞賛
返信

1,194件の閲覧回数
intern_praveena
Contributor II

I want to send and receive through microcontroler,but only transmit is working.

can anyone hlp me to resolve this problem?

0 件の賞賛
返信

1,194件の閲覧回数
intern_praveena
Contributor II

hi petr Stancik,

non - blocking is false. The same happen again,if i press '1' its not display.

0 件の賞賛
返信