CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Detecting PC conection - Hardware question - SOLVED

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

Detecting PC conection - Hardware question - SOLVED
PostPosted: Mon Dec 13, 2010 7:58 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Dec 13, 2010 8:18 am     Reply with quote

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: 9162
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Dec 13, 2010 9:58 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Dec 13, 2010 11:55 am     Reply with quote

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

View user's profile Send private message Send e-mail

RE:
PostPosted: Tue Dec 14, 2010 12:14 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group