How to understand shift register 74HC595 with 08M2

Hello everybody,
I am asking for help. I am desperate because I would like to learn how to programm 74HC595 which is connecting to 08M2. I know how to wire the circuit but I cannot understand what I should do to make 8 LED diodes flash one after another with pauses let's say 200ms between each flash. I was searching the forum but I do not understand. Could anybody show me code that is able to do it? This is for me to start before I try to code some more difficult efects. Forgive please my poor english as I am not native speaker.
 

westaust55

Moderator
Further to the link that eclectic has provided which provides a routine to pass a byte or two bytes to 1 or 2 of the 74HC595 chips,
Assuming that you only want 8 LEDs then additional code tasks for your specific project would be:
1. Place the desired bit pattern for the LEDs in a bytes variable - a different variable to that used by the code to transfer the data to the 74HC595 (say for example b5)
2. Pass the value to the data transfer code variable b0
3. Shift the value in b5 one bit (multiple or divide by 2 depending upon the desired direction on illuminated LEDs)
4. Pause for the desired delay period
5. Go back to step 2.

Ther would be a few more steps if you wish to across the display around so it keeps repeating.
 
Last edited:
Top