| View previous topic :: View next topic |
| Author |
Message |
robo Semi Newbie
Joined: 25 Nov 2010 Posts: 5
|
Posted: Thu Nov 25, 2010 7:14 pm Post subject: Triggering PIC from RS-232 port |
|
|
So I'm working on a PIC project that would be triggered from a PC serial port. The software (commercial program) can either send the trigger on pin 4 or pin 7 of the COM port. I'm only looking for a trigger and not serial communications, so I'm hoping for something simpler than using a MAX232. Any ideas of how to interface the RS-232 pin to a PIC 16F628 I/O pin?
Thanks.... |
|
| Back to top |
|
 |
|
 |
Alan Site Admin

Joined: 29 Jan 2006 Posts: 1399 Location: Winnipeg, MB
|
Posted: Sat Dec 11, 2010 9:59 am Post subject: Re: Triggering PIC from RS-232 port |
|
|
| robo wrote: | So I'm working on a PIC project that would be triggered from a PC serial port. The software (commercial program) can either send the trigger on pin 4 or pin 7 of the COM port. I'm only looking for a trigger and not serial communications, so I'm hoping for something simpler than using a MAX232. Any ideas of how to interface the RS-232 pin to a PIC 16F628 I/O pin?
Thanks.... |
There are a few simple ways to do it. You could use an opto isolator.
http://en.wikipedia.org/wiki/Opto-isolator
If this will be running on a single PC you could measure the voltage of the pin when active and use a resistor network to bring it to 5 volts (this might not be needed since there are lots of ports that use 0 and 5 volts on their outputs these days).
You could drive the base of a transistor with the PC port and use the transistor to activate the PIC pin to 5 volts or ground.
And last solution is the simplest, tie the port to the PIC input through a 10K to 100K resistor, this will allow the internal protection diode of the PIC shunt the extra voltage and just read high and low. This isn't an elegant solution but it is common. |
|
| Back to top |
|
 |
|