Posts

Showing posts with the label Digital Logic

7400 Series CMOS Vs 4000 Series Logic IC

Answer : The difference depends on your system definition. On the one hand, 74HC operates over a limited voltage range, with 6 volts specified as the maximum supply voltage. The CD4000 series, on the other hand, is rated to a maximum of 18 volts, so it may well be easier to use the CD4000 series in a battery-operated system. If the limited voltage range of the 74HC line is not a problem, the line is much faster. For instance, comparing the CD4011/74HC00 (Quad 2-input NAND gates) gives propagation delays at 5 volts of 90 nsec (typ) vs 7 nsec. For the CD4063 vs the 74HC85 (4-bit magnitude comparator) the numbers are 625 nsec (typ) vs. 63 nsec. The CD40192 4-bit up/down counter has a typical count frequency of 4 MHz, while the 74HC192 goes at 36 MHz. It's worth keeping in mind that both lines run faster at higher Vdd, so a CD4000 at 15 volts will do better than the numbers here, but the order of magnitude difference is not erased. And yes, the 74HC series is designed to rough...

AnalogRead(0) Or AnalogRead(A0)

Answer : To answer Tyilo's specific questions: analogRead(5) and digitalRead(5) will read from two different places. The former will read from analog channel 5 or A5 and the latter will read from pin 5 which happens to be a digital pin. So yes, if you want to read an analog pin with digitalRead you should be using A5 . Why? analogRead requires a channel number internally but it will allow you to give it a pin number too. If you do give it a pin number it will convert it to its corresponding channel number. As far as I can tell analogRead is the only function which uses a channel number internally, is the only one to allow a channel number, and is the only function with this undocumented pin-to-channel conversion. To understand this let's start off with some examples. If you want to use analogRead on the first analog pin A0 you can do analogRead(0) which uses the channel number or analogRead(A0) which uses the pin number. If you were to use the pin number ...