各位大侠,本人新手,学习STM8L101F3,现在遇到一个问题,就是不能进中断,请求帮忙看一下,
LD A,#64
LD PB_DDR,A
LD A,#64
LD PB_CR1,A
LD A,#00
LD PB_CR2,A
LD A,#$07
LD CLK_CKDIVR,A
;LD A,#$00
;LD CLK_PCKENR,A
;LD A,#$01
;LD CLK_CCOR,A
;初始化定时器4
LD A,#$01
LD
tiM4_CR1,A
LD A,#$00
LD TIM4_CR2,A
LD A,#$00
LD TIM4_SMCR,A
LD A,#$01
LD TIM4_IER,A
LD A,#$00
LD TIM2_EGR,A
LD A,#$07
LD TIM4_PSCR,A
LD A,#$FF
LD TIM4_ARR,A
LD A,#$FF
LD TIM4_CNTR,A
;LD A,#$01
;LD TIM2_CR1,A
RIM
infinite_loop.l
jra infinite_loop
Timer4_Update_ISR.L
LD A,#$00
LD TIM4_SR1,A
LD A,PB_ODR
XOR A,#64
LD PB_ODR,A
IRET
interrupt NonHandledInterrupt
NonHandledInterrupt.l
iret
segment 'vectit'
dc.l {$82000000+main} ; reset
dc.l {$82000000+NonHandledInterrupt} ; trap
dc.l {$82000000+NonHandledInterrupt} ; irq0
dc.l {$82000000+NonHandledInterrupt} ; irq1
dc.l {$82000000+NonHandledInterrupt} ; irq2
dc.l {$82000000+NonHandledInterrupt} ; irq3
dc.l {$82000000+NonHandledInterrupt} ; irq4
dc.l {$82000000+NonHandledInterrupt} ; irq5
dc.l {$82000000+NonHandledInterrupt} ; irq6
dc.l {$82000000+NonHandledInterrupt} ; irq7
dc.l {$82000000+NonHandledInterrupt} ; irq8
dc.l {$82000000+NonHandledInterrupt} ; irq9
dc.l {$82000000+NonHandledInterrupt} ; irq10
dc.l {$82000000+NonHandledInterrupt} ; irq11
dc.l {$82000000+NonHandledInterrupt} ; irq12
dc.l {$82000000+NonHandledInterrupt} ; irq13
dc.l {$82000000+NonHandledInterrupt} ; irq14
dc.l {$82000000+NonHandledInterrupt} ; irq15
dc.l {$82000000+NonHandledInterrupt} ; irq16
dc.l {$82000000+NonHandledInterrupt} ; irq17
dc.l {$82000000+NonHandledInterrupt} ; irq18
dc.l {$82000000+NonHandledInterrupt} ; irq19
dc.l {$82000000+NonHandledInterrupt} ; irq20
dc.l {$82000000+NonHandledInterrupt} ; irq21
dc.l {$82000000+NonHandledInterrupt} ; irq22
dc.l {$82000000+NonHandledInterrupt} ; irq23
dc.l {$82000000+NonHandledInterrupt} ; irq24
dc.l {$82000000+Timer4_Update_ISR} ; irq25
dc.l {$82000000+NonHandledInterrupt} ; irq26
dc.l {$82000000+NonHandledInterrupt} ; irq27
dc.l {$82000000+NonHandledInterrupt} ; irq28
dc.l {$82000000+NonHandledInterrupt} ; irq29
end
一周热门 更多>