Answer the question
In order to leave comments, you need to log in
How to link Arduino and 74HC138N?
Good day! I assembled the cxem.net/arduino/arduino39.php
circuit , uploaded the firmware, but the expectations were not met. The cube is practically non-functional.
I decided to write my own firmware, but I could not understand. how do you manage multiplexers?
Explain, please.
Answer the question
In order to leave comments, you need to log in
By the way, the scheme is in the original article .
Multiplexers are easy to control: they have three decoder inputs and three enable inputs. Two resolving - inverted, planted on the "ground".
The first multiplexer manages the enable inputs, i.e. “turns on” the desired multiplexer. If you use a controller with more legs, you don't need it (because it only "saves" two legs).
The rest of the multiplexers sit on the same parallel bus: what code you set at their input, this is their output port and is activated (in accordance with the binary signal at the input) if this multiplexer is activated (i.e., at the EN input - a logical unit ).
Thus, to activate the desired column of LEDs, a code equal to the number of the desired column should be sent to the output ports 2..6 of the duina (higher bits “automatically” switch the multiplexers).
But the rows sit on five legs of a duina (the introduction of a multiplexer here would save only two legs). Writing the code to ports 7..11 of the duin activates the layer to which you apply a logical unit. In principle, to prevent errors, it would be better to plug in a multiplexer here. Although, perhaps, this is “not a bug, but a feature” - the developer’s intention, which allows “highlighting one column at a time”.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question