The 8051 Microcontroller and Embedded

(lily) #1
Department of Computer Scien

ce and Information Engineering

National Cheng Kung University, TAIWAN

8255 HANEL


INTERFACING


ADC


Connection To The 8255


‰the following is a program for the ADC connected to 8255 as show in fig 15-^11


MOV A,#80H

;ctrl word for PA=OUT

PC=IN

MOV R1,#CRPORT

;ctrl reg port address

MOVX @R1,A

;configure PA=OUT

PC=INBACK: MOV R1,#CRORT

;load port C address

MOVX A,@R1 ;read PC to see if ADC is
ready

ANL A,#00000001B

;mask all except PC0

;end of conversation, now get ADC dataMOV R1,#APORT ;load PA addressMOVX A,@R1

;A=analog data input
Free download pdf