K22 LPUARTx_CTRL Writes

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

K22 LPUARTx_CTRL Writes

Jump to solution
1,819 Views
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

Labels (1)
0 Kudos
Reply
1 Solution
1,815 Views
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 */




View solution in original post

2 Replies
1,816 Views
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,809 Views
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 Kudos
Reply