PIC PICC 的奇怪问题

2020-02-09 11:25发布

今天发现一个奇怪的问题。
使用PIC16F722  这个IC出来没多久 ,需要使用PICC 9.65的编译器。

程序用SIM仿真发现总是在中断中跑,于是我关了GIE 同时查看特殊功能寄存器,发现不可能进中断,

在中断中通过判断标准位
进了这个
if(TMR2IE&TMR2IF)// PWM TIME INT    CHANGE DUTY
      {TMR2IF=0;
       TMR2IE=0;
         CCPR2L=PWM_duty;
      }

可是这个怎么可能一直在中断中跑。

还有哪位知道Startup.as这个文件有没有必要要。怎么去掉。我非常的怀疑是它在搞鬼

同事也怀疑编译器的问题 。
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
13条回答
millwood0
2020-02-10 00:48
"后来调试发现 问题出在这里 "

this example demonstrates two things:

1) what you think is wrong may not be wrong: you were adamant about the problem being in the isr when in fact it is somewhere else. it brings to question a) your approach / thought process; and b) your credibility.
2) many times, you have to help others help you. in this case, posting your complete code would have been helpful.

"这个东西无论你以什么方式置0 都会出现问题。不操作这一位就正常了。"

maybe you should look into the datasheet to see what it does and what its default (POR/Reset) values are and see if that's consistent with what you want to do.

programming is not a trial-and-error process, unless you want to remain clueless.

一周热门 更多>