📄 boot.lis
字号:
0000 ; signature for the debugger and ICE.
0000 ; !!! DO NOT CHANGE THIS CODE !!!
0000 ;
0000 ; ARGUMENTS:
0000 ; BYTE bOperation - specified supervisory operation - defined operations
0000 ; are: FLASH_WRITE, FLASH_ERASE, FLASH_READ, TABLE_READ,
0000 ; FLASH_CHECKSUM, PROTECT_BLOCK
0000 ;
0000 ; RETURNS:
0000 ; none.
0000 ;
0000 ; SIDE EFFECTS:
0000 ; A and X registers are destroyed
0000 ;
0000 ; PROCEDURE:
0000 ; 1) specify a 3 byte stack frame. Save in [KEYSP]
0000 ; 2) insert the flash Supervisory key in [KEY1]
0000 ; 3) store function code in A
0000 ; 4) call the supervisory code
0000 ;-----------------------------------------------------------------------------
0000 macro SSC_Action
0000 mov X, SP ; copy SP into X
0000 mov A, X ; mov to A
0000 add A, 3 ; create 3 byte stack frame
0000 mov [bSSC_KEYSP], A ; save stack frame for supervisory code
0000 mov [bSSC_KEY1], OPER_KEY ; load the supervisory code for supervisory operations
0000 mov A, @0 ; load A with specific Flash operation
0000 SSC ; SSC call the supervisory code
0001 C_LANGUAGE_SUPPORT: equ 1 ;Set to 0 to optimize for ASM only
0000
0000 ;-----------------------------------------------------------------------------
0000 ; The following equate is required for proper operation. Reseting its value
0000 ; is discouraged. WAIT_FOR_32K is effective only if the crystal oscillator is
0000 ; selected. If the designer chooses to not wait then the ECO and PLL_Lock
0000 ; processes must take place within user code. See the family data sheet for
0000 ; the requirements of starting the ECO and PLL lock mode.
0000 ;-----------------------------------------------------------------------------
0001 WAIT_FOR_32K: equ 1 ; Wait for Crystal to start before allowing main()
0000
0000 ;-----------------------------------------------------------------------------
0000 ; Export Declarations
0000 ;-----------------------------------------------------------------------------
0000
export __Start
export __Exit
export __bss_start
export __lit_start
export __idata_start
export __data_start
export __func_lit_start
export __text_start
export __usermodules_start
export __psoc_config_start
;-----------------------------------------------------------------------------
; Interrupt Vector Table
;-----------------------------------------------------------------------------
;
; Interrupt vector table entries are 4 bytes long and contain the code that
; services the interrupt (or causes it to be serviced).
;
;-----------------------------------------------------------------------------
AREA TOP(ROM,ABS,CON)
org 0 ;Reset Interrupt Vector
0000 7D0068 ljmp __Start ;First instruction executed following a Reset
0003
org 04h ;Supply Monitor Interrupt Vector
0004 30 halt ;Stop execution if power falls too low
0005
org 08h ;Analog Column 0 Interrupt Vector
// call void_handler
0008 7E reti
0009
org 0Ch ;Analog Column 1 Interrupt Vector
// call void_handler
000C 7E reti
000D
org 10h ;Analog Column 2 Interrupt Vector
// call void_handler
0010 7E reti
0011
org 14h ;Analog Column 3 Interrupt Vector
// call void_handler
0014 7E reti
0015
org 18h ;VC3 Interrupt Vector
// call void_handler
0018 7E reti
0019
org 1Ch ;GPIO Interrupt Vector
// call void_handler
001C 7E reti
001D
org 20h ;PSoC Block DBB00 Interrupt Vector
0020 7D0000 ljmp _Carrier_Timer_ISR
0023 7E reti
0024
org 24h ;PSoC Block DBB01 Interrupt Vector
// call void_handler
0024 7E reti
0025
org 28h ;PSoC Block DCB02 Interrupt Vector
0028 7D0000 ljmp _ADC_PWM16_ISR
002B 7E reti
002C
org 2Ch ;PSoC Block DCB03 Interrupt Vector
002C 7D0000 ljmp _ADC_CNT_ISR
002F 7E reti
0030
org 30h ;PSoC Block DBB10 Interrupt Vector
// call void_handler
0030 7E reti
0031
org 34h ;PSoC Block DBB11 Interrupt Vector
0034 7D0000 ljmp _Baud_ISR
0037 7E reti
0038
org 38h ;PSoC Block DCB12 Interrupt Vector
;ljmp _TX_SERIAL_ISR
0038 7D0000 ljmp _TX_SERIAL_handler
003B ;reti
003B
org 3Ch ;PSoC Block DCB13 Interrupt Vector
003C 7D0000 ljmp _SPIM_ISR
003F 7E reti
0040
0040 // 40h through 5Fh are reserved for future products
0040
org 60h ;PSoC I2C Interrupt Vector
;// call void_handler
0060 7D0000 ljmp _adc_sig_proc
0063 ;reti
0063
org 64h ;Sleep Timer Interrupt Vector
;// call void_handler
0064 7D0000 ljmp _SleepTimer_handler
0067 ;reti
0067
0067 ;-----------------------------------------------------------------------------
0067 ; Start of Execution
0067 ; CPU is operating at 3 MHz, change to 12 MHz
0067 ; IO Bank is Bank0
0067 ;-----------------------------------------------------------------------------
org 68h
0068 __Start:
IF (WATCHDOG_ENABLE)
and reg[CPU_SCR0], ~CPU_SCR0_PORS_MASK
ENDIF
IF (SELECT_32K)
or reg[CPU_SCR1],CPU_SCR1_ECO_ALLOWED ;ECO will be used in this project
ELSE
0068 41FEFB and reg[CPU_SCR1],~CPU_SCR1_ECO_ALLOWED ;Prevent ECO from being enabled
ENDIF
;-------------------------------------------------------------------------
; Set the AGND Bypass bit. This is found in the BandGap Trim register, so
; the trim value must be read from the Trim Table. That is all that is
; done for 5V operation if the AGND Bypass pin is chosen. For 3.3V
; operation the IMO Clock and BandGap trim registers always have to be set
; (they default to 5V trims).
;-------------------------------------------------------------------------
IF (SUPPLY_VOLTAGE) ; 1 means 5.0V
IF (AGND_BYPASS) ; need to set the AGNDBYP bit in BDG_TR
mov [bSSC_TABLE_TableId],1 ; Point to the Trim table
mov X, SP ; copy SP into X
mov A, X ; mov to A
add A, 3 ; create 3 byte stack frame
mov [bSSC_KEYSP], A ; save stack frame for supervisory code
mov [bSSC_KEY1], OPER_KEY ; load the supervisory code for supervisory operations
mov A, TABLE_READ ; load A with specific Flash operation
SSC ; SSC call the supervisory code
or F, FLAG_XIO_MASK
mov A,[VOLTAGE_TRIM_5V] ; Get the bandgap trim seting for 5V
or A,AGND_BYPASS_JUST ; OR in the bypass setting
mov reg[BDG_TR],A ; Update the register value
and F, ~FLAG_XIO_MASK
ENDIF
ELSE ; 0 means 3.3V
006B 55FA01 mov [bSSC_TABLE_TableId],1 ; Point to the Trim table
006E 4F mov X, SP ; copy SP into X
006F 5B mov A, X ; mov to A
0070 0103 add A, 3 ; create 3 byte stack frame
0072 53F9 mov [bSSC_KEYSP], A ; save stack frame for supervisory code
0074 55F83A mov [bSSC_KEY1], OPER_KEY ; load the supervisory code for supervisory operations
0077 5006 mov A, TABLE_READ ;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -