Saturday, August 13, 2011

Write a program to bring in a byte of data serially one bit at a time via pin P2.7 and save it in register R2. The byte comes in with the LSB first.

; INITIALIZE A COUNTER REGISTER
MOV R0,#08h       ;
LOOP: MOV C,P2.7  ; BRING IN BIT
RRC A             ;
DJNZ R0,LOOP      ; LOOP TILL ALL 8 BITS ARE IN
END 
; END OF PROGRAM

No comments:

Post a Comment