S32K144EVB UART 8bit Send Receive Problem

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

S32K144EVB UART 8bit Send Receive Problem

1,199 次查看
hjinha
Contributor II

I use two S32K144EVB for UART Communication.

One only sends value (I will call TX S32K),

the other only receives value(I will call RX S32K).

The problem is that "RX S32K" Can not receive the value over 0x80 ~ 0xFF.

It seems only receive 0x7F(7bit).

"RX S32K" Can receive the value from 0 to 127(0x7F).

Also I couldn't find the value over 0x80 in RxBuff, when using Debug breakpoint.

I  use this function

void LPUART1_transmit_char(char send)

{ /* Function to Transmit single Char */
   while((LPUART1->STAT & LPUART_STAT_TDRE_MASK)>>LPUART_STAT_TDRE_SHIFT==0);
/* Wait for transmit buffer to be empty */
   LPUART1->DATA=send; /* Send data */
}

I try many things, but i don'y know reason about this problem.

标记 (2)
2 回复数

1,028 次查看
hjinha
Contributor II

Thank you.

I solved the problem!

The data type was a problem. 

I changed Char data type to unsigned Char data type

void LPUART1_transmit_char(char send)

{ /* Function to Transmit single Char */
   while((LPUART1->STAT & LPUART_STAT_TDRE_MASK)>>LPUART_STAT_TDRE_SHIFT==0);
/* Wait for transmit buffer to be empty */
   LPUART1->DATA=send; /* Send data */
}

1,028 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

Have you analyzed the signal on the bus? 

Is TX MCU sending correct data?

Thanks.

Daniel 

0 项奖励
回复