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

Using a phono cable for serial data, PIC freezing

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



Joined: 17 Dec 2005
Posts: 58

View user's profile Send private message

Using a phono cable for serial data, PIC freezing
PostPosted: Tue Oct 09, 2007 4:33 pm     Reply with quote

Im using a PIC18 to interface with a serial device that uses a phono cable for its serial interface. Im finding sometimes when the phono cable is inserted or removed it causes the PIC to freeze.

I imagine it is due to a momentary shorting of the 2 TX outputs, which idle at 3.3 volts. I also find sometimes instead of freezing the PIC, it will just cause the serial port on the PIC to not respond to any incoming data until it is reset.

This posting is probably not software or CCS related but I thought someone in here might have an idea. The TX/RX pins are connected directly to the female phono jack, no additional components.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Oct 09, 2007 6:31 pm     Reply with quote

Add the ERRORS parameter to your #use rs232 statement. This will
clear any error conditions that could cause the UART to lock up.
ktallevi



Joined: 17 Dec 2005
Posts: 58

View user's profile Send private message

PostPosted: Tue Oct 09, 2007 6:43 pm     Reply with quote

ERRORS is already defined, the PIC is in sleep mode (external XTAL disabled), until there it has been woken up by incoming serial data.

Perhaps enabling a very short watchdog timer could provide a partial solution. The WDT would start up upon 'waking up', and expire if no real serial data has come in... of course reset the watchdog if usable data comes in..

what do you think?
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Tue Oct 09, 2007 7:41 pm     Reply with quote

Could the problem be ESD (static electricity)? That could disrupt the PIC hardware in ways that only a reset or power cycle could recover from. Try adding some series resistance between the PIC and connector, and some capacitance on the PIC pins. Set the RC time constant to about 10% of the serial bit length, so it won't hurt serial comms but will limit and damp the ESD pulse when contact is made.
_________________
The search for better is endless. Instead simply find very good and get the job done.
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