Quantcast
Channel: MSP low-power microcontrollers
Viewing all articles
Browse latest Browse all 62446

Forum Post: RE: How to awake the MCU from LPM3?

$
0
0
doaccelereationsense() is this code. //¦----------------------------- Main Function-------------------------------------------¦ void doAccelerationSense() { { cached_accelerationXMSB = 0; // Considered an "invalid" value cached_accelerationXLSB = 0; // means the sensor did not work cached_accelerationYMSB = 0; cached_accelerationYLSB = 0; cached_accelerationZMSB = 0; cached_accelerationZLSB = 0; // *** Save state of all registers modified by the acceleration sensing code *** uint16_t original_P1DIR = P1DIR; uint16_t original_P1IE = P1IE; uint16_t original_P1OUT = P1OUT; uint16_t original_P1REN = P1REN; uint16_t original_P1SEL = P1SEL; uint16_t original_P1SEL2 = P1SEL2; setUARTPins(); uart_init(); set_UARTUCS(); // Enable intterupts IE2 |= UCA0TXIE; // Enable the Transmit interrupt IE2 |= UCA0RXIE; // Enable the Receive interrupt _BIS_SR(GIE); // Enable the global interrupt ///////////////getAcceleration will make the MSP430 talks to the BNO055 getAcceleration(); // *** Restore all registers modified by the acceleration sensing code back to their previously saved state *** P1IE = original_P1IE; P1DIR = original_P1DIR; P1REN = original_P1REN; P1SEL = original_P1SEL; P1SEL2 = original_P1SEL2; P1OUT = original_P1OUT; set_UCS(); __bis_SR_register(LPM3_bits + GIE); // Enter LPM3 w/ int until Byte RXed } And I would like to ask: is it possible to use interrupts with out going to any LPM? if so, in this case should I keep the RX & TX ISR but remove the _bic_SR_register(LPM3) from them?

Viewing all articles
Browse latest Browse all 62446

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>