TMS320F206的中断技术及其实现
是进入相位测试子程序
bondintp23,tc
bintp21
intp23:in60h,0fffech;读控制字ICR
bit60h,13
sst#1h,62h
bit62h,4;判断是INT2还是INT3
bcndintp22,tc中断
bintp31
intp22:splk#0002h,60h;INT2服务程序
out60h,0ffech;开INT3中断
splk#0c29h,63h
out63h,0fff8h;启动定时器
splk#0002h,ifr;清INT2/INT3的标志位
clrcintm;开中断
ret
intp31:setcintm;INT3服务程序
splk#0412h,64h
out64h,0fff8h;停止定时器
splk#0002h,ifr;清INT2/INT3的标志位
clrcintm
ret
in65h,0fffah;读定时器的时间
……;计算相位
intp21:setcintm;判断中断次数,第一次开
……;定时器,第二次关定时器
bchdstoptimerl,ntc
out63h,0fff8h;启动定时器
splk#0002h,ifr;清除INT2/3标志
clrcintm;开中断
ret
stoptimer1:splk#0412h,64h
out64h,0fff8h;关定时器
……;计算频率
b$;等待
定时器中断服务程序(timer)流程图如图6所示。
timer:lacl73h;定时器中断服务程序
……;据控制字判断是进入频率测试子程序还是进入相位测试子程序。
cmpr0
bcndtimer2,tc
btimer1
timer1:lacl69h;频率定时器服务子程序
add#1h
sacl69h
splk#4h,ifr;清除定时器标志
clrcintm
ret
timer2
bondintp23,tc
bintp21
intp23:in60h,0fffech;读控制字ICR
bit60h,13
sst#1h,62h
bit62h,4;判断是INT2还是INT3
bcndintp22,tc中断
bintp31
intp22:splk#0002h,60h;INT2服务程序
out60h,0ffech;开INT3中断
splk#0c29h,63h
out63h,0fff8h;启动定时器
splk#0002h,ifr;清INT2/INT3的标志位
clrcintm;开中断
ret
intp31:setcintm;INT3服务程序
splk#0412h,64h
out64h,0fff8h;停止定时器
splk#0002h,ifr;清INT2/INT3的标志位
clrcintm
ret
in65h,0fffah;读定时器的时间
……;计算相位
intp21:setcintm;判断中断次数,第一次开
……;定时器,第二次关定时器
bchdstoptimerl,ntc
out63h,0fff8h;启动定时器
splk#0002h,ifr;清除INT2/3标志
clrcintm;开中断
ret
stoptimer1:splk#0412h,64h
out64h,0fff8h;关定时器
……;计算频率
b$;等待
定时器中断服务程序(timer)流程图如图6所示。
timer:lacl73h;定时器中断服务程序
……;据控制字判断是进入频率测试子程序还是进入相位测试子程序。
cmpr0
bcndtimer2,tc
btimer1
timer1:lacl69h;频率定时器服务子程序
add#1h
sacl69h
splk#4h,ifr;清除定时器标志
clrcintm
ret
timer2
- 上一篇论文: 高速数字串行加法器及其应用
- 下一篇论文: DMA结合McBSP在数据采集系统中的应用设计