K22 LPUARTx_CTRL Writes

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

K22 LPUARTx_CTRL Writes

ソリューションへジャンプ
1,799件の閲覧回数
LSmith-NK
Contributor I

I am working with a MK22FN512CAP12R and per it's reference manual, document K22P121M120SF7RM Rev 4, 8/20216, the LPUARTx_CTRL register "should only be altered when the transmitter and receiver are both disabled." However, the Transmit / receive enable/disable bits are in this register? Does that mean that once the LPUART's transmit and/or receiver are enabled, that there is no way to disable them again without removing power and thus resetting the register?

This isn't quite desirable in my case for power reasons but I do not want to be writing to LPUART_CTRL once they are enabled in fear of indeterminate behavior.

Cheers

ラベル(1)
0 件の賞賛
返信
1 解決策
1,795件の閲覧回数
bobpaddock
Senior Contributor IV

What it is trying to say is changing other bits in the register during operation will cause unknown glitches. So turn off the Rx and Tx while configuring the other bits.

To configure, in pseudo-code:

LPUART_CTRL = 0UL; /* Turn everything off */

LPUART_CTRL = (Configuration bits with Rx and Tx off);

LPUART_CTRL |= (RX|TX); /* Turn on both, or as needed, RX and TX */




元の投稿で解決策を見る

2 返答(返信)
1,796件の閲覧回数
bobpaddock
Senior Contributor IV

What it is trying to say is changing other bits in the register during operation will cause unknown glitches. So turn off the Rx and Tx while configuring the other bits.

To configure, in pseudo-code:

LPUART_CTRL = 0UL; /* Turn everything off */

LPUART_CTRL = (Configuration bits with Rx and Tx off);

LPUART_CTRL |= (RX|TX); /* Turn on both, or as needed, RX and TX */




1,789件の閲覧回数
LSmith-NK
Contributor I

So you CAN re-disable the transmitter and receiver, but that is all you should be doing if they are enabled prior to changing any other bits. Thank you! 

0 件の賞賛
返信