Saturday, April 30, 2016

8051 Program – polling an io pin

; polling an io pin
; poll p0.1
; if set, write 55H to port 1
;if low, write 0 to port 1
ORG 0H
SETB P0.1 ; make P0.1 an input pin
AGAIN: JNB P0.1, LLOW
LHIGH: MOV P1, #55H
SJMP HERE
LLOW:MOV P1, #00H
HERE:SJMP AGAIN
END



Related topics:
8051 Program - logical operation   |   8051 Program - parity generation   |   8051 Program - port loopback   |   8051 Program - send ascii to port   |   8051 Program - serializing data   |   8051 Program - simple serial transmission   |   8051 Program - memory subroutines   |   8051 Program - math subroutines   |   8051 Program - conversion subroutines

List of topics: 8051

No comments:

Post a Comment