PDA

View Full Version : Baud sniffing



anj
- 3rd January 2005, 21:56
Gday all
I have a piece of equipment which is controlled via serial commands, with a possibility of 8 different ( and known ) baud rates.
The equipment can be controlled locally by a std handcontrol ( at the equipment end ) and computer programs at the PC end.
What i want to do is tap into the PCs Tx line to control an on/off switch at the equipment ( safety switch ).
On receiving a set command the PIC would disable the equipment. On receiving another, it would turn on the power. All other commands would be passed on to the equipment.
My problem is what is the best way to set up a pic to ensure i can always be listening for data, but also maybe polling in the background to see if the baud rate was changed.
My concern is if somehow, the PC baud changes, the pic will never receive a valid command.
A less elegant method is to send the commands, once at each baud rate from the PC end but i was wondeing if there was a nicer way to do it with the PIC functionality.
Andrew