Shop OBEX P1 Docs P2 Docs Learn Events
Just a ramdom idea, MAX7219, PROP outputs — Parallax Forums

Just a ramdom idea, MAX7219, PROP outputs

TCTC Posts: 1,019
edited 2013-12-04 17:01 in Propeller 1
Hello all,

I am working on hooking a MAX7219 to a prop. Looking at the data sheet a min logic high for the MAX is 3.5V. I came up with an idea, it could be a bad idea, but it also could be a good one. Tell me what you think, and your opinions about it. I know the MAX input pins would always be high when the prop is not driving the pins low.
12-3-2013 8-22-09 PM.jpg


Thanks
TC
580 x 571 - 46K

Comments

  • jmgjmg Posts: 15,173
    edited 2013-12-03 17:55
    TC wrote: »
    Hello all,

    I am working on hooking a MAX7219 to a prop. Looking at the data sheet a min logic high for the MAX is 3.5V. I came up with an idea, it could be a bad idea, but it also could be a good one. Tell me what you think, and your opinions about it. I know the MAX input pins would always be high when the prop is not driving the pins low.

    That relies on the substrate diodes in the Prop, and open drain mode ?
    That's 'sort of ok', but needs some care.
    * The Prop + regulator, needs to present a load exceeding the total pullup, otherwise you can drift up the Prop Vcc, and that is risky.
    * The rise times are slower, and some slave devices do not like slow clock edges.

    An alternative is a series power diode (slow, hi C) , and a higher pullup, with CMOS drive mode.
  • roglohrogloh Posts: 5,808
    edited 2013-12-03 17:56
    I'm thinking so long as you are not driving this at very high frequencies, keeping it to say less than 1MHz clock speeds your approach "could" work out ok. It mainly depends on rise time as you probably have to let the prop output pins float to achieve the logic high at the right voltage, and pull low to achieve the logic low.

    You could find if you were to just drive these signals high directly from the prop side you might only see 3.3V (or whatever voltage level you are running the prop at), not necessarily the 3.5V minimum you want for reading a logic high on the MAX7219. The 10k pull ups won't bring the high voltage level up rapidly (depending on capacitance) for really high speed operation > 1MHz but it might be fast enough. You can drop the resistors down a little bit further to speed it up but ideally no lower than around 2.2k (higher is safer) otherwise you risk over stressing the protection diodes in the prop. There are other threads that discuss the suitable resistances to safely interface to 5V. The rise time for clock inputs might be an issue if the MAX has any tight timing requirements there.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-12-03 20:38
    rogloh wrote: »
    You can drop the resistors down a little bit further to speed it up but ideally no lower than around 2.2k (higher is safer) otherwise you risk over stressing the protection diodes in the prop.

    Technically 2.2K isn't really within specs. The current through the clamping diodes is not supposed to exceed 500uA. 2.4K is the lowest resistor value that will meet this limit.

    The clamping diodes will pull the 5V line down to 3.8V. This is still higher than the desired 3.5V so it might work in this application. I erroneously thought a line pulled to 5V would have 5V on it. I was only recently set straight by Phil in a 5V/3.3V I2C discussion.

    I just now measured the voltage to make sure and sure enough Phil was right, the Prop input pin pulled to 5V read 3.8V on my voltmeter.

    Have you tried the MAX7219 with 3.3V logic? I bet it would work (as long as the amount wagered is small).
  • TCTC Posts: 1,019
    edited 2013-12-04 03:33
    OK, I am a little lost. There is so much I need to learn(or remember after accident) How do you guys come up with your calculations, just so I know?
    Duane Degn wrote: »

    Have you tried the MAX7219 with 3.3V logic? I bet it would work (as long as the amount wagered is small).

    No, I haven't yet. But I plan on trying it just to see what happens. I just had the idea while I was going through the data sheet, and I didn't know what would happen. Ive already lost to many pins on the prop to my experimentation. That is why I am making a breakout board for TI's TXS0108E it will allow me to interface to 5V parts easily, and if I screw up, im not out much money.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-12-04 05:36
    TC wrote: »
    How do you guys come up with your calculations, just so I know?

    On page 25 the datasheet "Max. DC current into an input pin with internal protection diode forward biased +/-500uA."

    Since I measured the forward biased voltage of 3.8V at the pin with 5V on it (through a 10K resistor) I figured the voltage drop across the resistor should be 1.2V. I used this 1.2V to calculate the resistor value.

    1.2V / 0.0005A = 2,400 ohm (using Ohm's law)

    I'm not positive I did this correctly since 2.4K ohm still seems on the low side for a current limiting resistor. I generally use 10K or 4.7K resistors on inputs from 5V devices.
  • TCTC Posts: 1,019
    edited 2013-12-04 05:42
    Duane Degn wrote: »
    On page 25 the datasheet "Max. DC current into an input pin with internal protection diode forward biased +/-500uA."

    I think im going to have to take a better look at the PROP's data sheet. Thanks for the info.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-12-04 05:49
    TC wrote: »
    I think im going to have to take a better look at the PROP's data sheet. Thanks for the info.

    You're welcome. I wouldn't have understood what it really meant without having read an explanation on the forum.
  • TCTC Posts: 1,019
    edited 2013-12-04 05:51
    It would be nice if data sheets were a little easier to understand.
  • Mark_TMark_T Posts: 1,981
    edited 2013-12-04 06:04
    Another way to cope with level shifting a small amount is to use a forward biased diode to add a
    diode drop.

    Prop pin ---- |<|
    X--- 3k3---- +5V

    And point X to the MAX7219 input.

    The 0.6V drop across the diode adds to the Prop's output so logic levels seen at the MAX7219 are about
    0.6V (low) and 3.9V (high), with 3k3 resistor the pull-up current is < 0.5mA, and about 220uA worst
    case through the Prop's protection diode.

    A point to note is that the worst case for the protection diode is when the Prop pin is an input (at reset),
    since then the output transistors are off and the protection diode has to take the pull-up current. When
    the pin is configured as an output the output transistors are going to win against the pull up resistor
    strongly (Prop pin output resistance is about 40 ohms I think, so with output HIGH at 3.3v into a 3k3 pullup
    to 5V you have a 40ohm/3300 resitive divider, output voltage is only 3.32V, the protection diode isn't
    conducting at all at 0.02V. That's why adding an external diode is useful, the difference between 3.3
    and 3.32 isn't significant.

    Of course you can drive the pin open-drain, but then the protection diode has to do work, which I
    personally think of as "just wrong"!
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-12-04 06:19
    I wanted to add if you decide to use a level shifter JonnyMac recommended the TC4427 in this post.

    While I use 10K ohms on Prop pins with 5V on input pins, you don't want to add large resistors to Propeller output pins when communicating with 5V devices. I've had several 5V devices not work when I used 4.7K resistors on the Prop's output pins.
  • PublisonPublison Posts: 12,366
    edited 2013-12-04 06:26
    I did three projects driving the MAX7219 directly from the Prop, (Prop Proto Board). No pullups.

    Still running 3 years later.
  • TCTC Posts: 1,019
    edited 2013-12-04 06:57
    Mark_T wrote: »
    Another way to cope with level shifting a small amount is to use a forward biased diode to add a
    diode drop.

    That sounds like an interesting idea. Would that protect the output pins better then just having a resistor pulled to 5V?
    Duane Degn wrote: »
    I wanted to add if you decide to use a level shifter JonnyMac recommended the TC4427 in this post.

    The TSX0108E is a bi-directional level translator that automatically changes its direction. and it will go down to 1.2V on IO-A side. That should be good for the PROP2 when it comes out.
    Publison wrote: »
    I did three projects driving the MAX7219 directly from the Prop, (Prop Proto Board). No pullups.

    Still running 3 years later.

    Did you use any pulldown resistors? or did you just let it fend for its self?
  • PublisonPublison Posts: 12,366
    edited 2013-12-04 07:13
    TC wrote: »
    Did you use any pulldown resistors? or did you just let it fend for its self?

    Just direct connection. No resistors or translators. It just worked. :)

    Give it a shot.
  • TCTC Posts: 1,019
    edited 2013-12-04 08:06
    Publison wrote: »
    Just direct connection. No resistors or translators. It just worked. :)

    Give it a shot.

    I will, Thank you
  • Mark_TMark_T Posts: 1,981
    edited 2013-12-04 15:27
    TC wrote: »
    That sounds like an interesting idea. Would that protect the output pins better then just having a resistor pulled to 5V?

    The point is that a pull-up to 5V doesn't really level shift at all unless you use open-drain output, and
    with open-drain the protection diode gets to carry the pullup current. With the diode
    and using push-pull output the protection diodes don't carry the current (except just
    after reset) and the output voltage is definitely level shifted enough for a comfortable
    noise margin. The diode drop also helps reduce the pull-up current during the reset
    time (or conversely allows a stronger pull-up resistor).
  • TCTC Posts: 1,019
    edited 2013-12-04 17:01
    Oh, now I get it. Thank you
Sign In or Register to comment.