5V to 3V communication

Thread Starter

BladeSabre

Joined Aug 11, 2005
105
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?
 

hgmjr

Joined Jan 28, 2005
9,027
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
 

Thread Starter

BladeSabre

Joined Aug 11, 2005
105
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 =)
 

Papabravo

Joined Feb 24, 2006
21,225
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...
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.
 

Thread Starter

BladeSabre

Joined Aug 11, 2005
105
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...
 
Top