LPUART K66 problem transmitting

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

LPUART K66 problem transmitting

跳至解决方案
820 次查看
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

标签 (1)
标记 (1)
0 项奖励
1 解答
696 次查看
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 项奖励
2 回复数
697 次查看
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 项奖励
696 次查看
Hui_Ma
NXP TechSupport
NXP TechSupport

Thank you, Larry.

0 项奖励