Skip to main content
Topic: Bus Pirate v4 hardware  (Read 72293 times) previous topic - next topic

Re: Re: Bus Pirate v4 hardware

Reply #150
[quote author="KamalS"]what do you guys think about swapping the 4066 with 4 garden variety 2N3904 or the like NPNs?[/quote]
In general, for replacing a 4066 (CMOS) in an arbitrary circuit, you should really use FET instead of bipolar (NPN). A bipolar can only pass current in one direction, where an FET acts like a voltage-controlled resistor. MOSFET really is just like a digital-controlled switch. However, the 4066 is pretty cheap already: At about $0.20 for the chip, you'd need $0.05 transistors or cheaper to beat the total price.

In the specific example of the BPv4, though, the 4066 is most certainly not the most efficient design. The current only ever flows in one direction, so bipolar transistors just might work. You would have to design around any diode voltage drops, otherwise the pull-ups would not reach full voltage. I can't remember how to calculate the Collector-to-Emitter voltage drop for a transistor, and I suppose it depends upon the exact transistor, but that's probably where you need to be careful.

I suggest that you start a new topic under Bus Pirate Development, where we can discuss replacing the 4066 pullup switches with something a little more streamlined. It might even be possible to do this with a single transistor, I'm not sure.


Re: 4066 replacement

Reply #151
Regarding eliminating the huge 4066: I don't think it's big enough an issue to start a whole thread.
Of course the simplest that comes to mind, like rsdio mentioned, is just bunching all the pull-up resistors to a common, selectable V_PU like the first drawing. Very cheap : replaces the 4066 with an extra PNP+diode for enabling V_EXT.

Problem : now, if the all pullups are disabled (Q1-3 not conducting), the data/clock lines are all connected together through various resistors. If you're running a TX/RX UART with strong drivers at both ends; probably no big deal. But if RX is driving +5V while TX is driving 0V, then the other lines are at 2.5V ! That may be a problem either for the PIC pins or other circuits connected to the unused lines, I'm really not sure of the implications.

Solution: we can add diodes in series with each pull-up resistor. That's a few extra parts (2x BAT54A this time, common-anode diodes in one SOT23) but solves the inter-connection problem. The additionnal "diode drop" shouldn't be a problem : if a 2k pull-up resistor is sourcing 1mA (unlikely), it already drops 2V so the additional ~0.3V of a schottky is small.

Is it worth it ?
extra parts = 1xPNP, 1x resistor,  2x bat54; but removed 1x4066.
Pros: smaller footprint, nearly the same cost, cheaper to repair (but how would it break ?), expandable for >4 bus
cons: extra diode drop (small con !), PCB change required, more parts

Tough call ! For my own stuff I would go with the discrete solution because I don't like, and don't stock 4066 ICs. For a production board... I think it would be cheaper to go with the IC.
[EDIT : I just remembered another problem with the discrete solution : if VEXT can be larger than 5V, it's necessary to drive its transistor with an open-collector output from the PIC, but only if the PIC pins aren't protected by diodes to VCC. If so, it needs an NPN transistor as well !! So unfortunately another point in favor of the 4066]