5V to 3V communication

Discussion in 'Embedded Systems and Microcontrollers' started by BladeSabre, Nov 24, 2006.

  1. BladeSabre

    Thread Starter Senior Member

    Aug 11, 2005
    105
    0
    I have a PIC18F2455 running at the approx 5V of the USB. I want to achieve two-way communication with a 3V device.

    There are only two wires: GND plus a data line. The system is symmetrical. Either device can talk first, and they take it in turns to transmit. When listening, they provide a weak pull-up. When talking, they source with about 3K of internal resistance and sink with between about 200R and 3K (it varies from one to the next). There is no datasheet available; this is just what I have observed.

    I have previously done one-way communication off a 3V supply using only two states, sourcing through 3K8 to mean Talk:High and Listen, and sinking through 200R for Talk:Low. This works fine, but reading the returning signal would be a problem on some of them, because they can't pull the voltage down far enough. (Increasing the source resistance much more causes the waveform to distort and the signal to fail. It looks like there's some capacitance in there too.) Using a PIC at 3V, I imagine it would work to use one I/O pin with 3K in series, and switch the pin between output and input as required.

    It looks like the kind of circuit I use to reduce the level needs to have a tristate output. I have plenty of pins on the PIC, so there would be nothing wrong with using two pins for output control and another one for the input. However, I would like to make the additional circuitry as simple as possible. I have no experience with this kind of thing and no idea what the name of it would be. May I have a few suggestions on this?
     
  2. Papabravo

    Expert

    Feb 24, 2006
    10,137
    1,786
    What you want is a tristate buffer that can have any Vcc from 2.0 to 5.5 volts and inputs which can have any voltage 0 VDC to 5VDC. They can easily interface 5 V systems to lower voltage systems. On Semiconductor and Fairchild both have families of parts. Here is the On semiconductor part we use in our products.

    http://www.onsemi.com/pub/Collateral/MC74VHC1G125-D.PDF
     
  3. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    You stated that there was no datasheet on the device your PIC is communicating with. Can you provide any info on the part you are talking to, like a part number and manufacturer?

    hgmjr
     
  4. BladeSabre

    Thread Starter Senior Member

    Aug 11, 2005
    105
    0
    Papabravo:
    That looks like a useful item. If I understand right, it can be powered with 3V and controlled by 5V logic. I am still not sure how to get the 3V though. The PIC actually has its own 3.3V regulator for the USB thing, but I'm pretty sure loading that is a bad idea... (and it might be too high anyway).

    hgmjr:
    It's not a part as such, it's a toy. Since you ask, I'm referring to the Bandai Digimon pets. They can talk to each other, so I want to talk to them using my shiny new USB Device =)
     
  5. mrmeval

    Distinguished Member

    Jun 30, 2006
    833
    2
    LM7803 would work
     
  6. Papabravo

    Expert

    Feb 24, 2006
    10,137
    1,786
    You are correct. The part is extremely useful in systems which require two supplies. 3.3V can always be derived from 5V with an LDO regulator. In reverse the part can be powered from 5 volts and take its inputs from the 3.3V side. If there is not enough margin there, then a VHCT variety part with traditional TTL thresholds is also available. those thresholds are < 0.8V for a low and > 2.0V for a high.
     
  7. BladeSabre

    Thread Starter Senior Member

    Aug 11, 2005
    105
    0
    I realised last night that it's probably normal to connect it to the power rail on the low-voltage side(!) - that is not available here, but things seem to make more sense now.

    If I'm getting power from the high-voltage side and regulating it, I do need to be careful to get the voltage "right". Too high and it might damage the toy. Too low and it would annoy the tristate buffer (operating conditions state that Vout should not go higher than Vcc) - if not for that, I'd take it on the low side for safety.

    Going the other way is not a problem - I think I could just use a MOSFET. No need for a tristate buffer there, because I'm using separate PIC pins for input and output.

    I will need to look into the regulators. There are lots of different kinds, requiring very different numbers of external components.

    For the tristate buffer, I must find something that is available in the UK for a reasonable price. The two recommended, as far as I can see, not even Farnell has them, so there must be some more common part that does the same thing...
     
  8. BladeSabre

    Thread Starter Senior Member

    Aug 11, 2005
    105
    0
Loading...