Pullups and pulldows


Closed Thread
Results 1 to 19 of 19
  1. #1
    xnihilo's Avatar
    xnihilo Guest

    Smile Pullups and pulldows

    Hi.

    Could somone tell me what should be the values for External weak pullups.
    I'm using 10K but I thing it is too much. I read somewere I should use 4.7K.
    So what value should I use to be safe?

    My second question:

    Do I need to use external pulldown resistors on pins that are default LOW.
    Let's say I want RA5 on PIC16F684 to be low by default oce I disable internalm wpu, should I use an external weak pull down resistor to tie it to ground? If yes, what value?

    My third question:
    Should use a RC networks (0.1 capa with an external resistor for weak pull ups or just a resistor?

    I've seen that in some circuit, the designer used a 47 UF capacitor on his 7.2V power supply for supplying a circuit with a PIC16F684. Why would he use this capacitor as the current is DC?? Is it needed to filter something or to prevent some voltage loss or something?

    Thanks for any replies !!!

  2. #2
    Join Date
    Feb 2005
    Location
    Essex, UK
    Posts
    94


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by xnihilo View Post
    Hi.

    Could somone tell me what should be the values for External weak pullups.
    I'm using 10K but I thing it is too much. I read somewere I should use 4.7K.
    So what value should I use to be safe?
    I have used both values without problems although I normally use 10k.

    Do I need to use external pulldown resistors on pins that are default LOW.
    Let's say I want RA5 on PIC16F684 to be low by default oce I disable internalm wpu, should I use an external weak pull down resistor to tie it to ground? If yes, what value?
    It really does depend on what the input to the PIC is coming from although, generally, it is best to use a pull-down resistor otherwise it mght be left 'floating'.

    Should use a RC networks (0.1 capa with an external resistor for weak pull ups or just a resistor?
    again, depends on what it is being connected to. Some times it is necessary to use a capacitor to reduce noise etc

    I've seen that in some circuit, the designer used a 47 UF capacitor on his 7.2V power supply for supplying a circuit with a PIC16F684. Why would he use this capacitor as the current is DC?? Is it needed to filter something or to prevent some voltage loss or something?
    I'm assuming the capacitor was placed across the power supply of a voltage regulator. This is common practice and helps "smooth" the voltage. If I'm using a 5V regulator, I normally have a 47uF or 100uF across the input to the regulator and 10uF on the output of the regulator. Normally, I have 100nF capacitors across both input and output of the regulator in addition to the 47/100uF and 10uF caps. Some may say that this is unneccessary with todays voltage regs. Have a look at the specific voltage regulator data sheet; it may suggest different values.

    Hope this helps

    Rob

  3. #3
    xnihilo's Avatar
    xnihilo Guest


    Did you find this post helpful? Yes | No

    Smile

    Quote Originally Posted by Rob View Post
    I have used both values without problems although I normally use 10k.



    It really does depend on what the input to the PIC is coming from although, generally, it is best to use a pull-down resistor otherwise it mght be left 'floating'.
    The signal is 5V output from another PIC16F684 (on the same power supply).

    again, depends on what it is being connected to. Some times it is necessary to use a capacitor to reduce noise etc



    I'm assuming the capacitor was placed across the power supply of a voltage regulator. This is common practice and helps "smooth" the voltage. If I'm using a 5V regulator, I normally have a 47uF or 100uF across the input to the regulator and 10uF on the output of the regulator. Normally, I have 100nF capacitors across both input and output of the regulator in addition to the 47/100uF and 10uF caps. Some may say that this is unneccessary with todays voltage regs. Have a look at the specific voltage regulator data sheet; it may suggest different values.
    It is between the anode and the cathode of the battery...

    Hope this helps

    Rob

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    If you use 10K you will have 0.0005 amps across the resistor.
    If you use 4.7K you will have 0.001 amps across the resistor.
    That is why 10K is normally used. It saves power if you have this condition several times.

    Power supplies:
    If you are running off of batteries a capacitor may not be necessary. If there is some thing in the circuit though that creates some noise then a 22uf or larger might be needed. It is difficult to figure before hand, you will find what works.

    The regulators used now days are pretty good, but there is still some noise getting through from the rectifier. So caps and some times inductors are needed. If you do not have a scope but a good multi-meter foe AC, read the voltage in AC and see what you have. For example , I some times use a power supply from a PC for a bench supply. The AC voltage on the 12 volt side will be 0.004 volts. When a 4700uF cap is placed across the positive and negative (0) rails the AC voltage drops to .000. Now it is good enough for a PIC.

    The larger the capacitor
    It is between the anode and the cathode of the battery...
    in this case will also help in brown out conditions.
    Dave
    Always wear safety glasses while programming.

  5. #5
    xnihilo's Avatar
    xnihilo Guest


    Did you find this post helpful? Yes | No

    Smile

    Quote Originally Posted by mackrackit View Post
    If you use 10K you will have 0.0005 amps across the resistor.
    If you use 4.7K you will have 0.001 amps across the resistor.
    That is why 10K is normally used. It saves power if you have this condition several times.

    Power supplies:
    If you are running off of batteries a capacitor may not be necessary. If there is some thing in the circuit though that creates some noise then a 22uf or larger might be needed. It is difficult to figure before hand, you will find what works.

    The regulators used now days are pretty good, but there is still some noise getting through from the rectifier. So caps and some times inductors are needed. If you do not have a scope but a good multi-meter foe AC, read the voltage in AC and see what you have. For example , I some times use a power supply from a PC for a bench supply. The AC voltage on the 12 volt side will be 0.004 volts. When a 4700uF cap is placed across the positive and negative (0) rails the AC voltage drops to .000. Now it is good enough for a PIC.

    The larger the capacitor in this case will also help in brown out conditions.
    What is a brown out? A decrease in the supply? I don't use BOD in my config byte.

    What would make noise in my circuit?? voltage regulator? LCD display?

    Okay for 10K. I will use them as pullups and pulldown. In my circuit I have strange behaviors on a portA.5 pin set as input (internal WPU disabled), default low and with no external Weak pulldown. When I touch any pin (no matter which one), there is an INT trigger as if +5V was getting to this specific pin (this pin is int enabled when getting from LOW to HIGH). I guess I should use a weak pull down...???

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by xnihilo View Post
    What is a brown out? A decrease in the supply? I don't use BOD in my config byte.
    Even if you do not configure BOD the PIC will only operate within a certain voltage range for the OSC speed it is running at. So if something causes a voltage draw for a short period of time that the regulator can not handle the large capacitor will help. (maybe a LCD back light coming on )
    What would make noise in my circuit?? voltage regulator? LCD display?
    A switch used as an input that changes position rapidly, or an output to a high speed relay, etc...
    Okay for 10K. I will use them as pullups and pulldown. In my circuit I have strange behaviors on a portA.5 pin set as input (internal WPU disabled), default low and with no external Weak pulldown. When I touch any pin (no matter which one), there is an INT trigger as if +5V was getting to this specific pin (this pin is int enabled when getting from LOW to HIGH). I guess I should use a weak pull down...???
    Personally I never have like the internal pull-ups, I always use an external pull up/down. And never let a pin float, always have control.
    Dave
    Always wear safety glasses while programming.

  7. #7
    xnihilo's Avatar
    xnihilo Guest


    Did you find this post helpful? Yes | No

    Smile

    Quote Originally Posted by mackrackit View Post
    Even if you do not configure BOD the PIC will only operate within a certain voltage range for the OSC speed it is running at. So if something causes a voltage draw for a short period of time that the regulator can not handle the large capacitor will help. (maybe a LCD back light coming on )

    A switch used as an input that changes position rapidly, or an output to a high speed relay, etc...

    Personally I never have like the internal pull-ups, I always use an external pull up/down. And never let a pin float, always have control.
    Thank you very much for the information.
    I need internal wpu because for my project i need to enable and disable them on the fly in software. Is there another easy alternative?

    a

  8. #8
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I need internal wpu because for my project i need to enable and disable them on the fly in software. Is there another easy alternative?
    Can you tell us a little about your project? At this point I would just be guessing more than usual.
    Dave
    Always wear safety glasses while programming.

  9. #9
    xnihilo's Avatar
    xnihilo Guest


    Did you find this post helpful? Yes | No

    Smile

    Quote Originally Posted by mackrackit View Post
    Can you tell us a little about your project? At this point I would just be guessing more than usual.
    Quote Originally Posted by mackrackit View Post
    Can you tell us a little about your project? At this point I would just be guessing more than usual.
    Sure, it is a lasergame system. the mag module performs a handshaking with the gun module. i.e. gun asks the mag if there are still ammo in the mag. if there are, the gun receives a signal and the ammo is used.

    there are 2 pics 16f684 communicating. the mag ra5 is set as input and used at default low state (porta.5=0, wpu disabled).
    when the gun sends a +5v to mag's ra5 for 1ms, mag then sets ra5 as output and it sends +5v out via ra5 to the gun as a reply then ra5 is set again as input at logic low. this ra5 pin is used as input/output for handshaking. TRISA is used to chang pin direction as needed.
    so my trouble is, if i use an external 10k weak pulldown to avoid leaving it floating (and triggering a fake int on ra5 if there is some noise) i won't be able to disable the pull down in software when i'll be using the pin as output. do you see?
    Last edited by xnihilo; - 1st April 2008 at 15:56.

  10. #10
    Join Date
    Feb 2005
    Location
    Essex, UK
    Posts
    94


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by xnihilo View Post
    Sure, it is a lasergame system. the mag module performs a handshaking with the gun module. i.e. gun asks the mag if there are still ammo in the mag. if there are, the gun receives a signal and the ammo is used.

    there are 2 pics 16f684 communicating. the mag ra5 is set as input and used at default low state (porta.5=0, wpu disabled).
    when the gun sends a +5v to mag's ra5 for 1ms, mag then sets ra5 as output and it sends +5v out via ra5 to the gun as a reply then ra5 is set again as input at logic low. this ra5 pin is used as input/output for handshaking. TRISA is used to chang pin direction as needed.
    so my trouble is, if i use an external 10k weak pulldown to avoid leaving it floating (and triggering a fake int on ra5 if there is some noise) i won't be able to disable the pull down in software when i'll be using the pin as output. do you see?
    There should be no problem with using a 10k pull-down resistor. So the gun pin (the one that's connected to RA5 of the mag) goes to an input immediately after sending a 1ms high signal? This pull-down resistor would therefore stop the gun input pin floating as well.

    Please correct me if I've mis-interpreted you

    Cheers

    Rob

  11. #11
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I agree with Rob.
    You can have an external pull up or down and still do what you want.
    Think of it like this.

    If you had a switch connected to a pin (input) that is set to receive a high signal when the switch is closed you would have a pull down resistor to hold the pin low so not to give a false reading.

    If you had a mosfet or relay connected to a pin (output) that is set to go high to activate the mosfet or relay you would have a pull down resistor to hold the pin low so not to have the mosfet or relay coming on when is is not supposed to.

    The thing I will suggest in your case is a 100K pull down might be better. It should increase the sensitivity.
    Dave
    Always wear safety glasses while programming.

  12. #12
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Problem when switching internal-pull up could be some false interrupts events. Your software MUST compensate for it. But i see no advantage to do so.... too bad... i can't take beer 'till few months ... in some occasion, it's an eye opener
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  13. #13
    xnihilo's Avatar
    xnihilo Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Rob View Post
    There should be no problem with using a 10k pull-down resistor. So the gun pin (the one that's connected to RA5 of the mag) goes to an input immediately after sending a 1ms high signal? This pull-down resistor would therefore stop the gun input pin floating as well.

    Please correct me if I've mis-interpreted you

    Cheers

    Rob
    In fact RA5 of the PIC used in the gun is connected to RA5 of the pic used in the mag.
    Pins used for this handhasking, both in the gun and in the mag are used both as input and output in a specific sequence.

    GUN (with weak PD) MAG (with 10K external weak pull down)

    RA5 RA5

    OUTPUT, LOW INPUT, LOW
    Set high for 1ms Portachange interrupt is triggered, goto int handler
    1ms delay RA5 becomes an output pin
    RA5 becomes input RA5 starts outputing 5V ONLY if an ammo is available in the mag
    start polling RA5 2ms delay
    RA5 reverts to output RA5 reverts to input
    Here the gun either received a 5V pulse on RA5 (got an ammo from the mag) or no pulse was received, which means mag is empty
    The respective programs continue...

    That's how I implemented my handshaking between the pics. I would have used separate pins one for input, one for output for each pic but I don't have enough free pins, anyway, such usage of the pic should be okay anyway

    What will happen when the 5V output is sent. As there is a 10K weak pullup connecting the pin to the ground... I guess some current will sink to the ground but most of it will reach the target pic, right?

  14. #14
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    too bad... i can't take beer 'till few months ... in some occasion, it's an eye opener
    HUH? No beer? Whats up?
    Dave
    Always wear safety glasses while programming.

  15. #15
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Long story PM or e-mail....
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  16. #16
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    What will happen when the 5V output is sent. As there is a 10K weak pullup connecting the pin to the ground... I guess some current will sink to the ground but most of it will reach the target pic, right?
    Yep, that is why I think a 100K might be better in you situation.
    I think
    Dave
    Always wear safety glasses while programming.

  17. #17
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    I'm kinda lost in here... sorry And there's some danger also.. unless you also use a current limiting resistor between your PIC and the mag.... hence why i asked for a schematic awhile back... and weak pull-up can't be tied to GND... unless it would be pull-down.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  18. #18
    xnihilo's Avatar
    xnihilo Guest


    Did you find this post helpful? Yes | No

    Smile

    I will make a schematic/diagram with the stuff by draw it by hand will be a mess. I will try to understand how to use EAGLE pcb designer so I make some decent diagram.

    In the meantime, as I said, the two pics have to communicate using each one porta pin.

    The communications is:
    Gun-PIC send +5V to Mag-PIC who then turns its pin as output and sends back a +5v to the Gun-PIC.

    I'll make my schematics and system description and source available on my website by the end of the week.

    Anyway THANKS a lot for your help guys.

  19. #19
    xnihilo's Avatar
    xnihilo Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    I'm kinda lost in here... sorry And there's some danger also.. unless you also use a current limiting resistor between your PIC and the mag.... hence why i asked for a schematic awhile back... and weak pull-up can't be tied to GND... unless it would be pull-down.
    Sure, pull-down because I use the pin in low state so to avoid the pin to be left floating I tie it to GND, I read it is a good practice.

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts