CYT2B73CAE定时器无法进入终端

公告

大中华汽车电子生态圈社区并入开发者社区- 更多资讯点击此

Tip / 登入 to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
醒时笑
Level 3
Level 3
5 questions asked First like received 10 sign-ins

在CYT2B73CAE单片机中使用systick的demo,无法进入systick_handler中。请问这是什么原因?

0 点赞
1 解答
Janine_Y
Moderator
Moderator
Moderator
50 solutions authored 10 likes received 25 solutions authored

你可以把for循环里的delay函数注释掉,或者换一个用其他时钟的delay函数,例如Cy_SysLib_DelayUs函数。

在原帖中查看解决方案

0 点赞
14 回复数
Janine_Y
Moderator
Moderator
Moderator
50 solutions authored 10 likes received 25 solutions authored

您好,

我使用了SDL7.6里的systick的demo,是可以正常运行,正常进入systick_handler的

Janine_0-1668653233888.png

请问您是否有改过相关代码。

Best Regards,

Janine

0 点赞
醒时笑
Level 3
Level 3
5 questions asked First like received 10 sign-ins

demo中使用的是CYT2B78,我改成了CYT2B73,LED引脚改成了现在使用的。通过仿真发现无法进入中断。请问你是通过什么进行仿真的?

0 点赞
Janine_Y
Moderator
Moderator
Moderator
50 solutions authored 10 likes received 25 solutions authored

通过IAR+I-jet进行的debug。可以看看版本是否有选对?以及CM0的程序有先烧进去么?

0 点赞
醒时笑
Level 3
Level 3
5 questions asked First like received 10 sign-ins

版本选择的是CYT2B73CAE,CM0已经下载进去。在CM4中无法进入中断,但是在for(;;)中可以正常运行。

0 点赞
Janine_Y
Moderator
Moderator
Moderator
50 solutions authored 10 likes received 25 solutions authored

你有改过相关时钟配置么,debug时SystemCoreClock显示是多少呢?

0 点赞
醒时笑
Level 3
Level 3
5 questions asked First like received 10 sign-ins

没有修改过时钟。都是demo中的默认设置。

0 点赞
Janine_Y
Moderator
Moderator
Moderator
50 solutions authored 10 likes received 25 solutions authored

完全使用SDL的例程不改代码的情况下也进不了systick_handler么?可以watch一下SystemCoreClock的值么?

0 点赞
Janine_Y
Moderator
Moderator
Moderator
50 solutions authored 10 likes received 25 solutions authored

设一个断点,然后监视一下SystemCoreClock的值

0 点赞
lock attach
Attachments are accessible only for community members.
醒时笑
Level 3
Level 3
5 questions asked First like received 10 sign-ins

请问能测试一下这个代码吗?

0 点赞
Janine_Y
Moderator
Moderator
Moderator
50 solutions authored 10 likes received 25 solutions authored

你可以把for循环里的delay函数注释掉,或者换一个用其他时钟的delay函数,例如Cy_SysLib_DelayUs函数。

0 点赞
醒时笑
Level 3
Level 3
5 questions asked First like received 10 sign-ins

请问为什么在for循环中使用Cy_SysTick_DelayInUs就无法进入中断呢?

0 点赞
Janine_Y
Moderator
Moderator
Moderator
50 solutions authored 10 likes received 25 solutions authored

我个人认为你要实现的中断功能,并不需要在for循环里加延时。让systick既用于中断又用于延时,定时器冲突了。

0 点赞
醒时笑
Level 3
Level 3
5 questions asked First like received 10 sign-ins

如果使用Cy_SysLib_DelayUs这个延时,需要配置什么吗?

0 点赞
Janine_Y
Moderator
Moderator
Moderator
50 solutions authored 10 likes received 25 solutions authored

你好,你可以在SDL的docs文件夹下找到你想要的函数说明。

Janine_0-1668741844150.png

 

0 点赞