K22 LPUARTx_CTRL Writes

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

K22 LPUARTx_CTRL Writes

跳至解决方案
2,061 次查看
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 解答
2,057 次查看
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 回复数
2,058 次查看
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,051 次查看
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 项奖励
回复