One of my codeshere is just a lazy test. Not even this works, test nor shutdown. simple test code:
#include <avr/io.h>/test
#include <util<avr/delayio.h>
int main(void)
{
DDRB = 0b00000111; // pin 1(data), 2(clock) and 3(latch) are outputs
/*
//display test
PORTB = 0b00000000;1 << PINB0; // data pin 1 is high
PORTB = 0 << PINB1; // clock pin 2 is low
PORTB = 0 << PINB2; // latch pin 3 is low
_delay_ms(PORTB = 1); << PINB1; // clock pin is high
uint16_tPORTB data;= 0 << PINB1; // clock pin is low
data
PORTB = 0b0000110000000000;1 << PINB1; // dataclock topin shiftis outhigh
PORTB to= the0 register<< PINB1; // clock pin is low
PORTB = 1 << PINB1; //read bitclock pin is high
uint16_tPORTB mask;= 0 << PINB1; // clock pin is low
for
PORTB (mask= 1 << PINB1; // clock pin is high
PORTB = 0b1000000000000000;0 mask>0;<< maskPINB1; >>=// 1)clock pin is low
{
PORTB = 1 << PINB1; // clock pin is high
PORTB = 0 << PINB1; //iterate throughclock bitpin maskis low
PORTB = 1 << ifPINB1; (data// &clock mask)pin is high
PORTB = 0 << {PINB1; // ifclock bitwisepin ANDis resolveslow
PORTB to= true1 << PINB1; // clock pin is high
PORTB = 0 << PINB1; // clock pin is low
PORTB = 1 << PINB1; // sendclock onepin is high
PORTB = 0 << PINB1; // clock pin is low
// next 8 bits
PORTB |== 1 << PINB0;PINB1; // clock pin is high
PORTB = 0 << PINB1; // clock pin _delay_ms(is low
PORTB = 1); << PINB1; // clock pin is high
PORTB = 0 << PINB1; // clock pin is low
PORTB = 1 << PINB1; // tickclock pin is high
PORTB = 0 << PINB1; // clock pin is low
PORTB |== 1 << PINB1; // clock pin is high
PORTB = 0 << PINB1; // clock pin _delay_ms(is low
PORTB = 1); << PINB1; // clock pin is high
PORTB = 0 << PINB1; // clock pin is low
PORTB = 1 << PINB1; // tockclock pin is high
PORTB = 0 << PINB1; // clock pin is low
PORTB &== ~(1 << PINB1);PINB1; // clock pin is high
PORTB = 0 << PINB1; // clock pin _delay_ms(is low
PORTB = 1); << PINB2; // latch pin 3 is high
*/
// shutdown
PORTB = 1 }<< PINB0; // data pin 1 is high
PORTB = 0 << else{PINB1; //if bitwiseclock andpin resolves2 tois falselow
PORTB = 0 << PINB2; // latch pin 3 is low
PORTB = 1 << PINB1; // sendclock 0pin is high
PORTB = 0 << PINB1; // clock pin is low
PORTB &== ~(1 << PINB0);PINB1; // clock pin is high
PORTB = 0 << PINB1; // clock pin _delay_ms(is low
PORTB = 1); << PINB1; // clock pin is high
PORTB = 0 << PINB1; // clock pin is low
PORTB = 1 << PINB1; // tickclock pin is high
PORTB = 0 << PINB1; // clock pin is low
PORTB |== 1 << PINB1; // clock pin is high
PORTB = 0 << PINB1; // clock pin is _delay_ms(low
PORTB = 1); << PINB1; // clock pin is high
PORTB = 0 << PINB1; // clock pin is low
PORTB = 1 << PINB0; // tockdata pin is low
PORTB = 1 << PINB1; // clock pin is high
PORTB &== ~(0 << PINB1; // clock pin is low
PORTB = 1 << PINB1);PINB1; // clock pin is high
PORTB = 0 << PINB1; // clock pin is low
// _delay_ms(next 8 bits
PORTB = 1); << PINB1; // clock pin is high
PORTB = 0 << }PINB1; // clock pin is low
PORTB = 1 << PINB1; // clock pin is high
PORTB = 0 << PINB1; // clock pin is low
PORTB = 1 << PINB1; // clock pin is high
}PORTB = 0 << PINB1; // clock pin is low
PORTB |== 1 << PINB2;PINB1; // latchclock allpin theis datahigh
_delay_ms(PORTB = 0 << PINB1; // clock pin is low
PORTB = 1); << PINB1; // clock pin is high
PORTB &== ~(0 << PINB1; // clock pin is low
PORTB = 1 << PINB2);PINB1; // latchclock pin 3is high
PORTB = 0 << PINB1; // clock pin is low
_delay_ms(1000);
PORTB = 1 << PINB1; // clock pin is high
PORTB = 0 << PINB1; // clock pin is low
}
PORTB = 1 << PINB2; // latch pin 3 is high
}