Pull-up Resistors

If I have a pull up on one of my non-open drain pins on my ARM, is it ok to set the pin to output and drive to ‘1’?

Thanks,

Vern

Depends on how big your pull-up resistor is, and what voltage it’s pulling up to, but generally, yes. (Why would you have a pull-up on a non-open drain pin?)

spacewrench:
Depends on how big your pull-up resistor is, and what voltage it’s pulling up to, but generally, yes. (Why would you have a pull-up on a non-open drain pin?)

I multiplexed P0.17 on an LPC2103. In one mode it is part of an I/O bus into a CPLD. Its also hooked to TDO of the CPLDs JTAG, so in another mode the MCU can reprogram the CPLD. Normally TDO is high impedance so multiplexing it isnt an issue. But like an idiot I didnt notice that P0.17 for some reason is open drain, the manual says its because it supports I2C standards, but the pin doesnt have any I2C support.

Anyway, once I realized the open drain issue, I figured I would just throw a pull up on it and be OK. That was until I programmed the CPLD a couple times and burned out the JTAG.

I was using a 10K pull up, I figured it wouldnt be a problem, but I was wrong.

So I didnt quite describe my problem correctly above, but it still serves since TDO is an output when the CPLD is being programmed, and it would be pulled up and driving the line at the same time.

Vern

This is how I see it, please correct me if i’m wrong:

Situation 1:

  • CPLD in normal state (TDO = high impedance)

In this case it doesn’t matter what happens on pin 0.17 (input / output / open drain for I2C)

Situation 2:

  • CPLD being programmed (TDO is active 0 or 1)

-P0.17 configured as input

This situation is what you want when reprogramming CPLD, no pull-up required.

Situation 3:

  • CPLD being programmed (TDO is active 0 or 1)

  • P0.17 configured as output (active 0 or 1)

This is definately NOT what you want, since something will be cooked in case CPLD TDO = 0 and P0.17 = 1 or vice versa. A pull up will not help in this case. A current limiting resistor in series would be required to protect the pins.

Situation 4:

  • CPLD being programmed (TDO is active 0 or 1)

  • P0.17 configured for I2C, active 0, open drain for 1

  • Pull-up on to handle high level

Something will be cooked in case TDO is active 1 and P0.17 active low, unless a current limiting resistor is put in series. In case TDO is active 0 and P0.17 active zero: no problem. In case TDO is active 1 and P0.17 pulled high: normally no problem.

My conclusion:

  • If P0.17 is used for general I/O, no pull-up is required

  • If P0.17 is used for I2C, a pull up is required. The pull up itself will not cause anyting to fry.

  • In case P0.17 is NOT configured as input during programming of the CPLD, a current limiting resistor should be placed in series to protect the devices. (Don’t know if it would still work)

Unfortunately with the LPC ARMs, when an I/O is open drain, its open drain for all output modes of the pin. I am not using I2C, but it doesnt matter. There are a couple things like this on the LPC ARMs that I wish they were more like the others (PICs and AVRs). But they are super fast and very cheap, the others cant touch them.

So, I have two situations only.

The first is P0.17 is a bidirectional port. A pull up is required for the port to output correctly. TDO of the CPLD is high impedance, it is not being programmed.

The second is pin P0.17 as an input. Pull up is required because of the first situation. TDO is an output, CPLD being programmed. This situation will cook the TDO port because of the pull up. The CPLD will function normally, you just cant reprogram it.

I have fixed the problem with a new board version that moves TDO to a normal I/O port. My stubbornness, thinking I could find a work around, cost me four CPLDs. A new board from the start would have been cheaper.

Vern

Delicon:
Unfortunately with the LPC ARMs, when an I/O is open drain, its open drain for all output modes of the pin.

Ouch, I guess I didn’t understand the manual correctly… I almost send my boardlayout for PCB manufacturing… Good that this came up in time.

fox_nl:
Ouch, I guess I didn’t understand the manual correctly… I almost send my boardlayout for PCB manufacturing… Good that this came up in time.

Make sure you check the pin configuration section carefully. Some pins have footnotes that say they are open drain and some say it in the description. I made the mistake of just looking for the footnotes.

Vern