完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
尊敬的先生/女士,
如何让控制器进入睡眠模式。您能否给我信息或发送给我任何源代码链接。在这里,我使用halt()进入睡眠状态;禁用外围设备的模式,但我在想是否还有其他配置需要做。请建议我解决这个问题。 以上来自于谷歌翻译 以下为原文 Dear Sir/Madam, How to make controller goes into sleep mode. Can you please give me information or send me any source code link. Here, I am making into sleep using halt(); mode with disabling the peripherals but I'm thinking that Is there any other configuration need to do. Kindly, suggest me to solve this issue. |
|
相关推荐
1个回答
|
|
尊敬的先生/女士,
现在我完全停止了控制器。但是当它处于暂停模式时,如果触发任何GPIO外部中断意味着它会唤醒,但是当我发送CAN标识符时,它就不会被唤醒。按照暂停模式下的数据表,如果CAN_RX中断到来,它应该被唤醒。那么,在进入暂停模式之前,能否指导一下我需要为CAN配置什么初始化。在这里我添加了CAN_Config();功能。 void CAN_Config(void) { CAN_InitStatus_TypeDef status = CAN_InitStatus_Failed; / *过滤参数* / CAN_FilterNumber_TypeDef CAN_FilterNumber; FunctionalState CAN_FilterActivation; CAN_FilterMode_TypeDef CAN_FilterMode; CAN_FilterScale_TypeDef CAN_FilterScale; uint8_t CAN_FilterID1; uint8_t CAN_FilterID2; uint8_t CAN_FilterID3; uint8_t CAN_FilterID4; uint8_t CAN_FilterIDMask1; uint8_t CAN_FilterIDMask2; uint8_t CAN_FilterIDMask3; uint8_t CAN_FilterIDMask4; / * Init参数* / CAN_MasterCtrl_TypeDef CAN_MasterCtrl; CAN_Mode_TypeDef CAN_Mode; CAN_SynJumpWidth_TypeDef CAN_SynJumpWidth; CAN_BitSeg1_TypeDef CAN_BitSeg1; CAN_BitSeg2_TypeDef CAN_BitSeg2; uint8_t CAN_Prescaler; / * CAN注册init * / CAN_DeInit(); / * CAN init * / CAN_MasterCtrl = CAN_MasterCtrl_AllEnabled; // CAN环回模式JNa // CAN_Mode = CAN_Mode_LoopBack; CAN_Mode = CAN_Mode_Normal; / * CAN_SynJumpWidth = CAN_SynJumpWidth_1TimeQuantum; CAN_BitSeg1 = CAN_BitSeg1_5TimeQuantum; CAN_BitSeg2 = CAN_BitSeg2_2TimeQuantum; CAN_Prescaler = 4; * / CAN_SynJumpWidth = CAN_SynJumpWidth_1TimeQuantum; CAN_BitSeg1 = CAN_BitSeg1_8TimeQuantum; CAN_BitSeg2 = CAN_BitSeg2_7TimeQuantum; CAN_Prescaler = 8; / * 500kbit / s * / status = CAN_Init(CAN_MasterCtrl,CAN_Mode,CAN_SynJumpWidth,CAN_BitSeg1, CAN_BitSeg2,CAN_Prescaler); / * CAN过滤初始化* / CAN_FilterNumber = CAN_FilterNumber_0; CAN_FilterActivation = ENABLE; CAN_FilterMode = CAN_FilterMode_IdMask; CAN_FilterScale = CAN_FilterScale_32Bit; CAN_FilterID1 = 0; CAN_FilterID2 = 0; CAN_FilterID3 = 0; CAN_FilterID4 = 0; CAN_FilterIDMask1 = 0; CAN_FilterIDMask2 = 0; CAN_FilterIDMask3 = 0; CAN_FilterIDMask4 = 0; CAN_FilterInit(CAN_FilterNumber,CAN_FilterActivation,CAN_FilterMode, CAN_FilterScale,CAN_FilterID1,CAN_FilterID2,CAN_FilterID3, CAN_FilterID4,CAN_FilterIDMask1,CAN_FilterIDMask2, CAN_FilterIDMask3,CAN_FilterIDMask4); / *启用Fifo消息等待中断* / / *消息接收由CAN_RX ISR * /完成 CAN_ITConfig(CAN_IT_FMP,ENABLE); 在这里,我怀疑我的配置,需要改变什么配置。 以上来自于谷歌翻译 以下为原文 Dear Sir/Madam, Now I did controller into halt completely. But when it's in halt mode if any GPIO external interrupt is triggered means it wakes up, but when I will send the CAN Identifier then It's not waking up. As per data sheet in halt mode if CAN_RX interrupt comes it should wake up. So, can you please guide to me what initialization I need configure for CAN before entering into the halt mode. Here I added CAN_Config(); function. void CAN_Config(void) { CAN_InitStatus_TypeDef status = CAN_InitStatus_Failed; /* Filter Parameters */ CAN_FilterNumber_TypeDef CAN_FilterNumber; FunctionalState CAN_FilterActivation; CAN_FilterMode_TypeDef CAN_FilterMode; CAN_FilterScale_TypeDef CAN_FilterScale; uint8_t CAN_FilterID1; uint8_t CAN_FilterID2; uint8_t CAN_FilterID3; uint8_t CAN_FilterID4; uint8_t CAN_FilterIDMask1; uint8_t CAN_FilterIDMask2; uint8_t CAN_FilterIDMask3; uint8_t CAN_FilterIDMask4; /* Init Parameters*/ CAN_MasterCtrl_TypeDef CAN_MasterCtrl; CAN_Mode_TypeDef CAN_Mode; CAN_SynJumpWidth_TypeDef CAN_SynJumpWidth; CAN_BitSeg1_TypeDef CAN_BitSeg1; CAN_BitSeg2_TypeDef CAN_BitSeg2; uint8_t CAN_Prescaler; /* CAN register init */ CAN_DeInit(); /* CAN init */ CAN_MasterCtrl=CAN_MasterCtrl_AllEnabled; //CAN Loop Back Mode JNa //CAN_Mode = CAN_Mode_LoopBack; CAN_Mode = CAN_Mode_Normal; /*CAN_SynJumpWidth = CAN_SynJumpWidth_1TimeQuantum; CAN_BitSeg1 = CAN_BitSeg1_5TimeQuantum; CAN_BitSeg2 = CAN_BitSeg2_2TimeQuantum; CAN_Prescaler = 4;*/ CAN_SynJumpWidth = CAN_SynJumpWidth_1TimeQuantum; CAN_BitSeg1 = CAN_BitSeg1_8TimeQuantum; CAN_BitSeg2 = CAN_BitSeg2_7TimeQuantum; CAN_Prescaler = 8; /* 500kbit/s */ status = CAN_Init(CAN_MasterCtrl, CAN_Mode, CAN_SynJumpWidth, CAN_BitSeg1, CAN_BitSeg2, CAN_Prescaler); /* CAN filter init */ CAN_FilterNumber = CAN_FilterNumber_0; CAN_FilterActivation = ENABLE; CAN_FilterMode = CAN_FilterMode_IdMask; CAN_FilterScale = CAN_FilterScale_32Bit; CAN_FilterID1=0; CAN_FilterID2=0; CAN_FilterID3=0; CAN_FilterID4=0; CAN_FilterIDMask1=0; CAN_FilterIDMask2=0; CAN_FilterIDMask3=0; CAN_FilterIDMask4=0; CAN_FilterInit(CAN_FilterNumber, CAN_FilterActivation, CAN_FilterMode, CAN_FilterScale,CAN_FilterID1, CAN_FilterID2, CAN_FilterID3, CAN_FilterID4,CAN_FilterIDMask1, CAN_FilterIDMask2, CAN_FilterIDMask3, CAN_FilterIDMask4); /* Enable Fifo message pending interrupt*/ /* Message reception is done by CAN_RX ISR*/ CAN_ITConfig(CAN_IT_FMP, ENABLE); }Here, I am suspecting about my configuration, what configuration need to be change. |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2648 浏览 1 评论
3211 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1785 浏览 1 评论
3614 浏览 6 评论
5994 浏览 21 评论
942浏览 4评论
1318浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
588浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1305浏览 3评论
1365浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-27 02:11 , Processed in 1.252125 second(s), Total 77, Slave 60 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号