0
\$\begingroup\$

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.

  1. pulse Clear pin and ALL outputs go high
  2. pulse each desired data input pin (eg: 3,5,7)
  3. corresponding output pins go low and STAY low to drive the desired led colour
  4. wait for 1 ms
  5. 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?

\$\endgroup\$
3
  • 1
    \$\begingroup\$ This sounds very much like a cheap MCU. You can write the custom software for it, easily. Flexible, too, as you can adjust the software as needs require over time. That said, I can't say much more because I don't see a diagram of the device you are looking to create, with inputs and outputs nicely laid out with timing diagrams. Can you write more? \$\endgroup\$
    – jonk
    Commented Jan 23, 2022 at 10:07
  • \$\begingroup\$ This sounds like a cheap and simple CPLD. You can write the small HDL needed for the simple logic circuit you want and modify it as you like. Your circuit can have the timings you want. You can simulate in on your computer and see every gate in your circuit. It's simple and easy to learn to do if you don't know how, there's mountains of information and teaching guides, plus lots of cheap demo boards if you want to try before you decide. The development software you'll need is to free download and use. \$\endgroup\$
    – TonyM
    Commented Jan 23, 2022 at 11:01
  • \$\begingroup\$ Two 74xx259 chips. Second time this week this has come up. \$\endgroup\$
    – Kartman
    Commented Jan 23, 2022 at 12:42

1 Answer 1

0
\$\begingroup\$

Thank you for comment ideas.

I could use a PLA or a CPLD I agree, but that's more than I want to get into now. I have narrowed it down to three options to solve the usecase instead of the 4 to 16 decoder which wasn't the way forward for me.

  1. For LEDs only there's the MAX7219 which controls 64 LEDs. Perhaps this can do RGB on fewer LEDs or multiple chips;

  2. For general output the component I wanted is a Shift Register like 74hc595;

  3. For LEDs there's Charlieplexing (Perhaps could be adapted to general case with the use of diodes in series with load) http://www.pcbheaven.com/wikipages/Charlieplexing/

I credit answers to this article: https://arduino.stackexchange.com/questions/117/is-there-a-way-to-have-more-than-14-output-pins-on-arduino

While I accept this is a change of approach, no longer using a decoder, it is the solution to my question in spirit.

\$\endgroup\$
3
  • \$\begingroup\$ A warm welcome to the site. I think you're using Answer on this site like Reply is used on discussion forums. As this is not a single answer to the question, can you edit this information into your question at the end then delete this Answer. Thanks again and, again, welcome. \$\endgroup\$
    – TonyM
    Commented Jan 23, 2022 at 14:28
  • 1
    \$\begingroup\$ spl - Hi, This answer isn't clear to me. Either (a) You really meant to write it as an answer, because it really does answer your original question (even though it doesn't seem to do that to me). In that case, please clearly state that this is the final solution for you & you don't want/need further replies. Then please come back in 2 days to "accept" this answer, to close the whole topic (self-answers can only be accepted after 48 hours has elapsed since asking the question). \$\endgroup\$
    – SamGibson
    Commented Jan 23, 2022 at 14:49
  • \$\begingroup\$ [continued] Or, (b) You didn't mean this to be the final answer, and you still want more responses. In which case, as commented above, this is an update and not an answer, and must be "edited into" your original question e.g. click "Edit" under the question, add this new information at the bottom, then delete this answer. || Which applies here, (a) or (b)? Thanks. \$\endgroup\$
    – SamGibson
    Commented Jan 23, 2022 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.