参数资料
型号: 935267488112
厂商: NXP SEMICONDUCTORS
元件分类: 微控制器/微处理器
英文描述: 8-BIT, OTPROM, 20 MHz, MICROCONTROLLER, PDSO20
封装: 7.50 MM, PLASTIC, SO-20
文件页数: 6/69页
文件大小: 352K
代理商: 935267488112
Philips Semiconductors
Preliminary specification
87LPC768
Low power, low price, low pin count (20 pin) microcontroller with
4 kB OTP 8-bit A/D, Pulse Width Modulator
2000 May 02
12
Code Examples for the A/D
The first piece of sample code shows an example of port configuration for use with the A/D. This example sets up the pins so that all four A/D
channels may be used. Port configuration for analog functions is described in the section Analog Functions.
; Set up port pins for A/D conversion, without affecting other pins.
mov
PT0AD,#78h
; Disable digital inputs on A/D input pins.
anl
P0M2,#87h
; Disable digital outputs on A/D input pins.
orl
P0M1,#78h
; Disable digital outputs on A/D input pins.
Following is an example of using the A/D with interrupts. The routine ADStart begins an A/D conversion using the A/D channel number supplied
in the accumulator. The channel number is not checked for validity. The A/D must previously have been enabled with sufficient time to allow for
stabilization.
The interrupt handler routine reads the conversion value and returns it in memory address ADResult. The interrupt should be enabled prior to
starting the conversion.
; Start A/D conversion.
ADStart:
orl
ADCON,A
; Add in the new channel number.
setb
ADCS
; Start an A/D conversion.
;
orl
PCON,#01h
; The CPU could be put into Idle mode here.
;
orl
PCON,#02h
; The CPU could be put into Power Down mode here if RCCLK = 1.
ret
; A/D interrupt handler.
ADInt:
push
ACC
; Save accumulator.
mov
A,DAC0
; Get A/D result,
mov
ADResult,A
;
and save it in memory.
clr
ADCI
; Clear the A/D completion flag.
anl
ADCON,#0fch
; Clear the A/D channel number.
pop
ACC
; Restore accumulator.
reti
Following is an example of using the A/D with polling. An A/D conversion is started using the channel number supplied in the accumulator. The
channel number is not checked for validity. The A/D must previously have been enabled with sufficient time to allow for stabilization. The
conversion result is returned in the accumulator.
ADRead:
orl
ADCON,A
; Add in the new channel number.
setb
ADCS
; Start A/D conversion.
ADChk:
jnb
ADCI,ADChk
; Wait for ADCI to be set.
mov
A,DAC0
; Get A/D result.
clr
ADCI
; Clear the A/D completion flag.
anl
ADCON,#0fch
; Clear the A/D channel number.
ret
相关PDF资料
PDF描述
9ERS3165BGILF 400 MHz, PROC SPECIFIC CLOCK GENERATOR, PDSO64
9LPRS535BFLFT SPECIALTY MICROPROCESSOR CIRCUIT, PDSO48
935208500112 8-BIT, 16 MHz, MICROCONTROLLER, PDIP40
935208540112 8-BIT, 16 MHz, MICROCONTROLLER, PQCC44
935267591518 8-BIT, MROM, 16 MHz, MICROCONTROLLER, PQFP44
相关代理商/技术参数
参数描述
935268081112 制造商:NXP Semiconductors 功能描述:SUB ONLY IC
935268721125 制造商:NXP Semiconductors 功能描述:Buffer/Line Driver 1-CH Non-Inverting 3-ST CMOS 5-Pin TSSOP T/R
935269304128 制造商:ST-Ericsson 功能描述:IC AUDIO CODEC W/TCH SCRN 48LQFP
935269544557 制造商:NXP Semiconductors 功能描述:SUB ONLY TDA9587-2US1-V1.3
935269987557 制造商:NXP Semiconductors 功能描述:SUB ONLY TDA9587-1US1-V1.8 SUBBED TO 935269987557