Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Share output with LED and switch

Status
Not open for further replies.

hantto

Member
The plan is in attatchment 1.

This means that the voltage will not exceed about 1.8V on the pin (oh, it's a I/O on a PIC), is this still enought for a 'high' level when the supply is 5V.
 

Attachments

  • untitled_207.png
    untitled_207.png
    8.2 KB · Views: 621
I assume he has the weak pullups turned on and the pin set to input and that is why he would have 1.8V on the pin. (WPU's are equivalent to about 20K)

The 1.8V will be classed as low for a 5V supply. You could put another diode (or 2 to give 3.2V) in series with the LED and lower the (470R) resistor to get it to work.

Mike.
 
Pommie said:
I assume he has the weak pullups turned on and the pin set to input and that is why he would have 1.8V on the pin. (WPU's are equivalent to about 20K)

The 1.8V will be classed as low for a 5V supply. You could put another diode (or 2 to give 3.2V) in series with the LED and lower the (470R) resistor to get it to work.

Mike.

I didn't know the value of the WPUs, that's good to know.

Thanks for all of your answers.
 
hantto said:
Pommie said:
I assume he has the weak pullups turned on and the pin set to input and that is why he would have 1.8V on the pin. (WPU's are equivalent to about 20K)

The 1.8V will be classed as low for a 5V supply. You could put another diode (or 2 to give 3.2V) in series with the LED and lower the (470R) resistor to get it to work.

Mike.

I didn't know the value of the WPUs, that's good to know.

I thought they were a LOT higher than that, 300K-600K?, which is why they are called 'weak'.
 
Nigel Goodwin said:
I thought they were a LOT higher than that, 300K-600K?, which is why they are called 'weak'.

I can't find the document I came across it in but, in the DC characteristics table of most datasheets it lists the pull-up current as typically 250uA at 5V which is equivalent to 20K.

Mike.
 
250 uA is typical. however, the minimum is 50 uA and max is 400 uA. typical wide range for mos. So, a good design needs to take the range into account.

This depends on what voltage you are running your pic at and whether the pin has a TTL or CMOS input level. If TTL, it should work but most PICs have CMOS levels so read on. You can tell by finding "minimum Voltage input high" on the dtatsheet. If it's .8Vcc then it's a CMOS input. Running the PIC at 5V gives you a minimum high input level of 4V.

I don't think your diagram works but why don't you just try it, it's not going to smoke the pic or anything. I predict the voltage at the pin will be something like 2.7V with the switch open, 20K WPUs and pin in input mode. Too low. You've got the led/resistor pulling down a lot harder than the wpus are pulling up even when you are starting with 2V drop of the LED.

You will want to get the "floor" above 4V. You could do this in several ways. Add a couple of silicon diodes in series with the led (I'd try 3, 2 isn't enough). Or add a second led. 2 leds would put the switch open voltage at about 4.7V or so depending on the resistor drop. The switch should short the pin to ground (get rid of R7).

Phil
 
Thanks philba.

Not until now do I know that port A input min HIGH level is different to that of port B. At Vcc=5V, one is 4V while the other is 2.1V. :shock:
 
This discussion is interesting. I'm trying out the rfPIC12F675. I plan on having two pots and two buttons to do somecind of a RC-car remote control, just to familiarize myselft with rfPICs.

Here's a couple of pictures.
 

Attachments

  • rfpic_010.jpg
    rfpic_010.jpg
    181 KB · Views: 439
  • rfpic_009.jpg
    rfpic_009.jpg
    172.7 KB · Views: 427
  • rfpic_006.jpg
    rfpic_006.jpg
    117.7 KB · Views: 445
It looks like the GPIO pins are all TTL (2V) though most of the alternate functions use schmitt triggers (4V). at 5V Vdd, of course...

so your circuit should work after all.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top