Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Sleep wakeup on UART RX

Status
Not open for further replies.

upand_at_them

Active Member
Is it possible to have a 16F88 wakeup from sleep for a RX interrupt, and how would this be done? With no lock the SPBRG is useless, no?

The code I've written that I thought might work just stays in sleep.

Mike
 
Hi Mike,

You can't do it if the USART is in asynchronous mode... No on-chip clocks are running...

Regards, Mike
 

Attachments

  • temp.jpg
    temp.jpg
    52.7 KB · Views: 946
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?

Regards, Mike
 
Mike said:
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?

Regards, Mike
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...

If you're not using hardware handshaking then nm.
 
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.

Mike
 
upand_at_them said:
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.
 
Just noting that the pic's wakeup time is very fast compared to serial comms. You probably won't lose much timing.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top