Monday 15 April 2019

Using an array of resistors to give priority on a bus



I remember that the ZX Spectrum used an array of resistors to let the output from one chip override the output from another chip (on a bus) when both had the ¬oe pulled low.


 +--------+    +--------+
| 74HCxxx| | 74HCxxx|
+--------+ +--------+
|||||||| ||||||||
|||||||| RRRRRRRR
|||||||| |||||||| 8
-------------------------/----...

I understand that this is power-inefficient as current will flow from logic 1s (on one chip) to logic 0s (on another chip) through the resistors.



What value of resistors should be used for 74HCxxx chips, so that there is enough of a voltage difference between the 0s and 1s to still register as a 0 or 1 when both chips are outputting conflicting bit values?



Answer



We just need ohm's law. Let's say we define Io as the output current (source or sink) you allow.


Io has to be lower than 20mA for 74HC, or you'll be above the absolute limits. It also has to be much greater than the input leakage current (which is 1µA max for 74HC), or you'll have voltages levels out of specs.


The greater you set it, the more consumption you'll have, but the faster the chip with the resistors attached will be able to toggle its output states. Setting it to a few mA seems reasonable.


The resistors should simply be Vsupply / Io.




Impact on signal timing


This is also easy to estimate. You need to know the capacitance that exists on the bus line. It is the input capacitance of the reading devices, which is 3.5pF typical for one 74HC pin, plus the output capacitance of the left device in HiZ, which is 6pF typical for 74HC. It makes about 10pF if there is only one reading device. Now, you just have to check the RC time constant of this, using the resistor value that you chose. For example, with a 4k7 resistor, this leads to a 47ns time constant. This gives a rough approximation of the additional delay caused by the resistor. Whether this is acceptable or not depends on the rest of your circuit. If you work on a frequency ten times below this (about 2MHz for this example), you're probably fine.





Note: all the 74HC figures used here can be found in this document from NXP.




If it wasn't 74HC, but TTL LS: You'd have to do more accurate calculations, because the input leakage current is not so small. Moreover, the sink and source leakage currents (Iih / Iil) were different, as well as output sink and source capabilities (Ioh / Iol).


So you'd have to check every detail of every possible case, namely: when the left chip is at 0 and the right chip (with the resistors) is at 1, the opposite (left at 1 and right at 0), left at HiZ and right at 0, left at HiZ and right at 1.


For the two non-HiZ case, you'd have to consider, using the worst case output levels of left and right chip, whether the bus line level is still within specs (accounting for the input leakage, eventually multiplied by the number of chips that read the bus).


For the HiZ cases, check whether the voltage drop across the resistor due to the input leakage (eventually multiplied) does not make the bus line level out of spec.


Hopefully, these days are over.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...