LPUART K66 problem transmitting

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPUART K66 problem transmitting

ソリューションへジャンプ
1,589件の閲覧回数
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 解決策
1,465件の閲覧回数
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 返答(返信)
1,466件の閲覧回数
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 件の賞賛
返信
1,465件の閲覧回数
Hui_Ma
NXP TechSupport
NXP TechSupport

Thank you, Larry.

0 件の賞賛
返信