LPUART K66 problem transmitting

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

LPUART K66 problem transmitting

Jump to solution
812 Views
larrydemuth
Contributor III

I'm using the LPUART, and it works fine IF the bytes I send are 0x00 - 0x7F. If I send anything above 0x7F, it doesn't send it. Looking at the stats it shows the correct number of TX characters, but I don't see them all on the scope.

I have an application where 3 bytes are sent. The first byte will be 0x40 - 0x4f, the second will be 0x80 - 0xBF, and the last 0xCC. I see the first byte on the scope, but not the other 2 bytes. If I change the second 2 bytes to be less than 0x7F, I see all three bytes.

Is there an issue with the LPUART, or a setting that I missed that will not allow a byte 0x80 and up to be transmitted? I find it very strange that a UART would not allow it. 

Larry

Labels (1)
Tags (1)
0 Kudos
1 Solution
688 Views
larrydemuth
Contributor III

Never mind, I found the problem.

When writing to the DATA register I was not casting the byte to unsigned.

sci_ptr->DATA = c;

When I cast it to unsigned, it works.

sci_ptr->DATA = (uint8_t)c;

It must have been messing up the other bits in the register.

View solution in original post

0 Kudos
2 Replies
689 Views
larrydemuth
Contributor III

Never mind, I found the problem.

When writing to the DATA register I was not casting the byte to unsigned.

sci_ptr->DATA = c;

When I cast it to unsigned, it works.

sci_ptr->DATA = (uint8_t)c;

It must have been messing up the other bits in the register.

0 Kudos
688 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Thank you, Larry.

0 Kudos