Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/10/10 20:53
Read: times


 
#179039 - External pull-up or '245 are much too limiting
Responding to: ???'s previous message
No, you are simplifying the problem.

An external pull-up means a pull-up you can't turn on/off on request. So you can't get the signal to tristate when needed.

It's a big disadvantage that the traditional 8051 only has passive pull-up on the GPIO signals. People have learned to work around that limitation, but the use of a passive pull-up on a digital output should be avoided whenever possible. With a big resistor you get low power consumption but very slow rise times depending on capacitive load. And a number of electronic circuits requires that you can source current. With a small resistor, you get a lot of extra power consumption whenever the signal needs to be held low since the output transistor has to fight with the pull-up.

Please don't every assume that it is always ok to draw a 3.3V input to 5V with some body diodes to protect you from damage. Some chips are specified to have 5V-tolerant signals. Some chips have been proven to be 5V-tolerant even if the datasheets doesn't say so. But that is not true for all chips.

Next thing - many 3.3V devices in push-pull mode are able to sink huge amounts of current if you try to force them higher than 3.3V + the voltage drop of the body diode. The body diodes may clamp at Vcc+0.3V and you will not manage to rise the voltage further until you feed enough current to blow the body diodes - while possibly blowing the input and/or output functionality at the same time.

You mention a 74CT245. I must assume that you really mean a 74HCT245, i.e. a chip that accepts TTL-level input signals while generating CMOS-level output signals. They can accept 3.3V signals from a 3.3V microcntroller and convert to 5V signals. But when you switch direction, you have to do so for all 8 signals. And it will then feed 5V to the 3.3V inputs of the microcontroller. And as I already noted - not all processors are fine with 5V. And even if the processor is fine with 5V when configuring a GPIO pin as input - what happens if the microcontroller forgets, and sets the GPIO pin as an output? The 245 is explicitly designed as a bus driver with great current drive capability. Do you really want to mate a very capable 245 with a microcontroller that is probably also very capable? The fight may be very vicious unless there are series resistors on the signals ;)

Of course, it is always good practice to have a series resistor when a digital signal is sent to a GPIO pin on a microcontroller, since a software bug may result in the two outputs fighting.

But remember that a '245 will only manage as input or as push-pull output. It doesn't have any support for passively driving a signal.

The world is full of "dumb" level-shifter solutions. But sometimes, that isn't enough.

Note that the original topic was a bus expander that:
- allows voltage level shifting from 3.3V processor to 5V.
- allows the signal to be configured to tristate (while being 5V tolerant)
- allows the signal to be configured to activelly drive high (5V logic)
- allows the signal to be configured to activelly drive low
- allows the signal to be configured to passively drive high (5V logic)
- preferably also allows the signal to be configured to passively drive low
- preferably also allows the signal to be used as an input

The Maxim chip manages to fulfill all but the passive pull-down alternative.

A bus expander as above has a lot of limitations compared to "real" GPIO. It can't toggle the signals as fast. It can't sample the inputs as fast. It can't handle interrupts and as quickly figure out originating pin. It can't be used for hw-generated PWM output. It can't be used for hw-driven counter input.

Sounds like a lot of limitations. But quite a lot of problems don't need huge speed, PWM output or counter/capture inputs. And if the original processor isn't totally stupid, a design can always use a more traditional level-shifter solution with a couple of native GPIO pins for such needs.

The thing is that a general-purpose port expansion chip like the Maxim chip can be used in a number of ways.
- It could be used on a remote port expansion, with just the SPI wires between the main unit and the expansion unit.
- It would be a very powerful device for building an IC identifier/tester as discussed in http://www.8052.com/forum/thread/178646 and could programatically be used for testing the chips at either 5V or 3.3V - or possibly even at lower logic levels.
- Even for more local use, it could expand the processor with extra signals - and not many processors has GPIO pins where the GPIO voltage can be programatically changed.
- An existing design that supplies GND, VCC and a SPI bus or four GPIO signals to a feature connector could be used to solve a lot of new problems at a later stage without need for replacing the original processor. Assuming, of course, that the processor has some spare flash and RAM.

I already have a number of designs that does have a feature connector with (at least) 3.3V, 5V, GND, Reset and 7 GPIO signals - with the GPIO signals normally intended as 2x RX, 2xTX, 2x EIRQ and the seventh GPIO intended to switch direction of an external transceiver for current loops or similar. Such a feature connector mated to that Maxim chip can best be described as a candy store ;)

List of 17 messages in thread
TopicAuthorDate
5V configurable bus expansions?            01/01/70 00:00      
   have a look            01/01/70 00:00      
   Like this ?            01/01/70 00:00      
   CPLD/FPGA            01/01/70 00:00      
      Maxim chip looking real nice            01/01/70 00:00      
         7301            01/01/70 00:00      
            But SPI as carrier is at least very easy to use            01/01/70 00:00      
               unfair comparison            01/01/70 00:00      
                  Not really true            01/01/70 00:00      
                     I2C            01/01/70 00:00      
                        Don't entirely agree            01/01/70 00:00      
                           picky            01/01/70 00:00      
                              Not even that!            01/01/70 00:00      
                     Agree            01/01/70 00:00      
                        Subject is changed.            01/01/70 00:00      
                           External pull-up or '245 are much too limiting            01/01/70 00:00      
                     Totally Agree            01/01/70 00:00      

Back to Subject List