I use PIC16F1825 to communicate via UART (async) with external device. Running on batteries I have to spend as little power as possible.

Since my external device may transmit no data for minutes I though about putting the PIC microcontroller into SLEEP mode while waiting for data.

Unfortunately it's not simple, because asynchronous UART requires main oscillator (PIC manual). Implementing UART manually may solve the problem, if PIC would be able to recover from SLEEP quick. My PIC16F1825 device requires 1024 x Tosc to start working after SLEEP. It's way to slow :(

UART: 115200N8

My question is: How can I save considerable amount of power during the time between transmissions?

PS I can move to some other microcontroller within the same price region and packaging size (4mm x 4mm).

  • 1
    \$\begingroup\$ Could you change the hardware interface between the two devices, or the protocol used? \$\endgroup\$
    – CL.
    Commented May 12, 2015 at 7:49
  • \$\begingroup\$ No, this is not an option. I could reduce the baud rate, though. \$\endgroup\$ Commented May 12, 2015 at 8:37
  • \$\begingroup\$ Could you use some handshake lines to power the PIC? \$\endgroup\$ Commented May 12, 2015 at 9:15
  • \$\begingroup\$ I'm sorry, what do you mean by "handshake line" and how it could help? \$\endgroup\$ Commented May 12, 2015 at 9:38

1 Answer 1


What about sending an interrupt to the PIC before transmission? The PIC can do wake-on-interrupt, so if you interrupted the PIC before beginning your UART transmission, that would allow you to stay in sleep mode until it's time to transmit.

  • 1
    \$\begingroup\$ Quite right. If you can sacrifice the first character of your transmission you should be able to make it into a pulse that is used for wake up. You may also be able to correct for the first character error if it is amongst certain convenient selection like "AT" that modems used to determine bit rate. The results that you read may be wrong but might be useable if you know how many bit times were lost after the start bit started the reset process. \$\endgroup\$
    – KalleMP
    Commented May 12, 2015 at 8:32
  • \$\begingroup\$ The first character is the size of the packet :( Running at maximum speed (32MHz) PIC needs 1024*32MHz = 32ns to wake up. Implementing UART manually, I will loose 2-3 data bits. May be I can use flow control pins somehow? \$\endgroup\$ Commented May 12, 2015 at 8:48
  • \$\begingroup\$ Does your setup consist of two microcontrollers communicating with each other? Or is it some device like a sensor communicating with the PIC you're describing? \$\endgroup\$
    – justinrjy
    Commented May 12, 2015 at 8:53
  • \$\begingroup\$ It's a proprietary board with microcontroller, that I can't reprogram. I'm not sure, if I can reduce baud rate. But if I can, this could help me to catch the first data bit after waking up on the falling edge of the start bit. \$\endgroup\$ Commented May 12, 2015 at 9:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.