Shop OBEX P1 Docs P2 Docs Learn Events
MCP3204/3208 Dout loading — Parallax Forums

MCP3204/3208 Dout loading

ErlendErlend Posts: 612
edited 2014-10-14 07:57 in General Discussion
I want to connect a LED to the SPI interface of the MCP3208 on an analogue input card I am putting together - just to show when it is 'alive'. Problem is, I cannot see from the data sheet what kind of load the Dout can take, so I do not know if I can connect a LED direct through say a 1k, or if I have to include some sort of amp in between, to avoid overloading the output signal?

Erlend

Comments

  • T ChapT Chap Posts: 4,223
    edited 2014-10-05 08:46
    What about just any type of buffer, like a 4050 or 4049? Otherwise drive an npn transistor and the the transistor sink the LED.
  • ErlendErlend Posts: 612
    edited 2014-10-05 13:12
    Yes, I have some 4000 series chips in the drawer, but if buffering is not needed it would be a waste of work and pcb.

    Erlend
  • DomanikDomanik Posts: 233
    edited 2014-10-05 14:08
    Hi Erlend,

    Looks like Dout is speced at 0.4 volts at 1ma. This would "hint" at 400 ohm output impedance although it is typically better. My concern would be the output being pulled high/low while data is read and the logic threshold inadequate. You should verify it with a 1K resistor tied to Dout and the other end to VCC then measure the Dout. This should tell you what the output impedance is. Another approach would be to use an NPN transistor, 330 resistor on the emitter and LED on the collector (Dout on the base). These come in SOT-23 and will keep the PCB size down while giving you a bright LED and low load on the Dout.

    Dom...
  • kwinnkwinn Posts: 8,697
    edited 2014-10-05 19:45
    A high efficiency red led and resistor (3.3K or 1.5K for mcp at +5V or +3.3V respectively) should work. I have done this at +5V on the mcp but not at 3.3V.
  • ErlendErlend Posts: 612
    edited 2014-10-06 08:06
    kwinn wrote: »
    A high efficiency red led and resistor (3.3K or 1.5K for mcp at +5V or +3.3V respectively) should work. I have done this at +5V on the mcp but not at 3.3V.
    I'll give this a try. Old fashioned red or green should both be very low voltage, but maybe the red one is more efficient. I have only one left in the box, all the others are more fancy colours. But one is enough. Hate to use the (alarming) red colour for something normal, though, so maybe still I will try the green first.
    Erlend
  • DomanikDomanik Posts: 233
    edited 2014-10-06 15:02
    Erlend,

    It just occurred to me that a short pulse won't show up on the LED. Even if it's a constant pulse stream LED brightness will be a factor of the duty cycle. You might need a one shot that holds the LED on for a few hundred mill-seconds. Do you have a scope to verify the signal?

    Good Luck

    Dom..
  • kwinnkwinn Posts: 8,697
    edited 2014-10-06 21:16
    Erlend wrote: »
    I'll give this a try. Old fashioned red or green should both be very low voltage, but maybe the red one is more efficient. I have only one left in the box, all the others are more fancy colours. But one is enough. Hate to use the (alarming) red colour for something normal, though, so maybe still I will try the green first.
    Erlend

    Domanik has a good point regarding duty cycle. If the data transmissions are short and infrequent you may need to stretch the on time of the led using a 555 timer or diode, capacitor, and transistor circuit.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-10-07 10:33
    If you're just verifying access to the chip you could also use the clock line. Since that is driven by the MCU and not the chip you don't need to be as concerned with loading, however this will visually indicate access to the ADC, not if it is responding.

    As a note, because of the half-duplex nature of the SPI communication from this device the DIN/DOUT lines are often connected together, meaning that your LED would display data coming in and going out from the chip.
  • ErlendErlend Posts: 612
    edited 2014-10-09 11:46
    Yes, the DIN/DOUT lines are connected together, but the comingt data would be short compared to the going data. Looking at the data sheet, the duty cycle is tied to the clock signal. I'm not sure how that works out, but I know of one way to find out: plug in the soldering iron and get to work.
    Erlend
  • ErlendErlend Posts: 612
    edited 2014-10-12 12:07
    Soldering complete: I tied DOUT to DIN throgh a 3k3 as per the OBEX driver, and I connected directly from DOUT to a red LED through a resistor - tried from 1k5 to 250 - but only a faint glimmer of light could be seen. Switching off the light in the room, the red light could be clearly seen, and I could se the shimmering corresponding to the signalling. Conclusion: a transistor or other driver is required. When I hooked up the scope it looked like the duty cycle was maybe 20/80, so the LED will probably need to be driven hard to give any amount of light.
    Erlend
  • ErlendErlend Posts: 612
    edited 2014-10-13 08:41
    Solution: tied DOUT to a MOSFET (BS 170) to drive a LED through a 250R. Even with a blue LED the light is strong and clear. I cannot see any flickering (signal) though, so that must have been imagination - the frequency is probably too high for my eye to register.
    Erlend
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-10-13 09:03
    By no flickering, do you mean the LED is solid on and no turning on/off as it should be? If so, how exactly do you have the FET wired?
  • ErlendErlend Posts: 612
    edited 2014-10-14 07:57
    The LED stays off when I power up the board, but as soon as the Propellor (board) starts communicating with it - i.e. scanning the ADC - the LED goes on solid. I am assuming that is because the scanning is so fast that the digital signal has a too high frequency to detect by the eye. The FET is wired as simple as can be: Source to gnd, Drain to LED which connects to +3.3V through 250R. Gate is connected through a 250R (just because it was there already and serves as a convenient PCB jumper) to DOUT . I guess I could modify the ADC scanner code to include a delay between each round, and thus make the LED blink - just for fun.

    Erlend
Sign In or Register to comment.