Shop OBEX P1 Docs P2 Docs Learn Events
Stingray Hardware Trap? — Parallax Forums

Stingray Hardware Trap?

SRLMSRLM Posts: 5,045
edited 2011-12-20 08:35 in Robotics
I have noticed something with the Stingray hardware today. I tried using a button (the schematic is from the PE labs page 33) on the breadboard, but using 5V since that is what the logic chips are at. I built the button into my program, but noticed some problems. I have had the button (working) on there a day or so before it started acting up without changing the hardware or that portion of the software, so I wrote the following code:



PUB Main | i, t1, t2, t3, lines

  com.start(31, 30, 0, 57600)
  waitcnt(clkfreq*2 + cnt)

  dira<FONT&NBSP;STYLE="FONT-SIZE:10PT;"> := 0 
  
  t3 := 0
  t1 := t2 := ina<FONT&NBSP;STYLE="FONT-SIZE:10PT;">
  repeat
    t1 := ina<FONT&NBSP;STYLE="FONT-SIZE:10PT;">
    com.dec(t1)
    if t1 <> t2
      com.str(string("new value!"))
      com.dec(++t3)
      com.tx(13)
    t2 := t1 




A first I thought my problem was a faulty button, so I took that part out. My circuit is as shown:





5V          GND
|            |
|            \
|            /   10 Kohm
|            \
|            /
|            \
|            |
|            |
0            0

      +
      |
      |
      |
     IO Pin 




The wire is one of the included blue wires that I moved on the breadboard between the two terminals. I figured that there would be a period of time where the input was unstable, but that it wouldn't matter in the long run.

I ran the code, and much to my surprise I can move the wire between either terminal and both read 1! I hooked up my multimeter to the terminal side of the resistor, and the ground of the multimeter to ground. I then moved the wire, and it worked correctly. My next step was to replace the 10Kohm resistor with a 1Kohm resistor, and the circuit worked fine either with or without the multimeter in the loop.

So, my conclusion is that the level shifters used don't work with high resistance values. In my mind this is a bug, since the PE documentation clearly expects 10Kohms to work just fine.


I have uploaded the full code, but pretty much the only difference in practice with the code above is the addition of clock settings and the OBJ declaration for FDX.

Edited title from "Stingray Hardware Bug?" to "Stingray Hardware Trap?" per the request of Chris.

Post Edited (SRLM) : 11/18/2009 4:26:55 PM GMT


Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-11-18 15:59
    SRLM,

    I'm going to step up on my soap box for this one because your subject is one of those ones that makes me cringe a little. It is irresposible to call something a bug in either hardware or software without fully understanding the nature of what you're referring to. Now others reading this may associate poor design with the Stingray even once it has been cleared as a misunderstanding. While some of your code was trashed by the editor, it really is irrelevant since the issue is in the way you're interfacing to the level shifters. From the datasheet:
    Datasheet said...
    The TXB0108 is designed to drive capacitive loads of up to 70 pF. The output drivers of the TXB0108 have low
    dc drive strength. If pullup or pulldown resistors are connected externally to the data I/Os, their values must be
    kept higher than 50 kW to ensure that they do not contend with the output drivers of the TXB0108.
    For the same reason, the TXB0108 should not be used in applications such as I2C or 1-Wire where an
    open-drain driver is connected on the bidirectional data I/O. For these applications, use a device from the TI
    TXS01xx series of level translators.
    The resources to disable the level shifters and use the I/O lines directly was provided and I would recommend in an application like this using the lines directly.· That is, I recommend disabling the translators and connecting switches and other devices which don't require the level shifting to be connected directly to the Propeller I/O pins.· Perhaps we did not make this easy enough in our design and it is something I will look at in greater detail in the near future.· Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Engineering
    50 72 6F 6A 65 63 74 20 53 69 74 65


    Post Edited (Chris Savage (Parallax)) : 11/18/2009 4:06:28 PM GMT
  • SRLMSRLM Posts: 5,045
    edited 2009-11-18 16:23
    Fair enough. I'll try it out later today, but from the datasheet snippet that you posted it appears that I need at least 50 kohms?
  • zappmanzappman Posts: 418
    edited 2011-12-20 06:45
    SRLM,

    I'm going to step up on my soap box for this one because your subject is one of those ones that makes me cringe a little. It is irresposible to call something a bug in either hardware or software without fully understanding the nature of what you're referring to. Now others reading this may associate poor design with the Stingray even once it has been cleared as a misunderstanding. While some of your code was trashed by the editor, it really is irrelevant since the issue is in the way you're interfacing to the level shifters. From the datasheet:
    Datasheet said...
    The TXB0108 is designed to drive capacitive loads of up to 70 pF. The output drivers of the TXB0108 have low
    dc drive strength. If pullup or pulldown resistors are connected externally to the data I/Os, their values must be
    kept higher than 50 kW to ensure that they do not contend with the output drivers of the TXB0108.
    For the same reason, the TXB0108 should not be used in applications such as I2C or 1-Wire where an
    open-drain driver is connected on the bidirectional data I/O. For these applications, use a device from the TI
    TXS01xx series of level translators.




    The resources to disable the level shifters and use the I/O lines directly was provided and I would recommend in an application like this using the lines directly.· That is, I recommend disabling the translators and connecting switches and other devices which don't require the level shifting to be connected directly to the Propeller I/O pins.· Perhaps we did not make this easy enough in our design and it is something I will look at in greater detail in the near future.· Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Engineering
    50 72 6F 6A 65 63 74 20 53 69 74 65


    Post Edited (Chris Savage (Parallax)) : 11/18/2009 4:06:28 PM GMT

    The Propeller Servo Controller USB uses the same TXB0108 8-Bit Bidirectional Voltage-Level Translator chips as the MSR1 board. The same output loading precautions should be taken.
  • ratronicratronic Posts: 1,451
    edited 2011-12-20 08:35
    SRLM I have found that a 3.3k resistor to either voltage rail on the input is enough to swing it. See the the attached excerpts from the data sheet.

    Edit: sorry changed resistor value
    1024 x 272 - 29K
    1024 x 591 - 33K
Sign In or Register to comment.