P87LPC767 NXP Semiconductors, P87LPC767 Datasheet - Page 14
![no-image](/images/manufacturer_photos/0/4/487/nxp_semiconductors_sml.jpg)
P87LPC767
Manufacturer Part Number
P87LPC767
Description
The P87LPC767 is a 20-pin single-chip microcontroller designed forlow pin count applications demanding high-integration, low costsolutions over a wide range of performance requirements
Manufacturer
NXP Semiconductors
Datasheet
1.P87LPC767.pdf
(61 pages)
Available stocks
Company
Part Number
Manufacturer
Quantity
Price
Company:
Part Number:
P87LPC767BD
Manufacturer:
XILNX
Quantity:
22
Company:
Part Number:
P87LPC767BD
Manufacturer:
PHILIPS
Quantity:
52
Part Number:
P87LPC767BD
Manufacturer:
PHILIPS/飞利浦
Quantity:
20 000
Company:
Part Number:
P87LPC767BDЈ¬512
Manufacturer:
NXP
Quantity:
2 327
Company:
Part Number:
P87LPC767BN
Manufacturer:
ST
Quantity:
34 000
Company:
Part Number:
P87LPC767BNЈ¬112
Manufacturer:
NXP
Quantity:
3 425
Part Number:
P87LPC767FD
Manufacturer:
NXP/恩智浦
Quantity:
20 000
Philips Semiconductors
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.
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.
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.
2002 Mar 25
Low power, low price, low pin count (20 pin)
microcontroller with 4-kbyte OTP and 8-bit A/D converter
; Set up port pins for A/D conversion, without affecting other pins.
; Start A/D conversion.
ADStart:
;
;
; A/D interrupt handler.
ADInt:
ADRead:
ADChk:
mov
anl
orl
orl
setb
orl
orl
ret
push
mov
mov
clr
anl
pop
reti
orl
setb
jnb
mov
clr
anl
ret
PT0AD,#78h
P0M2,#87h
P0M1,#78h
ADCON,A
ADCS
PCON,#01h
PCON,#02h
ACC
A,DAC0
ADResult,A
ADCI
ADCON,#0fch
ACC
ADCON,A
ADCS
ADCI,ADChk
A,DAC0
ADCI
ADCON,#0fch
; Disable digital inputs on A/D input pins.
; Disable digital outputs on A/D input pins.
; Disable digital outputs on A/D input pins.
; Add in the new channel number.
; Start an A/D conversion.
; The CPU could be put into Idle mode here.
; The CPU could be put into Power Down mode here if RCCLK = 1.
; Save accumulator.
; Get A/D result,
;
; Clear the A/D completion flag.
; Clear the A/D channel number.
; Restore accumulator.
; Add in the new channel number.
; Start A/D conversion.
; Wait for ADCI to be set.
; Get A/D result.
; Clear the A/D completion flag.
; Clear the A/D channel number.
and save it in memory.
11
P87LPC767
Product data