| ??? 12/29/09 21:03 Read: times |
#172024 - I think this may help Responding to: ???'s previous message |
I don't know what is your problem ... but i used this IC before and here is a circuit and a code program with informative comments for explanation
This circuit and code is for Demonstration. It takes the status of a DIP switch (( 8-bit )) and send it in serial to a 8051 then send that status to 8 LEDs to check them Try,it I think this may help Sherif Gamal ...
ORG 00H
SJMP START
ORG 30H
START
CLR A ;clear the acc.
MOV P2,#00000000B ;clear port 2
MOV P1,#00000000B ;clear port 1
SETB P1.0 ;send 1 on the load shift pin
CLR P1.1 ;set clock to low level
CLR P1.3 ;clear datain pin
MOV B,#8 ;start 8 bit counter
CLR 1.0 ;send low bit to load shift
SETB 1.0 ;sed hi bit to load shift
SETB 1.1 ;set clock bit to hi(first bit is on data pin now)
READ ;start reading routin
MOV C,P1.3 ;mov data to carry reg.
SETB P1.1 ;start seconed clock
CLR P1.1 ;finish the seconed clock
RRC A ;rotate the acc with carry to right
DJNZ B,READ ;decremint the 8 bit counter
MOV P2,A ;send the data parallel to port 2
SJMP READ ;go back to read again.
END ; END
Sherif Gamal |



