I am using a 4 to 16 line decoder to convert a 4 bit number from arduino/seeed/ESP32 to drive circuits like RGB leds which would otherwise use up all my pins. There are some problems with this approach that I have solved by studying the datasheets but one has me stumped: Only one pin can be active(low) at a time on the 74HC154 so if I connect 5 RGB common anode leds I can only pulse each R/G/B cathode for 1/15 of the time so they will be dim.
I need some kind of 16 channel latch with clear function to put beside the decoder so I can accumulate active(low) pins until I pulse the clear pin. This is what I need:
Chip left: inputs 0-15, chip right outputs 0-15 and a clear pin.
- pulse Clear pin and ALL outputs go high
- pulse each desired data input pin (eg: 3,5,7)
- corresponding output pins go low and STAY low to drive the desired led colour
- wait for 1 ms
- pulse clear to start over
This way I can use the decoder to 'program' the latching chip and leave it to drive the LEDs for 1 ms or similar then clear and do the next 1 ms. If I can do this fast enough I can even send software PWM through the chips and have basic RBG functionality (Instead of just R or G or B or W or Cyan or Magenta or Yellow or off)
I have researched bus converters and flip flops but I can't find this functionality without wiring up many chips together. Does such a chip exist or can it be assembled? If not, how would you solve the basic problem?