Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Pin interface for PICs

Status
Not open for further replies.

izua

Member level 3
Member level 3
Joined
Oct 31, 2006
Messages
63
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,286
Activity points
1,880
I've posted this on the microchip forum too. Hoping to get more replies and ideas.
______________________________________________________
I'm making a new thread just for this. I'm starting a small project that will be a development board for 12f675 and compatible pics.
I'm trying to make an "interface" to each pin, which will allow me to view its state, if the pin is an output, or configure its state via a pushbutton, if its an input (i'd like it if the led will reflect the status of the pushbutton, too).

Here is the second version of what I made up till now. I need some further help, if you think that's possible.

**broken link removed**

considering the pin is an input, here's what i think it happens.

case 1 - the pin is low. there is no positive difference between the cathode and the anode of the led. it won't light up. the current stops at the pushbutton, since it's closed.
case 2 - the pin is high. the potential difference between the pin and ground makes the led light up. the resistor protects it from burning up.

now, there might be a problem, if the pushbutton is pressed.
in case 1 - low pin, i think a huge current will flow from V+ inside the pic, which is bad.
in case 2 - the pin is high, nothing will happen since there will be no potential difference (or only a very small one) between the pic pin and v+

now if the pin is an input
case 1 - the push button is open (normally open). the resistor (i think) it will act as a pulldown resistor and the pic will see gnd or gnd + 0.7 (because of the led. would it help if the led will be grounded, and in parallel with ground, too?). beeing nice with me, he will set the corresponding GPIO bit to low. any chance it will happen? led won't light up.
case 2 - the push button is closed (pin is connected to v+). current will rush into the pin (again, is it safe? or I'll have to add a resistor between v+ and the pushbutton, too?). it will split at the first junction, and it will rush into the led, through the resistor, and down to the ground. the led will light up.


I'd like to make this interface in such a way, that the button will be safe to press in any state. I was thinking of shorting the v+ and gnd through the led, when the pin's an output, and the electrons out of the pin, will find their way according to the flow. But i don't know if it's safe.
Why i want the button to be press-safe in any position? Trust me, I know my luck. Today, in the tram, the dudes asked for my pass, and they said it's not the right one. I ran away on the first stop, crossed the street on red light, and a cop gave me a ticket, for walking on the red light :| Walking! (laugh as much as you will, but do help me with this one :p)

i know it's more an electronics problem more than a pic one, but I need it adapted to the pic i'm using, and not sure how.

thanks
izua
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top