This is a multi-part message in MIME format. ------=_NextPart_000_0005_01C1F646.DF8A2200 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hello to all, I have been trying to use a TI TPIC6B595 power shift register without success. I have attatched the C source code that I wrote to see what I am overlooking. In writing the code I used the data sheet along with an App. note showing the control pin waveforms to transfer data. I know that it must be something simple but I can't find it. The code is for CCS. Thanks for your help Rod ------=_NextPart_000_0005_01C1F646.DF8A2200 Content-Type: application/octet-stream; name="tryshift.c" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="tryshift.c" #include <16f73.h> #fuses xt,nowdt,noprotect #byte porta =3D 5 #byte portb =3D 6 #byte portc =3D 7 //-----------------------------------------------------------------------= ----------------------- #use standard_io(a) #use standard_io(b) #use standard_io(c) #use delay(clock=3D4000000) //-----------------------------------------------------------------------= ----------------------- #define DATA_LINE PIN_C0// Pin # 3 on TPIC6B595 #define SRCK PIN_C1// Pin # 13 #define RCK PIN_C2// Pin # 12 #define G_BAR PIN_C3// Pin # 9 #define SRCLR_BAR PIN_C4// Pin # 8 void set_up(); void write_byte(); byte ser_in =3D 0; main() { set_up(); do {=20 ser_in =3D 0x55; write_byte(); delay_us(200);// 5khz refresh rate=20 } while(1); } write_byte() { byte counter,write_value[1] =3D 0; write_value[0] =3D ser_in; output_low(G_BAR); output_low(data_line); output_low(SRCLR_BAR);// clear input shift register output_high(SRCLR_BAR); =20 for(counter=3D1;counter<=3D8;++counter) { if(shift_left(write_value,1,0))// Shift in MSB first { output_high(data_line); } else { output_low(data_line); } delay_cycles(1); output_high(SRCK);// shift bit into shift register delay_cycles(1); output_low(SRCK);=20 } output_high(RCK);// xfer shift register outputs to storage = register delay_cycles(1); output_low(RCK); =20 } set_up() { set_tris_c(0x00); output_low(G_BAR); output_high(SRCLR_BAR); output_low(data_line); =20 }=20 ------=_NextPart_000_0005_01C1F646.DF8A2200-- -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics