共2条
1/1 1 跳转至页

问
调试2407A过程中的时候:
只要一打开Timer1的初始化程序,2407A运行时不停地复位,也就是不断地切换到_c_int0入口。但如果不用定时器1(不调用以下子函数gp_init()),一切正常。这是什么原因?请高手出招。谢谢。
Timer1的初始化程序:
void gp_init(void)
{
*EVAIMRA = (*EVAIMRA) | 0x0080;
*EVAIFRA = (*EVAIFRA) & 0x0080;
*GPTCONA = 0x0000;
*T1PR = T1MS; /* 周期寄存器=40000 */
*T1CNT = 0; /* 计数初值=0 */
*T1CON = 0x1040; /* 启动计数器0x1040 */
}
//*****************************************************
// 这里是中断入口子程序
.ref _gptime1,_c_int0,_commint;
.ref _c_int0;
.ref _PHANTOM,_NMI;
.sect ".vectors"
RSVECT B _c_int0 ; Reset Vector
INT1 B PHANTOM ; Interrupt Level 1
INT2 B _gptime1; Interrupt Level 2
INT3 B PHANTOM ; Interrupt Level 3
INT4 B PHANTOM ; Interrupt Level 4
INT5 B _commint ; Interrupt Level 5
INT6 B PHANTOM ; Interrupt Level 6
RESERVED B PHANTOM ; Reserved
SW_INT8 B PHANTOM ; Software Interrupt
SW_INT9 B PHANTOM ; Software Interrupt
SW_INT10 B PHANTOM ; Software Interrupt
SW_INT11 B PHANTOM ; Software Interrupt
SW_INT12 B PHANTOM ; Software Interrupt
SW_INT13 B PHANTOM ; Software Interrupt
SW_INT14 B PHANTOM ; Software Interrupt
SW_INT15 B PHANTOM ; Software Interrupt
SW_INT16 B PHANTOM ; Software Interrupt
TRAP B PHANTOM ; Trap vector
NMI B NMI ; Nonmaskable Interrupt
EMU_TRAP B PHANTOM ; Emulator Trap
SW_INT20 B PHANTOM ; Software Interrupt
SW_INT21 B PHANTOM ; Software Interrupt
SW_INT22 B PHANTOM ; Software Interrupt
SW_INT23 B PHANTOM ; Software Interrupt
SW_INT24 B PHANTOM ; Software Interrupt
SW_INT25 B PHANTOM ; Software Interrupt
SW_INT26 B PHANTOM ; Software Interrupt
SW_INT27 B PHANTOM ; Software Interrupt
SW_INT28 B PHANTOM ; Software Interrupt
SW_INT29 B PHANTOM ; Software Interrupt
SW_INT30 B PHANTOM ; Software Interrupt
SW_INT31 B PHANTOM ; Software Interrupt
GISR1
GISR2
GISR3
GISR4
GISR5
GISR6
PHANTOM
答 1: 你的看门狗是否开启了如果开启了,由于你启动了定时器,这样导致你清狗的时间延长了。 答 2: 我已经关闭了,看看以下代码正确否main()
{
nCount=0;
asm(" setc INTM"); /* 关中断,进行关键设置时不允许发生中断,以免干扰 */
*WDCR=0x6f;
*WDKEY=0x5555;
*WDKEY=0xaaaa; /* 关闭看门狗中断 */
*SCSR1=0x83fe; /* 0x83fe:10M*2 = 20M ;设置DSP运行频率40M :0x81fe*/
只要一打开Timer1的初始化程序,2407A运行时不停地复位,也就是不断地切换到_c_int0入口。但如果不用定时器1(不调用以下子函数gp_init()),一切正常。这是什么原因?请高手出招。谢谢。
Timer1的初始化程序:
void gp_init(void)
{
*EVAIMRA = (*EVAIMRA) | 0x0080;
*EVAIFRA = (*EVAIFRA) & 0x0080;
*GPTCONA = 0x0000;
*T1PR = T1MS; /* 周期寄存器=40000 */
*T1CNT = 0; /* 计数初值=0 */
*T1CON = 0x1040; /* 启动计数器0x1040 */
}
//*****************************************************
// 这里是中断入口子程序
.ref _gptime1,_c_int0,_commint;
.ref _c_int0;
.ref _PHANTOM,_NMI;
.sect ".vectors"
RSVECT B _c_int0 ; Reset Vector
INT1 B PHANTOM ; Interrupt Level 1
INT2 B _gptime1; Interrupt Level 2
INT3 B PHANTOM ; Interrupt Level 3
INT4 B PHANTOM ; Interrupt Level 4
INT5 B _commint ; Interrupt Level 5
INT6 B PHANTOM ; Interrupt Level 6
RESERVED B PHANTOM ; Reserved
SW_INT8 B PHANTOM ; Software Interrupt
SW_INT9 B PHANTOM ; Software Interrupt
SW_INT10 B PHANTOM ; Software Interrupt
SW_INT11 B PHANTOM ; Software Interrupt
SW_INT12 B PHANTOM ; Software Interrupt
SW_INT13 B PHANTOM ; Software Interrupt
SW_INT14 B PHANTOM ; Software Interrupt
SW_INT15 B PHANTOM ; Software Interrupt
SW_INT16 B PHANTOM ; Software Interrupt
TRAP B PHANTOM ; Trap vector
NMI B NMI ; Nonmaskable Interrupt
EMU_TRAP B PHANTOM ; Emulator Trap
SW_INT20 B PHANTOM ; Software Interrupt
SW_INT21 B PHANTOM ; Software Interrupt
SW_INT22 B PHANTOM ; Software Interrupt
SW_INT23 B PHANTOM ; Software Interrupt
SW_INT24 B PHANTOM ; Software Interrupt
SW_INT25 B PHANTOM ; Software Interrupt
SW_INT26 B PHANTOM ; Software Interrupt
SW_INT27 B PHANTOM ; Software Interrupt
SW_INT28 B PHANTOM ; Software Interrupt
SW_INT29 B PHANTOM ; Software Interrupt
SW_INT30 B PHANTOM ; Software Interrupt
SW_INT31 B PHANTOM ; Software Interrupt
GISR1
GISR2
GISR3
GISR4
GISR5
GISR6
PHANTOM
答 1: 你的看门狗是否开启了如果开启了,由于你启动了定时器,这样导致你清狗的时间延长了。 答 2: 我已经关闭了,看看以下代码正确否main()
{
nCount=0;
asm(" setc INTM"); /* 关中断,进行关键设置时不允许发生中断,以免干扰 */
*WDCR=0x6f;
*WDKEY=0x5555;
*WDKEY=0xaaaa; /* 关闭看门狗中断 */
*SCSR1=0x83fe; /* 0x83fe:10M*2 = 20M ;设置DSP运行频率40M :0x81fe*/
共2条
1/1 1 跳转至页
回复
有奖活动 | |
---|---|
【EEPW电子工程师创研计划】技术变现通道已开启~ | |
发原创文章 【每月瓜分千元赏金 凭实力攒钱买好礼~】 | |
【EEPW在线】E起听工程师的声音! | |
“我踩过的那些坑”主题活动——第001期 | |
高校联络员开始招募啦!有惊喜!! | |
【工程师专属福利】每天30秒,积分轻松拿!EEPW宠粉打卡计划启动! | |
送您一块开发板,2025年“我要开发板活动”又开始了! | |
打赏了!打赏了!打赏了! |
打赏帖 | |
---|---|
【我踩过的那些坑】STM32的硬件通讯调试过程的“坑”被打赏50分 | |
【我踩过的那些坑】晶振使用的问题被打赏100分 | |
【我踩过的那些坑】电感选型错误导致的处理器连接不上被打赏50分 | |
【我踩过的那些坑】工作那些年踩过的记忆深刻的坑被打赏10分 | |
【我踩过的那些坑】DRC使用位置错误导致的问题被打赏100分 | |
我踩过的那些坑之混合OTL功放与落地音箱被打赏50分 | |
汽车电子中巡航控制系统的使用被打赏10分 | |
【我踩过的那些坑】工作那些年踩过的记忆深刻的坑被打赏100分 | |
分享汽车电子中巡航控制系统知识被打赏10分 | |
分享安全气囊系统的检修注意事项被打赏10分 |