L'Hexapod: CD74HCT238E

Previously published

This article was previously published on lhexapod.com as part of my journey of discovery into robotics and embedded assembly programming. A full index of these articles can be found here.

My progress has been slow over the past couple of weeks because a) I’ve been rather busy with other things and b) an order of components has gone missing in the post. The order contains some 4mhz crystals and therefore my server controller firmware testing has been on hold as I’d like to remove the potential clock instability as a potential cause of the controller jitters before continuing my debugging.

Today another parts order arrived (this what what alerted me to the loss of the first order; they were both from the same supplier and I expected them to come as a single delivery). Today’s order contained some CD74HCT238E’s, these are the 3 to 8 line demultiplexors that I’m intending to use to expand the PWM channels that I can produce with the ATtiny2313. The microprocessor can use three address lines to control multiple 238s and then use a single PWM channel per 238 to expand the number of channels that it can produce. First we’ll send a pulse on channel1 of all the 238s, then we’ll increment the common address lines and send a pulse on channel2 of all the 238s, etc. If we do this quickly enough we’ll satisfy the servos 50hz refresh requirement and we’ll have a servo controller that can control more servos than it has I/O pins; using 1 pin for PWM for each of the 238s and 3 pins for addressing all of them at once.

This afternoon I breadboarded up one of the 238s to the Arduino and cycled through each of the channels flashing an LED on each channel in sequence. Woo! Proof of concept…

I’ve also ordered some 138s which are similar but are active low rather than active high. These should also do the job of demultiplexing the signals but, I think, will require more board space and a more complicated layout as they’ll need pull-up resistors. I’m not quite sure that I understand how to use the 138s as replacements for the 238s but that’s part of what I’d like to understand…