Joined: 30 Aug 2005 Posts: 155 Location: Calgary, AB
Serial port and sleep
Posted: Mon Jun 26, 2006 3:19 pm
How do you turn off the serial usart during sleep. Will this work, the cpu seems to keep resetting.
Sleep code
Code:
temp=input(pin_B2);
temp=input(pin_B5);
VCC_OFF;
PORT_B_PULLUPS(0x01); // one pull up enabled on port B0 ext int for wake
disable_interrupts(INT_TBE); // keep off all serial ports until wake up
disable_interrupts(INT_RDA); // keep off all serial ports until wake up
Wake code
Code:
output_float(pin_B2); //release RX pin form low state
output_float(pin_B5); //release TX pin form low state
PORT_B_PULLUPS(0x01); // one pull up enabled on port B0
enable_interrupts(INT_RDA); // Turn on serial port
enable_interrupts(INT_TBE); // Turn on serial port
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Mon Jun 26, 2006 3:38 pm
Quote:
How do you turn off the serial usart during sleep ?
Do this:
Code:
setup_uart(FALSE);
To turn it back on:
Code:
setup_uart(TRUE);
This is in the manual.
Note that this only works with the hardware UART.
Eugeneo
Joined: 30 Aug 2005 Posts: 155 Location: Calgary, AB
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum