Perhaps you could wire the Rx line to not only the Rx pin but an RBx interrupt pin. As soon as the line transitions it will wake up the device if appropriately configured.
Perhaps you could wire the Rx line to not only the Rx pin but an RBx interrupt pin. As soon as the line transitions it will wake up the device if appropriately configured.
That would wake up the PIC, but, if the USART is configured as asynchronous and none of the PIC clocks were running while it was asleep, would that start bit be picked up by the USART module?
Perhaps you could wire the Rx line to not only the Rx pin but an RBx interrupt pin. As soon as the line transitions it will wake up the device if appropriately configured.
That would wake up the PIC, but, if the USART is configured as asynchronous and none of the PIC clocks were running while it was asleep, would that start bit be picked up by the USART module?
No, you need to have BaudRate generator running to enable reception.
My Idea is to:
1. Disable USART before sleep
2. Enable PortB on-change interrupt
3. Go to sleep
4. Send AAh char from PC
5. PIC will wake-up and enable USART
6. recieve valid char
The only disadvantage is that first Char can't be received...
If you're using hardware handshaking you could use an interrupt pin (Portb) to do the handshaking. When you want to send something to the pic first 'pull' the handshaking line...
Actually, I wanted to use sleep to save power. So the device sending data to the PIC won't know that the PIC is asleep and won't know to send something to wake it up.
How about a 16F628? I don't see anything in the datasheet that says it can't wake with the UART.
There's nothing in the datasheet that says is doesn't make tea either!, but I'm fairly sure they don't :lol:
Is there anything in the datasheet that says it CAN wake from the USART?, I wouldn't have thought so?, as already suggested the USART will be shutdown with the rest of the PIC.
How about just using a software UART?, you could use a change on an external pin to wake the PIC, then go straight into a software serial routine, on the same pin - you could make the initial half bit time delay shorter than normal in order to compensate for the waking time of the PIC.