![](http://datasheet.mmic.net.cn/370000/TAS3001EVM_datasheet_16735494/TAS3001EVM_22.png)
5-2
;*********************** I2C register
Tbl_Pntr
.EQU
Strng_Pntr
.EQU
Mask
.EQU
;******************** DCO calibration definitions
Count1
.set
R7
Count2
.set
R8
Delta
.set
150
;******************** Speaker Equal. board definitions
OSC_OE
.set
080h
;P1.7 functions as oscill enable (active high)
RST
.set
001h
;P1.0 functions as MIC board reset (active low).
;
”
RESET
”
already used elsewhere in this program.
EXP
.set
008h
;P2.3 functions as expand (active high)
;*********************
Key switch/LED/ pins & registers
SW1
.equ
08h
;P1.3 equates to switch 1 (active low)
SW2
.equ
04h
;P1.2
SW3
.equ
02h
;P1.1
”
SW4
.equ
01h
;P2.0
”
SW5
.equ
02h
;P2.1
”
SW6
.equ
04h
;P2.2
”
SW1_3IF
.equ
023h
;SW1-3 int flags = P1 int flag
;register (P1IFG)
SW4_6IF
.equ
02Bh
;SW4-6 int flags = P2 int flag register (P2IFG)
SW1_3IE
.equ
025h
;SW1-3 int enables = P1 int enable register (P1IE)
SW4_6IE
.equ
02Dh
;SW4-6 int enables = P2 int enable register (P1IE)
SW1_3IN
.equ
020h
;SW1-3 inputs = P1 input register (P1IN)
SW4_6IN
.equ
028h
;SW4-6 inputs = P2 input register (P1IN)
LED
.equ
020h
;P2.5 equates to LED pin (active low)
LED_OUT
.equ
029h
;LED data out = P2 output register (P2OUT)
Vol_Pntr
.equ
R9
;pointer for volume setting = data table position
Bass_Pntr
.equ
R10
;pointer for bass setting = data table position
Trbl_Pntr
.equ
R11
;pointer for treble setting = data table position
MUTE
.equ
R12
;current mute setting. 0=mute off, 1=mute on.
Trbl_Setpnt
.equ
R13
;used to track last manual setting of treble
;needed since treble reset to original with 2 EQs
Bass_Setpnt
.equ
R14
;used to track last manual setting of bass
R4
R5
R6
;pointer for position in total data table
;pointer for position in current byte string
;used to test level of bits in data byte
;Counter for SW DCO calibration
;Counter for SW DCO calibration
;SMCLK = 1,228,800 Hz
”
”
”
”
”
”
2
”
3
”
4
”
5
”
6
”
;needed since bass reset to original with 2 EQs
;****************************************************************************
;
Main Program
;****************************************************************************
.sect
”
MAIN
”
,Main
RESET MOV
#Stack,SP
;initialize stackpointer
CALL #Setup
;call device setup routine
CALL
#Set_DCO
;sw calibration of DCO
Begin MOV
#1669,Tbl_Pntr
#Loop
BIC.b #EXP,&P2OUT ;set shutdown pin low after I2C code sent
;interrupts enabled after setup complete
#LPM3,SR
;go into low pwr mode 3 after DS part is set up
LPM
;back to low power mode after interrupt serviced
;set pointer to start of set up data
;call routine to send I2C
CALL
Finish
EINT
BIS
JMP
LPM