Department of Computer Science and Information EngineeringNational Cheng Kung University, TAIWAN
HANEL
OTHER MODES OF THE 8255BSR
(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=1NOV R0,#CNTPROT;load control port addMOVX @R0,A ;make PC6=1ACALL DELAYACALL DELAYMOV A,#00001100B ;PC6=0ACALL DELAY;time delay for low pulseSJMP AGAIN