新闻中心

EEPW首页 > 嵌入式系统 > 设计应用 > TMS320F206的中断技术及其实现

TMS320F206的中断技术及其实现

作者:时间:2009-01-02来源:网络收藏

  中断INT2/3服务程序(intp2)流程图如图5所示。

  中断INT2/3服务程序(intp2)如下:

Intp2: setc intm ;进入INT2,INT3中断服务程序。
…… ;根据控制字判断是进入频率测试子程序还是进入相位测试子程序
bond intp23,tc
b intp 21
intp23: in 60h,0fffech ;读控制字ICR
bit 60h,13
sst #1h,62h
bit 62h,4 ;判断是INT2还是INT3
  
b intp31
intp22:splk #0002h,60h ;INT2服务程序
out 60h,0ffech ;开INT3中断
splk #0c29h,63h
out 63h,0fff8h ;启动定时器
splk #0002h,ifr ;清INT2/INT3的标志位
clrc intm ;开中断
ret
intp31:setc intm ;INT3服务程序
splk #0412h,64h
out 64h,0fff8h ;停止定时器
splk #0002h,ifr ;清INT2/INT3的标志位
clrc intm
ret
in 65h,0fffah ;读定时器的时间
…… ;计算相位
intp21:setc intm ;判断中断次数,第一次开
…… ;定时器,第二次关定时器
bchd stoptimerl,ntc
out 63h,0fff8h ;启动定时器
splk #0002h,ifr ;清除INT2/3标志
clrc intm ;开中断
ret
stoptimer1:splk #0412h,64h
out 64h,0fff8h ;关定时器
…… ;计算频率
b $ ;等待

  定时器中断服务程序(timer)流程图如图6所示。TMS320F206的中断技术及其实现

timer: lacl 73h ;定时器中断服务程序
…… ;据控制字判断是进入频率测试子程序还是进入相位测试子程序。
cmpr 0
bcnd timer2,tc
b timer1
timer1:lacl 69h ;频率定时器服务子程序
add #1h
sacl 69h
splk #4h,ifr ;清除定时器标志
clrc intm
ret
timer2:lacl 69h ;相位定时器服务子程序
add #1h
sacl 69h
splk #4h,ifr ;清定时器的标志位
clrc intm


上一页 1 2 3 4 下一页

关键词: DSP公司 dsp开发板 dsp教程 工业控制 网络通信 多媒体处理 数字信号处理 DSP

评论


相关推荐

技术专区

关闭