Previous: Circuit for Cascade Operation of Two 74595
We have already designed the circuit for cascade operation of 74HC595/74HCT595 using arduino. Now, upload the following program to your arduino board.
Output of the above program is shown below.
LEDs connected to the, Q0 and Q1 pins of 1st 74595 turn on. Similarly, all the LEDs connected to the 2nd 74595 turn on. Arduino shift out decimal number 255 first. 255 will be stored in first 74595. After that, arduino will shiftout decimal number 3. During the second shift out (when 3 is shifted out), 255 will be shifted from first 74595 to second 74595 and 3 will be stored in first 74595. Second 74595 will store 255. As a result we will get the output as shown in diagram.
int latchPin = 11; //Pin connected to ST_CP of 1st 74595 int clockPin = 12; //Pin connected to SH_CP of 1st 74595 int dataPin = 13; //Pin connected to DS of 1st 74595 void setup() { //set pins to output so you can control the shift register pinMode(latchPin, OUTPUT); pinMode(clockPin, OUTPUT); pinMode(dataPin, OUTPUT); } void loop() { // take the latchPin low so the LEDs don't change while you're sending in bits: digitalWrite(latchPin, LOW); //Send 1 1 1 1 1 1 1 1 (255) to Q7 Q6 Q5 Q4 Q3 Q2 Q1 Q0 of 2nd 74595 shiftOut(dataPin, clockPin, MSBFIRST, 255); //Send 0 0 0 0 0 0 1 1 (3) to Q7 Q6 Q5 Q4 Q3 Q2 Q1 Q0 of 1st 74595 shiftOut(dataPin, clockPin, MSBFIRST, 3); // shift out the bits: digitalWrite(latchPin, HIGH); }
Output of the above program is shown below.
LEDs connected to the, Q0 and Q1 pins of 1st 74595 turn on. Similarly, all the LEDs connected to the 2nd 74595 turn on. Arduino shift out decimal number 255 first. 255 will be stored in first 74595. After that, arduino will shiftout decimal number 3. During the second shift out (when 3 is shifted out), 255 will be shifted from first 74595 to second 74595 and 3 will be stored in first 74595. Second 74595 will store 255. As a result we will get the output as shown in diagram.
Next: Second Program For Cascade Operation of 74595 |
Wow, amazing blog layout! How lengthy have you been running
ReplyDeletea blog for? you make running a blog glance easy. The full glance of your website is great, as neatly as the content material! 메이저사이트
I like the helpful information you supply to your articles. I'll bookmark your weblog and test again here regularly. I am fairly certain I'll be informed many new stuff proper here!
ReplyDeleteBest of luck for the following! 경마사이트
I blog quite often and I seriously thank you for your content. The article has really peaked my interest. I'm going to bookmark your site and keep checking for new information about once per week.
ReplyDeleteI opted in for your Feed too. 사설토토