flyingcowboy
驱动牛犊
驱动牛犊
  • 注册日期2002-10-23
  • 最后登录2004-03-24
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:1574回复:5

C54X外部中断的问题

楼主#
更多 发布于:2003-05-14 22:51
我在处理DSP #INT0 #INT1中断时,同样的程序,有时候就没问题,有时候就跑飞,比如从起计算机,是什么状态的不确定导致这种情况发生呢
glqgglq
驱动小牛
驱动小牛
  • 注册日期2001-04-16
  • 最后登录2008-10-28
  • 粉丝0
  • 关注0
  • 积分2分
  • 威望4点
  • 贡献值0点
  • 好评度2点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2003-05-19 17:10
估计是内存引用的问题,你最好在调试时打开softice
lyingying
驱动牛犊
驱动牛犊
  • 注册日期2003-03-20
  • 最后登录2007-09-12
  • 粉丝0
  • 关注0
  • 积分60分
  • 威望6点
  • 贡献值0点
  • 好评度6点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2003-05-21 14:50
check the following:

-- reset your dsp by debug/reset

-- check your PMST, to make sure that your you have set up your dsp correctly, pay special attention to MC/MP, ovly etc.. Also verify your reset vector, esp. the reset vector. You can set up a gel file to do the init for you

-- how did you set up your isr? The TI interrupt pragma does not work. You might have to write your own code to save the registers. If you use paged external memory, you have to save BK, BRAF/BRC too. I once run into paging problem at block rpt, and it took me half a week to find out what went wrong.


good luck
flyingcowboy
驱动牛犊
驱动牛犊
  • 注册日期2002-10-23
  • 最后登录2004-03-24
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
地板#
发布于:2003-05-22 14:46
我用C写的中断程序,在编译后看汇编程序发现已经用压栈的方式保护了一些寄存器,还需要手动保护那些寄存器,为什么访问外部存储空间就要保护BK/BRAF/BRC ?我的中断确实读取了外部的MEM。
flyingcowboy
驱动牛犊
驱动牛犊
  • 注册日期2002-10-23
  • 最后登录2004-03-24
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2003-05-22 14:55
已给分~~谢谢lyingying 大大
lyingying
驱动牛犊
驱动牛犊
  • 注册日期2003-03-20
  • 最后登录2007-09-12
  • 粉丝0
  • 关注0
  • 积分60分
  • 威望6点
  • 贡献值0点
  • 好评度6点
  • 原创分0分
  • 专家分0分
5楼#
发布于:2003-05-22 22:24
have you declared the function to be isr by pragma? TI c requires any c-function to save AR0-AR2, AR6 and AR7 (?) and some other registers, check the c-language guide. To save the enviroment, I would have an asm function as isr, save and restore the environment, and calls your c-isr.

The block rpt problems applies only to PAGED external mem. If an function set up a block repeat and is interrupted by isr, and if the isr is on a different page and runs over the end of the block repeat, the BR registers will force it to the begining of the block rpt, if you do not save and clear the block rpt registers. From then on, you loose your head.

Much more need to be done on paged external mem. You have to check the .cinit etc. to make sure that your global and static are on the right page...

Memory corruption can lead things you described too. I always use local or global, try to avoid memalloc.
游客

返回顶部