The 8051 Microcontroller and Embedded

(lily) #1
Department of Computer Scien

ce and Information Engineering

National Cheng Kung University, TAIWAN
HANEL
OTHER MODES OF THE 8255

BSR
(Bit Set/Reset)Mode

(cont


’)


Example 15-7Program the 8255 in Figure 15-13 for the following.(a) Set PC2 to high.(b) Use PC6 to generate a squareSolution:(a)


MOV R0,#CNTPORTMOV A,#0XXX0101 ;control byteMOVX @R0,A
(b)AGAIN MOV A,#00001101B ;PC6=1

NOV R0,#CNTPROT

;load control port add

MOVX @R0,A ;make PC6=1ACALL DELAYACALL DELAYMOV A,#00001100B ;PC6=0ACALL DELAY

;time delay for low pulse

SJMP AGAIN
Free download pdf