74HC595

hi guys

how can i output numbers in desending order, (say 20 - 00) using 74HC595 shift register IC using an arduino uno???

this output is needed to run seven segment display

Here's a couple of ways to connect one up.

To drive it, you will create an array of fonts, where each byte represents the on/off state of the segments

fontArray[] = {
B00111111, // 0
B00000110, // 1
B01011011, // 2
etc
};

Bit 0 is segment A 1 is B, 2 is C, 3 is D, 4 is E, 5 is F, 6 is G A F B G E C D 7 would be decimal point if used Then when you select number you want to display, you pull the information from the array. I prefer using SPI to transfer data out, nice & fast:

digitalWrite (SS, LOW);
SPI.transfer(fontArray[number_to_display]);
digitalWrite(SS, HIGH);

If you have 2 digits, then daisy chain OutH/ to SerialDataIn, with SCK & SS going to both chips in parallel Then just send out 2 bytes:

digitalWrite (SS, LOW);
SPI.transfer(fontArray[Low_number_to_display]);
SPI.transfer(fontArray[High_number_to_display]);
digitalWrite(SS, HIGH);