View previous topic :: View next topic |
Author |
Message |
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
|
Detecting PC conection - Hardware question - SOLVED |
Posted: Mon Dec 13, 2010 7:58 am |
|
|
hello,
is there a way to detect when a PC is attached to my PIC?
(RS-232)
i was thinking of using free pins on a DB9 to act as a switch on one of the PICs pins...
the idea is to save battery life by avoiding usless printfs
no pc attached.... nobody is reading them... no need to print them.
im using a 16f876A...
thanks, _________________ CCS PCM 5.078 & CCS PCH 5.093
Last edited by Gabriel on Mon Dec 13, 2010 11:55 am; edited 1 time in total |
|
|
Battery David
Joined: 01 Feb 2010 Posts: 25
|
|
Posted: Mon Dec 13, 2010 8:18 am |
|
|
I use a MAX3227E, it has a PC CONNECTED output pin. It is also ESD protected so that might save you something on your protection. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9229 Location: Greensville,Ontario
|
|
Posted: Mon Dec 13, 2010 9:58 am |
|
|
Making your own custom connector is easy and foolproof. I have 3 or 4 types here to tell my PICs which comport on the PC it's connected to(real com1,real com 2, Useless Serial Bus,etc)
Done right ,it'll also tell the PC the PICs not there! |
|
|
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
|
|
Posted: Mon Dec 13, 2010 11:55 am |
|
|
Thank you both for your input.
@Temtronic: your suggestion was my original idea... thanks for confirmation....
@Battery David: awesome chip suggestion... will buy these instead of the regular max 232 on my next parts purchase... _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|
|
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
RE: |
Posted: Tue Dec 14, 2010 12:14 am |
|
|
The PIC firmware should send data only when a command from the PC is received.
To get data from the PIC a command should be sent from the PC, the PIC receives the command and sends the data out.
thanks
a |
|
|
|