0
\$\begingroup\$

I'm working on a board with a MAX3221. I chose this device because you can disable the DOUT-RS232 output and the RIN-RS232 input which is very important, and critical, for my application.

In order to achieve this, the MAX3221 /FORCEOFF input shall be LOW to disable the DOUT-RS232 output and /EN input shall be HIGH to disable the RIN-RS232 input. I know that the microcontroller I'll use to drive the MAX3221 has pull-up and pull-down resistors on the outputs but:

  1. The GPIO pins are configured as INPUTs on reset (floating).
  2. The Pull-up or Pull-down is not enabled on reset.
  3. I have to configure the pull-up and pull-down I need in software and that doesn't happen instantaneously on boot.

Therefore, I need a hardware solution using external pull-up and pull-down resistors directly on the MAX3221 pins since I need the DOUT-RS232 output and RIN-RS232 input disabled the moment I power up the board.

I have no issues with the pull-up resistor and there is plenty of information about that, but I'm struggling to know how to calculate an appropriate pull-down for the /FORCEOFF input. There are quite a few answers on this exchange but all of them explain where and why to use pull-downs but not how to calculate them.

As a starting point, I know that any reasonably value resistor I put in the input will pull down the pin. The problem I have is what value is the best for when I need to send a "1" to the pin.

Given the three initial conditions on the input pins stated above, I decided to configure the output pins as push-pull which by the way is the default configuration for an output pin. So I have the following circuit for sending a "1" to the /FORCEOFF pin:

enter image description here

I'm trying to calculate the resistor so I only draw 5ma from the pin while maintaining 3v to ensure the MAX3221 sees a "1" in the input pin. The MAX3221 datasheet doesn't contain any input current value for /FORCEOFF and only mentions an input leakage current of 0.05ua TYP to 1ua max so I assume it is negligible for the calculation.

It seems pretty straightforward, but I'm not sure if I'm doing this right.

\$\endgroup\$
1
  • \$\begingroup\$ If the supply is a limited source (e.g. a coin-cell battery) then 5mA will be too high. Anyways, you can put anything even in hundreds of kiloOhms since /FORCEOFF pin should not be left floating. \$\endgroup\$ Commented Feb 23, 2021 at 4:21

2 Answers 2

3
\$\begingroup\$

5mA is quite a bit of current to "waste" for a pull-down. You should calculate how quickly you need to pull it down, estimate the capacitance and calculate that as one limit. Then look at the leakage (as you have) worst-case, and make sure there is adequate noise margin below Vil under worst-case conditions.

Leakage is 1uA maximum over the full temperature range (very important that it is over the full range) and Vil is maximum 0.8V. If we allow 400mV of noise margin, then the resistor should be no higher than 0.4V/1uA = 400K.

If we assume a 1us glitch is acceptable and we assume input, output and stray capacitance adds up to, say, 10pF then the resistor should be lower than about 100K.

Finally, we'd probably like a bit lower impedance than that for reasons of noise immunity and possible PCB contamination, so maybe we pick 10K or 20K. But if there's a ground plane under it and the PCB is in benign conditions 50 or 100K is also valid.

If you don't care about efficiency, elegance etc. your lower limit on the resistance is set by how much the push-pull output is guaranteed to be able to drive (over temperature) and still yield acceptable noise margin (relative to Vih of the MAX chip).

\$\endgroup\$
2
  • \$\begingroup\$ Thank you very much for the valuable information. I have some questions though. How do I estimate the capacitance and what role does it play in calculating the resistance? I need to pull down the pin as fast as possible, but I don't know what would be a realistic "fast as possible" speed. How do I determine that? And yes, there will be a GND plane underneath not farther than 5mil. \$\endgroup\$
    – m4l490n
    Commented Feb 23, 2021 at 12:52
  • 1
    \$\begingroup\$ I picked 1us as a reasonable number (1/4 of the minimum bit time for that chip). If you want things to happen much faster than that you might have to add external circuitry because the MAX chip is not guaranteed to start up instantly and glitch-free from applied power. I don't see much need to go lower than 10-20K. Capacitance- a few pF for input, output and stray (assuming a short trace). \$\endgroup\$ Commented Feb 23, 2021 at 13:10
2
\$\begingroup\$

The problem I have is what value is the best for when I need to send a "1" to the pin.

The best value when driving a logic HI is infinite Ohms so the GPIO has to supply zero. But then it can't pull down so you need to compromise. Go 1mA or even lower. 5mA is a lot. Enough to light an LED and more than your GPIO would prefer dealing with and very near, if not exceeding the limit of the GPIO of a more modern MCU.

The more current your GPIO needs to source, the hotter it gets and the more the voltage sags when trying to drive a logic HI.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.