Pullups and pulldows


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    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...???

  2. #2
    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.

  3. #3
    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

  4. #4
    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.

  5. #5
    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.

  6. #6
    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

  7. #7
    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.

  8. #8
    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?

Members who have read this thread : 0

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