UART uint8_t transmitter function [s32k144]

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

UART uint8_t transmitter function [s32k144]

Jump to solution
1,450 Views
electronica2pow
Contributor III

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

Tags (3)
0 Kudos
1 Solution
1,181 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,
If the program receives ‘1‘ in ascii which is 49, it will return ‘>‘ (62) and uint8_t = 12.

It seems it works.

pastedImage_1.png

Regards,
Daniel

View solution in original post

2 Replies
1,182 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,
If the program receives ‘1‘ in ascii which is 49, it will return ‘>‘ (62) and uint8_t = 12.

It seems it works.

pastedImage_1.png

Regards,
Daniel

1,181 Views
electronica2pow
Contributor III

  I was using Putty and it doesn't simulate it correctly, so i know that i wasn't using the right program, as always, Thanks Daniel!

0 Kudos