Gday all
I am looking for ideas on the best way to waken a sleeping pic, based on data sent from a PC.
I am planning on using a 16f88, but on reading the datasheet, i cannot use an interrupt on the usart unless i'm in synchronous mode.
I need to operate asynch, so was wondering what the best option would be.
Basically i will have a piece of equipment controlled by a bog std RS232 connection.
I plan to tap into the PC Tx, and passively snoop for special commands to operate a power switch.
On receiving a specific code, the PIC will open a MOSFET and thus supply power to the equipment.
On receiving another code, the PIC will close the MOSFET and hence turn off power ( but stay powered itself ). After say 10mins with no serial traffic, ( and Mosfet turned off ), i will put the PIC to sleep.
When asleep ( which may last for days ), i need to still watch/trap any serial traffic, and if detected, wake up the PIC and then act on it.
So, what is the best way to do this.
1) Can i waken the pic and still trap the data in one operation
2) Do i need to say set a pin to input, and just use a std "on change" interrupt to waken the PIC, then configure the usart to send a code to the host PC saying i',m awake, then get the PC to resend the real code.
3) anything better?
I'm still going through the datasheets, but still cant find a way of doing it in one operation, which is the preferred method.
Any pointers greatly appreciated.
Andrew
Bookmarks