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 CCS Technical Support

Is this a valid circuit? (picture attached)

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



Joined: 04 Aug 2004
Posts: 238
Location: Chicago

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

Is this a valid circuit? (picture attached)
PostPosted: Thu Aug 11, 2005 8:58 am     Reply with quote

Currently, I don't have pin ECCP attached, but only CCP1 is attached. However, i'm finding that I need the other ECCP attached. (This is just a slice of a bigger picture, in case you were wondering why i'd want to do such a thing).

Basically, my question is: Can I have two PIC pins shorted together, while taking care that no two are ever outputs at the same time? One will be an input (thus Hi-Z) while the other is an output, and vice versa.

Or are there any precautions I must take?

Reason why i want to do this hw kludge is because 1) it is too late to change the hw, and 2) it'll save me a few more resistors and opto.

asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Aug 11, 2005 9:10 am     Reply with quote

Yes this is a valid config. What is R1 meant to do?
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
MikeValencia



Joined: 04 Aug 2004
Posts: 238
Location: Chicago

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

PostPosted: Thu Aug 11, 2005 9:39 am     Reply with quote

asmallri wrote:
Yes this is a valid config. What is R1 meant to do?


Actually, my opto is an H11L1M schmitt trigger output.

R2 is a current limiting resistor, while R1 just keeps it pulled up to prevent the opto from firing 'by itself'.

You're right, i probably don't need the R1 pullup, since an opto can never turn on 'by itself'. If the pic pins are inputs (hi-z), the opto's led will never conduct, and if a pic pin is an output, then R1 is useless.

Now, perhaps a pulldown resistor would be necessary if that was my intended default value, right?
MikeValencia



Joined: 04 Aug 2004
Posts: 238
Location: Chicago

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

PostPosted: Thu Aug 11, 2005 10:06 am     Reply with quote

Is there ever an event (except a programming error) that can turn both pins simultaneously into outputs? If so, then i can potentially fry the PIC pins effectively shorting 5V to Gnd? Perhaps a 220ohm current limiting resistor should be placed between the two pins.

But like i said, i'd be hand-soldering a jumper between the two pins on a previously manufactured board, and anything else would sooner require a new board spin (and tooling charges! Crying or Very sad ), not to mention a bunch of scrapped boards!
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Aug 11, 2005 10:57 am     Reply with quote

Quote:
while R1 just keeps it pulled up to prevent the opto from firing 'by itself'.


In this case you do not need R1.

Quote:
Is there ever an event (except a programming error) that can turn both pins simultaneously into outputs? If so, then i can potentially fry the PIC pins effectively shorting 5V to Gnd? Perhaps a 220ohm current limiting resistor should be placed between the two pins.


None I can think of and this configuration is actually not unusual. It is not much different than driving a bi directional data bus with a PIC IO port. Even if you configured both ports as an output with one driving low and the other driving high you are very unlikely to damage the PIC - they are pretty rugged beasts. Now connect a pin to -0.8 volts or more and thats another story :-)

[/code]
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
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