AN2688 Freescale Semiconductor / Motorola, AN2688 Datasheet - Page 16

no-image

AN2688

Manufacturer Part Number
AN2688
Description
Implementing a 10-Bit Sigma-Delta Analog-to-Digital Converter Using the HC9S08Rx MCU Family Analog Comparator
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2688/D
;DEFAULT_RAM
;*******************************************************************************************
;* Constants and Variables for this file
;*******************************************************************************************
;DEFAULT_ROM
;*******************************************************************************************
;* Code Section
;*******************************************************************************************
Entry:
Reset:
WaitState:
16
org
org
ldhx
txs
lda
sta
lda
sta
mov
clr
clr
mov
mov
bset
bset
bclr
bclr
bset
bset
bclr
bset
bclr
wait
bra
include 'SigmaDelta.equ'
RamStart
FlashStart
#RamEndAddress+1
#setSIMOPT
SIMOPT
#setPMCSC1
PMCSC1
#setACMPSC,ACMPSC
TPMCNTH
TPMCNTL
#setTPMMODH,TPMMODH
#setTPMMODL,TPMMODL
TOIE,TPMSC
CLKSA,TPMSC
PTA1,PTA
PTA2,PTA
DDRA1,DDRA
DDRA2,DDRA
PTE0,PTE
DDRE0,DDRE
PTE0,PTE
WaitState
SECTION SHORT
SECTION
Implementing a 10-Bit Sigma-Delta Analog-to-Digital Converter
Using the HC9S08Rx MCU Family Analog Comparator
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
; H:X = #RamEndAddress + 1
; Stack Pointer (SP) = #RamEndAddress
;configure SIMOPT register
;configure PMCSC1 register
;configure analog comparator
;reset TPM counter
;a Timer interrupt will be generated every TPMMOD
;BUSCLKs (62 -> ~128kHz)
;Timer Overflow Interrupt Enable = 1
;Clock Source Select = BUSCLK
;clear bit 1 of port PTA
;clear bit 2 of port PTA
;define bit 1 of port PTA as output
;define bit 2 of port PTA as output
;clear bit 0 of port PTE
;define bit 0 of port PTE as output
;clear bit 0 of port PTE
;enable interrupts and halt
;jump to WaitState
MOTOROLA

Related parts for AN2688