GET ..\ASMFILE\LPC1700Cfg.s ;包含CPU特殊寄存器定义文件
GET ..\ASMFILE\LPC1700PinCfg.s ;包含芯片管脚功能定义文件
GET ..\ASMFILE\TargetCfg.s ;包含目标板常数内存定义文件
PRESERVE8
THUMB
;Vector Table Mapped to Address 0 at Ret复位后映射在地址0x00000000处的向量表
AREA RESET, CODE, READONLY
初二英语练习册答案
DCD Stack_Top ; 0: Top of Stack 堆栈顶端定义
DCD START ; 1: Ret Handler 复位入口地址
DCD NMI_Handler ; 2: NMI Handler 不可屏蔽中断
DCD HardFault_Handler ; 3: Hard Fault Handler 硬件失败中断
DCD MemManage_Handler ; 4: MPU Fault Handler 存储器管理失败
DCD BusFault_Handler ; 5: Bus Fault Handler 总线失败
DCD UsageFault_Handler ; 6: Usage Fault Handler 用法失败
DCD 0 ; 7: Rerved 保留[自生成校验和值]
DCD 0 ; 8: Rerved 保留
DCD 0 ; 9: Rerved 保留
DCD 0 ;10: Rerved 保留
DCD SVC_Handler ;11: SVCall Handler 调用SVC异常中断
DCD DebugMon_Handler ;12: Debug Monitor Handler 调试监视器请求中断
DCD 0 ;13: Rerved 保留
DCD PendSV_Handler ;14: PendSV Handler 系统设备挂起请求
DCD SysTick_Handler ;15: SysTick Handler 系统节拍定时器
;External Interrupts 外部中断
DCD WDT_IRQHandler ;16: Watchdog Timer 看门狗定时器中断
DCD TIMER0_IRQHandler ;17: Timer0 定时/计数器0中断
DCD TIMER1_IRQHandler ;18: Timer1 定时/计数器1中断
DCD TIMER2_IRQHandler ;19: Timer2 定时/计数器2中断
DCD TIMER3_IRQHandler ;20: Timer3 定时/计数器3中断
DCD UART0_IRQHandler ;21: UART0 串口0中断
DCD UART1_IRQHandler ;22: UART1 串口1中断
DCD UART2_IRQHandler ;23: UART2 串口2中断
DCD UART3_IRQHandler ;24: UART3 串口3中断
aht
DCD PWM1_IRQHandler
;25: PWM1 PWM1中断
DCD I2C0_IRQHandler ;26: I2C0 I2C0中断
DCD I2C1_IRQHandler ;27: I2C1 I2C1中断
DCD I2C2_IRQHandler ;28: I2C2 I2C2中断
DCD SPI_IRQHandler ;29: SPI SPI中断
DCD SSP0_IRQHandler ;30: SSP0 SSP0中断
DCD SSP1_IRQHandler ;31: SSP1 SSP1中断
DCD PLL0_IRQHandler ;32: PLL0 Lock (Main PLL) PLL0锁定中断
DCD RTC_IRQHandler ;33: Real Time Clock 实时时钟中断
DCD EINT0_IRQHandler ;34: External Interrupt 0 外部中断0
DCD EINT1_IRQHandler ;35: External Interrupt 1 外部中断1
DCD EINT2_IRQHandler ;36: External Interrupt 2 外部中断2
DCD EINT3_IRQHandler ;37: External Interrupt 3 外部中断3
DCD ADC_IRQHandler ;38: A/D Converter A/D转换器中断
DCD BOD_IRQHandler ;39: Brown-Out Detect 掉电检测中断
DCD USB_IRQHandler ;40: USB USB中断
DCD CAN_IRQHandler ;41: CAN CAN总线中断
DCD DMA_IRQHandler ;42: General Purpo DMA GPDMA中断
通力合作DCD I2S_IRQHandler ;43: I2S I2S中断
DCD ENET_IRQHandler ;44: Ethernet 以太网中断
DCD RIT_IRQHandler ;45: Repetitive Interrupt Timer 重复中断定时器
DCD MCPWM_IRQHandler ;46: Motor Control PWM 电机控制PWM
DCD QEI_IRQHandler ;47: Quadrature Encoder Interface正交编码器
DCD PLL1_IRQHandler ;48: PLL1 Lock (USB PLL) PLL1锁定中断
DCD USBActivity_IRQHandler ;49: USB Activity interrupt to wakeup USB活动deadlock
DCD CANActivity_IRQHandler ;50: CAN Activity interrupt to wakeup CAN活动
;Address 0x0000 02FC ISP-Flash在地址0x0000 02FC处定义ISP访问片内Flash的限制等级[调试-0,商用-2]
AREA |.ARM.__at_0x02FC|, CODE, READONLY
DCD 0xFFFFFFFF ;调试CRP_LEVEL=0 0xFFFFFFFF
;商用CRP_LEVEL=2 0x87654321
AREA |.itext|, CODE, READONLY ;异常中断代码段
NMI_Handler ; 2: NMI Handler 不可屏蔽中断
英语培训教材NOP ;P2_10未配置为NMI输入不会引起该中断
LDR R1, =AIRCR ;应用程序中断及复位控制寄存器[0xFA050000]
LDR R0, =0x05FA0004 ;SYSRESETREQ=1请求芯片的控制逻辑产生一次复位
STR R0, [R1]
deadloop
B deadloop ;死循环,等待芯片复位
BX lr ;中断返回
ALIGN ;代码存储对齐
HardFault_Handler ; 3: Hard Fault Handler 硬件失败中断
MemManage_Handler ; 4: MPU Fault Handler 存储器管理失败
BusFault_Handler ; 5: Bus Fault Handler 总线失败
UsageFault_Handler ; 6: Usage Fault Handler 用法失败
MOVW R1, #Stacked_NUM ;fault计数值
MOVT R1, #MEMADDG ;内存单元地址高16位
LDR R0, [R1]
ADD R0, R0, #1 ;fault计数值+1
STR R0, [R1]
TST LR, #0x04
ITE EQ
MRSEQ R2, MSP
MRSNE R2, PSP
STR R2, [R1, #0x04] ;Stacked_MSP=fault压栈MSP值
LDR R0, [R2, #0x00]
STR R0, [R1, #0x08] ;Stacked_R0=fault压栈R0值
LDR R0, [R2, #0x04]
STR R0, [R1, #0x0C] ;Stacked_R1=fault压栈R1值
LDR R0, [R2, #0x08]
STR R0, [R1, #0x10] ;Stacked_R2=fault压栈R2值
LDR R0, [R2, #0x0C]
STR R0, [R1, #0x14] ;Stacked_R3=fault压栈R3值
LDR R0, [R2, #0x10]
STR R0, [R1, #0x18] ;Stacked_R12=fault压栈R12值
LDR R0, [R2, #0x14]
STR R0, [R1, #0x1C] ;Stacked_LR=fault压栈LR值
LDR R0, [R2, #0x18]
STR R0, [R1, #0x20] ;Stacked_PC=fault压栈PC值
LDR R0, [R2, #0x1C]
STR R0, [R1, #0x24] ;Stacked_PSR=fault压栈PSR值
gmental
LDR R2, =MMAR ;存储器管理失败状态寄存器-R/W[0]
LDR R0, [R2]
STR R0, [R1, #0x28] ;Stacked_MMAR=fault压栈MMAR值
LDR R2, =BFAR ;总线失败地址寄存器-R/W
LDR R0, [R2]
STR R0, [R1, #0x2C] ;Stacked_BFAR=fault压栈BFAR值
LDR R2, =CFSR ;可配置失败状态寄存器-R/W[0]
LDR R0, [R2]
STR R0, [R1, #0x30] ;Stacked_CFSR=fault压栈CFSR值
LDR R2, =HFSR ;硬
件失败状态寄存器-R/W[0]
LDR R0, [R2]
STR R0, [R1, #0x34] ;Stacked_HFSR=fault压栈HFSR值
LDR R2, =DFSR ;调试失败状态寄存器-R/W[0]
LDR R0, [R2]
STR R0, [R1, #0x38] ;Stacked_DFSR=fault压栈DFSR值
LDR R2, =AFSR ;辅助失败寄存器-R/W
LDR R0, [R2]
STR R0, [R1, #0x3C] ;Stacked_AFSR=fault压栈AFSR值
NOP
LDR R1, =AIRCR ;应用程序中断及复位控制寄存器[0xFA050000]
LDR R0, =0x05FA0002 ;VECTCLRACTIVE=1清零所有异常的活动状态信息
STR R0, [R1]
BX lr ;中断返回
ALIGN ;代码存储对齐
SVC_Handler ;11: SVCall Handler 调用SVC异常中断
DebugMon_Handler ;12: Debug Monitor Handler 调试监视器请求中断
PendSV_Handler ;14: PendSV Handler 系统设备挂起请求
SysTick_Handler ;15: SysTick Handler 系统节拍定时器
BX lr ;中断返回
ALIGN ;代码存储对齐
;External Interrupts外部中断
WDT_IRQHandler ;16: Watchdog Timer 看门狗定时器中断
BX lr ;中断返回
TIMER0_IRQHandler ;17: Timer0 定时/计数器0中断
LDR R1, =T0IR ;T0中断寄存器-R/W[0x00]
MOV R0, #0x01 ;复位(清零)中断标志
STR R0, [R1]
NOP
MOVW R1, #Ba_timer0 ;基础定时计数器字节0[32:500us+1循环计数]
MOVT R1, #MEMADDG ;内存单元地址高16位
LDR R0, [R1]
ADD R0, R0, #1 ;500us+1
STR R0, [R1]
NOP
适合圆脸的短发型MOVW R1, #BtimeCh ;基础定时计数器改变
MOVT R1, #MEMADDG ;内存单元地址高16位
MOV R0, #0x01
STRB R0, [R1]
BX lr ;中断返回
TIMER1_IRQHandler ;18: Timer1 定时/计数器1中断
TIMER2_IRQHandler ;19: Timer2 定时/计数器2中断
TIMER3_IRQHandler ;20: Timer3 定时/计数器3中断
BX lr ;中断返回
UART0_IRQHandler ;21: UART0 串口0中断[数据接收]
LDR R1, =U0IIR ;U0中断ID寄存器-R0[0x01]
LDR R0, [R1]
TST R0, #0x01 ;bit0=0/1=有中断挂起/无中断
BNE UART0_IRQ9 ;不相等/非0[Z==0]转移
AND R0, R0, #0x0E
CMP R0, #0x04 ;接收数据可用[8字符]
BNE UART0_IRQ5 ;不相等/非0[Z==0]转移
MOV R3, #0x08 ;待收8字符数据
MOVW R1, #UART0_RecPh ;Uart0接收数据头指针[待处理]
MOVT R1, #MEMADDG ;内存单元地址高16位
LDRB R2, [R1]
UART0_IRQ1
LDR R1, =U0RBR ;U0接收器缓冲寄存器-RO
LDR R0, [R1]
MOVW R1, #UART0_RecBuff ;Uart0接收数据缓冲区[256单元]
MOVT R1, #MEMADDG ;内存单元地址高16位
STRB R0, [R1, R2]
ADD R2, R2, #1
AND R2, R2, #0xFF
SUBS R3, R3, #1
BNE UART0_IRQ1 ;不相等/非0[Z==0]转移
MOVW R1, #UART0_RecPh ;Uart0接收数据头指针[待处理]
MOVT R1, #MEMADDG ;内存单元地址高16位
STRB R2, [R1]
MOVW R1, #UART0_Stat ;Uart0状态字节
MOVT R1, #MEMADDG ;内存单元地址高16位
MOV R0, #0x01 ;已收到新数据
STRB R0, [R1]
emingly>lobbyistB UART0_IRQ9
UART0_IRQ5
CMP R0, #0x0C ;字符超时指示
BNE UART0_IRQ9 ;不相等/非0[Z==0]转移
UART0_IRQ6global warming
LDR R1, =U0LSR ;U0线状态寄存器-R0[0x60]
LDR R0, [R1]
TST R0, #0x01 ;bit0=0/1=U0RBR空/有有效数据
BEQ UART0_IRQ9 ;相等/为0[Z==1]转移
MOVW R1, #UART0_RecPh ;Uart0接收数据头指针[待处理]
MOVT R1, #MEMADDG ;内存单元地址高16位
LDRB R2, [R1]
LDR R1, =U0RBR ;U0接收器缓冲寄存器-RO
LDR R0, [R1]
MOVW R1, #UART0_RecBuff ;Uart0接收数据缓冲区[256单元]
MOVT R1, #MEMADDG ;内存单元地址高16位
STRB R0, [R1, R2]
ADD R2, R2, #1
AND R2, R2, #0xFF