Shop OBEX P1 Docs P2 Docs Learn Events
pull-up resistor mode? — Parallax Forums

pull-up resistor mode?

BebopALotBebopALot Posts: 79
edited 2006-02-04 22:22 in General Discussion
My SX is producing a 40KHz sqaure qave signal only when I drop a 1k resistor at the output pin to ground and measure the voltage accross it.

Here is my question: would using the mode pull-up setting eliminate the need for an external pullup like this?

Comments

  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2006-02-04 00:44
    BebopALot,

    if you could post your program code, and a drawing of your hookup, this would dramatically increase your chance getting valuable hints from other forum members.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-02-04 15:17
    The choice of using exteranl vs internal pullups is a question of speed, the internal pullups are weak (~20k&#937[noparse];)[/noparse], this is ok for low speed applications but not high speed, for 40kHz the internal pullup should be fine depending on what you are hooking it up to, BTW connecting a resistor from the ground to the pin is a pulldown not pullup.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • BebopALotBebopALot Posts: 79
    edited 2006-02-04 18:30
    Thank you for all of your help. You guys are the best.

    BBAL
  • ElectronegativityElectronegativity Posts: 311
    edited 2006-02-04 19:25
    Hi all, Paul said the internal (20kOhm) resistor is ok for low speed but not for high.

    There is clearly a hole in my knowledge here.

    Why is that true, and do you need less or more resistance in the pulldown for faster speeds?

    scool.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I wonder if this wire is hot...
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2006-02-04 21:44
    To explain this, simply think of an SX I/O pin configured as an input with a pull-up resistor connected to it and the other end connected to positive supply (Vdd), and a normally open pushbutton connected to that pin, with the other end connected to the negative supply (Vss).

    When an I/O pin is configured, it has a high impedance, or high input resistance. Nevertheless, the input also acts as a small capacitor. When you connect the input pin to Vdd, this capacitor is charged. When you then connect the input to Vss, the capacitor is discharged.

    When you apply power to the SX, the input capacitor is charged through the pull-up resistor. When you then press the pushbutton, the capacitor is discharged through the closed pushbutton. When you release the pushbutton, the capacitor is charged again through the pull-up resistor. The time-constant for charging is experessed by R * C, where R is the value of the pull-up resistor, and C the input capacity. As you can see, when you increase R, the time-constant also increases, i.e. it take more time to charge the capacitor when R is increased (the same is true for C, but you can't change its value, unless you would attach an additional parallel capacitor).

    The faster the signal speeds are that control the input, the more is it important that the input capacitor is charged and discharged fast enough in order to maintain steep signal edges. This is why you should select lower values for the pull-up resistor in such cases 10 kOhm, down to 1 kOhm are values that are fine in most cases.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
  • ElectronegativityElectronegativity Posts: 311
    edited 2006-02-04 22:22
    Thanks, I wasn't thinking about the pin having a capacitance.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I wonder if this wire is hot...
Sign In or Register to comment.