- Tue Apr 18, 2006 6:00 pm
#12443
Sorry for the crummy subject line, but it's a bit difficult to summarize my problem.
I have a device that I want to hook up to a uC (16f88 in this case). The device has 4 pins: Vcc, clock, data, and ground. It runs at 1.5v. The device sends data to the uC via the clock/data lines. The uC runs at 5v.
What I have done so far is tie the grounds together, and hook the clock and data lines directly to the uC (right now, Vcc is provided by a small battery). This actually works just fine, even though logic high is only 1.5v. It's not a mission-critical app, and I'm triple sampling in any case, so even if I'm dropping a bit here and there, it's not a big deal.
The trouble is this: the device has two "buttons" on it (only one of them is physical), which I need to "press" in a sequence upon startup. This is done by pulling either the clock or data lines to Vcc (preferably with a 1k or so resistor inline). Of course, I want the uC to do this automatically.
Obviously I can't just set TRISIO==0, since that will send 5v to the pin, which is too much. I don't want to short the thing out. One thought is to use a resistor network and a diode, but wouldn't that cause some kind of current loop, especially if the voltages were a bit off? I'd like to use a transistor, but I've only ever used them (NPN kind) to "pull a wire to ground", not to a specific voltage. And what if the base voltage is higher than what I'm trying to pull the pin to?
What about MOSFETs? I've got some handy, but I've never really understood how to use them. Can I just connect the gate to the uC, the source to +1.5v, and the drain to a 1k resistor and then to the device?
I know that a relay would work fine, but that's just such an ugly solution that I want to avoid it.
Incidentally, I will eventually need to connect 3 of these devices, and would like to use as few pins as possible. Obviously, unless I mux them, I need at least 6 for the 3 sets of clock/data, and presumably 2 more for pulling clock/data high (I don't need independent control for the buttons). I can't really spare any more than this (and would like to mux the clock/data pins eventually anyway).
Thanks for any help!
-Scott
I have a device that I want to hook up to a uC (16f88 in this case). The device has 4 pins: Vcc, clock, data, and ground. It runs at 1.5v. The device sends data to the uC via the clock/data lines. The uC runs at 5v.
What I have done so far is tie the grounds together, and hook the clock and data lines directly to the uC (right now, Vcc is provided by a small battery). This actually works just fine, even though logic high is only 1.5v. It's not a mission-critical app, and I'm triple sampling in any case, so even if I'm dropping a bit here and there, it's not a big deal.
The trouble is this: the device has two "buttons" on it (only one of them is physical), which I need to "press" in a sequence upon startup. This is done by pulling either the clock or data lines to Vcc (preferably with a 1k or so resistor inline). Of course, I want the uC to do this automatically.
Obviously I can't just set TRISIO==0, since that will send 5v to the pin, which is too much. I don't want to short the thing out. One thought is to use a resistor network and a diode, but wouldn't that cause some kind of current loop, especially if the voltages were a bit off? I'd like to use a transistor, but I've only ever used them (NPN kind) to "pull a wire to ground", not to a specific voltage. And what if the base voltage is higher than what I'm trying to pull the pin to?
What about MOSFETs? I've got some handy, but I've never really understood how to use them. Can I just connect the gate to the uC, the source to +1.5v, and the drain to a 1k resistor and then to the device?
I know that a relay would work fine, but that's just such an ugly solution that I want to avoid it.
Incidentally, I will eventually need to connect 3 of these devices, and would like to use as few pins as possible. Obviously, unless I mux them, I need at least 6 for the 3 sets of clock/data, and presumably 2 more for pulling clock/data high (I don't need independent control for the buttons). I can't really spare any more than this (and would like to mux the clock/data pins eventually anyway).
Thanks for any help!
-Scott