AnsweredAssumed Answered

UART uint8_t transmitter function [s32k144]

Question asked by Electronica2 Powertrack on Apr 23, 2018
Latest reply on Apr 25, 2018 by Electronica2 Powertrack

Hi to the community,

 

I am trying to send an uint8_t number using this function:

 

void LPUART1_transmit_int(uint8_t number){
while((LPUART1->STAT & LPUART_STAT_TDRE_MASK)>>LPUART_STAT_TDRE_SHIFT==0);
/* Wait for transmit buffer to be empty */
LPUART1->DATA=number; /* Send data */

}

 

But it doesn't work. I am going to attach the code below.

 

The original one is: 

 

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 */
}

Attachments

Outcomes