完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我现在正在开发STM8L152R8和STM8L152M8 MCU的一些应用程序,这两个应用程序都是电池使用的产品。问题是,我无法使MCU消耗微安电流。
我使用了参考指南手册中描述的每种方法,包括低功耗运行模式,主动停止模式和停止模式,但我们的当前指示器显示mA顺序电流消耗,从1mA到5mA。当然我已经停止了HSI,LSI,所有计时器并且禁用了所有中断。 GPIO也被重新测试为推挽低速输出模式。我很困惑,因此我决定取出STM8L发现板并与评估板进行验证。 首先,我刚用USB线将电源送入发现板。通过切换电源模式,发现板的LCD显示出精细的电流消耗。在运行模式下约为1mA,在低功耗模式下约为7uA,在停止模式下约为1uA ......看起来很好。 但是,结果随着我的验证方法的变化而改变。我将IDD跳线切换到“关闭”模式,然后再次开始验证。当IDD跳线开关关闭时,电流测量电路应该是无能为力的,并且MCU将仅消耗功率,我预期如此。我将精密电流测量万用表(Agilent 34401A)串联在电源线(3.3V)中,并自行开始电流消耗测量。而万用表已显示30mA的电流消耗。令人难以置信,但这就是我所见过的。无论MCU电源模式如何,电流消耗均为30mA。 这是我目前的情况。现在我无法确定我们当前的消耗方法,也不能确定我们为MCU低功耗模式编写的固件代码。我想用RTC在主动停止模式下运行我们的设备,功耗问题非常重要。 请帮帮忙吗? #stm8s-discovery-power-consumption #low-power#stm8l#stm8l-low-power-halt#high-current#high-current 以上来自于谷歌翻译 以下为原文 I'm developing some applications with STM8L152R8 and STM8L152M8 MCU now, and both applications are battery-used product. The problem is that, I cannot make the MCU consume micro-ampere order current. I used every methods described in the reference guide manual, including low power run mode, active halt mode, and halt mode but our current indicator displayed mA order current consumption, from 1mA to 5mA. Of course I have stoped HSI, LSI, all timers and disabled all interrupts. GPIOs are also retested as push-pull low-slow output mode. I was confused, thus I decided to take out the STM8L discovery board and verify with that evaluation board. First, I just delivered power into the discovery board with USB cable. Through toggling the power mode, the LCD of discovery board have shown fine current consumption. About 1mA in run mode, and about 7uA in low-power mode, and below 1uA in halt mode ... it seemed fine. However, the result changed with my verification method changing. I switched the IDD jumper to 'OFF' mode, and started verification again. With IDD jumper switch off, the current-measuring circuit should be powerless and the MCU will solely consume the power, I expected so. I connected the precise current measuring multimeter (Agilent 34401A) serially in power supply line (3.3V), and started current consumption measuremnt by ourselves. And the multimeter have shown 30mA of current consumption. Unbelievable, but that's what I've seen. Regardless of MCU power mode, the current consumption was 30mA. This is my current situation. Now I cannot be certain of our current consumption method neither the firmware code we've written for MCU low power mode. I want to run our device in active-halt mode with RTC, and the power consumption matter is very important. Little help here, please? #stm8s-discovery-power-consumption #low-power #stm8l #stm8l-low-power-halt #high-current #high-current |
|
相关推荐
11个回答
|
|
你好,
你在哪里准确连接了安培表?它应连接在STM32L Discovery的JP1插头引脚1和2之间,否则您将测量除微控制器电流消耗之外的其他内容。 以上来自于谷歌翻译 以下为原文 Hello, Where did you connect the amp meter exactly? It should be connected between JP1 header pin 1 and 2 of the STM32L Discovery otherwise you are measuring something else than the microcontroller current consumption. |
|
|
|
谢谢eM Ko,你指出了......我想我用错误的引脚来测量电流。我测量了+ 3V3和GND引脚之间的电流,它们也为ST-LINK供电。在JP1引脚1和2之间测量,测量的电流消耗很好。
现在我剩下的问题是将我自己的目标应用MCU设置为低功耗模式。下面的代码是我的源代码,旨在使MCU进入活动暂停模式。有人请指出这里有什么问题吗? ////////////////////////////////////////////////// ////// LCD_Cmd(DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_LCD,DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_ADC1,DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_USART1,DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_USART2,DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_TIM1,DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_TIM2,DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_TIM3,DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_TIM4,DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_TIM5,DISABLE); TIM1_Cmd(DISABLE); TIM2_Cmd(DISABLE); TIM3_Cmd(DISABLE); TIM4_Cmd(DISABLE); TIM5_Cmd(DISABLE); ITC_DeInit(); CLK_SYSCLKDivConfig(CLK_SYSCLKDiv_1); CLK_SYSCLKSourceConfig(CLK_SYSCLKSource_LSI); CLK_SYSCLKSourceSwitchCmd(ENABLE); while(((CLK-> SWCR)& 0x01)== 0x01); CLK_HSICmd(DISABLE); CLK-> ICKCR | = 0x10; CLK-> ICKCR& = ~0x20; CLK-> ICKCR& = ~0x40; CLK-> ICKCR | = 0x04; CLK-> ICKCR& = ~0x01; CLK_MainRegulatorCmd(DISABLE); PWR_UltraLowPowerCmd(ENABLE); GPIO_Init(GPIOA,GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7,GPIO_Mode_Out_PP_Low_Slow); GPIO_Init(GPIOB,GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7,GPIO_Mode_Out_PP_Low_Slow); GPIO_Init(GPIOC,GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7,GPIO_Mode_Out_PP_Low_Slow); GPIO_Init(GPIOC,GPIO_Pin_0 | GPIO_Pin_1,GPIO_Mode_Out_OD_Low_Slow); GPIO_Init(GPIOD,GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7,GPIO_Mode_Out_PP_Low_Slow); GPIO_Init(GPIOE,GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7,GPIO_Mode_Out_PP_Low_Slow); GPIO_Init(GPIOF,GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7,GPIO_Mode_Out_PP_Low_Slow); GPIO_Init(GPIOG,GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7,GPIO_Mode_Out_PP_Low_Slow); GPIO_Init(GPIOI,GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3,GPIO_Mode_Out_PP_Low_Slow); SIM(); 停(); 以上来自于谷歌翻译 以下为原文 Thank you eM Ko, You pointed out well ... I guess I measured current from wrong pins. I measured current between +3V3 and GND pin, which are supplying power into ST-LINK as well. Measuring between JP1 pin 1 and 2, the measured current consumption was fine. Now my remaining problem is about setting my own target application MCU into low power consumption mode. The code below is my source code which intended to make MCU go into active halt mode. Anybody please point out what's wrong here? //////////////////////////////////////////////////////// LCD_Cmd(DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_LCD, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_ADC1, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_USART1, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_USART2, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_TIM1, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_TIM2, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_TIM3, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_TIM4, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_TIM5, DISABLE); TIM1_Cmd(DISABLE); TIM2_Cmd(DISABLE); TIM3_Cmd(DISABLE); TIM4_Cmd(DISABLE); TIM5_Cmd(DISABLE); ITC_DeInit(); CLK_SYSCLKDivConfig(CLK_SYSCLKDiv_1); CLK_SYSCLKSourceConfig(CLK_SYSCLKSource_LSI); CLK_SYSCLKSourceSwitchCmd(ENABLE); while (((CLK->SWCR)& 0x01)==0x01); CLK_HSICmd(DISABLE); CLK->ICKCR |= 0x10; CLK->ICKCR &= ~0x20; CLK->ICKCR &= ~0x40; CLK->ICKCR |= 0x04; CLK->ICKCR &= ~0x01; CLK_MainRegulatorCmd(DISABLE); PWR_UltraLowPowerCmd(ENABLE); GPIO_Init(GPIOA, GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7, GPIO_Mode_Out_PP_Low_Slow); GPIO_Init(GPIOB, GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7, GPIO_Mode_Out_PP_Low_Slow); GPIO_Init(GPIOC, GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7, GPIO_Mode_Out_PP_Low_Slow); GPIO_Init(GPIOC, GPIO_Pin_0|GPIO_Pin_1, GPIO_Mode_Out_OD_Low_Slow); GPIO_Init(GPIOD, GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7, GPIO_Mode_Out_PP_Low_Slow); GPIO_Init(GPIOE, GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7, GPIO_Mode_Out_PP_Low_Slow); GPIO_Init(GPIOF, GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7, GPIO_Mode_Out_PP_Low_Slow); GPIO_Init(GPIOG, GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7, GPIO_Mode_Out_PP_Low_Slow); GPIO_Init(GPIOI, GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3, GPIO_Mode_Out_PP_Low_Slow); sim(); halt(); |
|
|
|
你好lim.jisoon,
我有完全相同的问题,我写了一个类似你的功能进入主动停止模式,但电流消耗仍然几乎相同。你成功地获得了非常低的电流消耗吗? 以上来自于谷歌翻译 以下为原文 Hello lim.jisoon, I have the exact same problem, I wrote a similar function as yours to enter active halt mode but current consumption is still nearly the same. Did you succeded to get very low current consumption? |
|
|
|
尝试这个...它适用于152C6,因此可能需要对您的销售类型进行一些调整。
以上来自于谷歌翻译 以下为原文 Try this one... it's for 152C6, so some adjustments to your sales type could be needed. |
|
|
|
你好felix,
我的问题结果是电压供应依赖。 STM8L的电流消耗对电压供应水平非常敏感。 STM8L电流消耗的规格均以3V Vcc测量。如果将Vcc增加到3.3V,则电流消耗会急剧增加。 尝试在MCU电源线前添加3.0V LDO,并测量STM8L MCU的电流消耗。这就是我解决这个问题的方法。 祝你好运! 以上来自于谷歌翻译 以下为原文 Hello felix, My problem turned out to be voltage supply dependent one. The current consumption of STM8L is very sensitive to the level of voltage supply. The specification of STM8L current consumption is all measured in 3V Vcc. If you increase the Vcc to 3.3V, the current consumption increases dramatically. Try to add a 3.0V LDO in front of your MCU voltage supply line and measure the current consumption of your STM8L MCU. This is how I solved this problem. Good luck! |
|
|
|
很奇怪,因为恕我直言,STM8L不应该对Vcc敏感,因为它有
以上来自于谷歌翻译 以下为原文 Very strange, as IMHO, STM8L should not be sensitive to Vcc since it has |
|
|
|
这就是我正在为STM8L151做的事情,它将电流降至0.5uA。这是完全停止,但如果你想保持RTC活动,只需注释掉那些行。有一点,你必须在停止之前清除唤醒INT。在这里,我使用EXTI pin7进行唤醒。
Halt_Init(); EXTI_ClearITPendingBit(EXTI_IT_Pin7); 停(); void Halt_Init(void) { TIM1_Cmd(DISABLE); TIM2_CtrlPWMOutputs(DISABLE); TIM2_Cmd(DISABLE); TIM3_Cmd(DISABLE); TIM4_Cmd(DISABLE); ADC_Cmd(ADC1,DISABLE); PWR_PVDCmd(DISABLE); / *切换到LSI作为系统时钟源* / / *系统时钟预分频器:1 * / CLK_SYSCLKDivConfig(CLK_SYSCLKDiv_1); CLK_SYSCLKSourceConfig(CLK_SYSCLKSource_LSI); CLK_SYSCLKSourceSwitchCmd(ENABLE); while(CLK_GetFlagStatus(CLK_FLAG_LSIRDY)== 0); CLK_HSICmd(DISABLE); CLK_HSEConfig(CLK_HSE_OFF); / *以低功率设置STM8 * / PWR_UltraLowPowerCmd(ENABLE); / *将GPIO设置为低功耗* / GPIO_LowPower_Config(); / *停止RTC源时钟* / CLK_RTCClockConfig(CLK_RTCCLKSource_Off,CLK_RTCCLKDiv_1); / *停止时钟RTC和LCD * / CLK_PeripheralClockConfig(CLK_Peripheral_RTC,DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_LCD,DISABLE); } void GPIO_LowPower_Config(void) { / *将未使用的引脚配置为输出推挽0以进入低功耗* / / *港口A * / GPIO_Init(GPIOA,GPIO_Pin_All,GPIO_Mode_Out_PP_Low_Slow); / *端口B不是AIN * / GPIO_Init(GPIOB,GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_7,GPIO_Mode_Out_PP_Low_Slow); / *端口B LED,因此它们在通电时不闪烁* / GPIO_Init(GPIOB,GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5,GPIO_Mode_Out_PP_High_Slow); / *端口C不是唤醒引脚!! * / GPIO_Init(GPIOC,GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6,GPIO_Mode_Out_PP_Low_Slow); / *港口D * / GPIO_Init(GPIOD,GPIO_Pin_All,GPIO_Mode_Out_PP_Low_Slow); / *港口E * / GPIO_Init(GPIOE,GPIO_Pin_All,GPIO_Mode_Out_PP_Low_Slow); / *港口F * / GPIO_Init(GPIOF,GPIO_Pin_All,GPIO_Mode_Out_PP_Low_Slow); } 以上来自于谷歌翻译 以下为原文 Here's what I'm doing for the STM8L151 and it drops current to 0.5uA. This is full halt, but if you want to keep RTC active, just comment out those lines. One thing, you have to clear the wakeup INT before halt. Here, I'm using EXTI pin7 for wakeup. Halt_Init(); EXTI_ClearITPendingBit(EXTI_IT_Pin7); halt(); void Halt_Init(void) { TIM1_Cmd(DISABLE); TIM2_CtrlPWMOutputs(DISABLE); TIM2_Cmd(DISABLE); TIM3_Cmd(DISABLE); TIM4_Cmd(DISABLE); ADC_Cmd(ADC1, DISABLE); PWR_PVDCmd(DISABLE); /* Switch to LSI as system clock source */ /* system clock prescaler: 1*/ CLK_SYSCLKDivConfig(CLK_SYSCLKDiv_1); CLK_SYSCLKSourceConfig(CLK_SYSCLKSource_LSI); CLK_SYSCLKSourceSwitchCmd(ENABLE); while (CLK_GetFlagStatus(CLK_FLAG_LSIRDY) == 0); CLK_HSICmd(DISABLE); CLK_HSEConfig(CLK_HSE_OFF); /* Set STM8 in low power */ PWR_UltraLowPowerCmd(ENABLE); /* Set GPIO in low power*/ GPIO_LowPower_Config(); /* Stop RTC Source clock */ CLK_RTCClockConfig(CLK_RTCCLKSource_Off, CLK_RTCCLKDiv_1); /* Stop clock RTC and LCD */ CLK_PeripheralClockConfig(CLK_Peripheral_RTC, DISABLE); CLK_PeripheralClockConfig(CLK_Peripheral_LCD, DISABLE); } void GPIO_LowPower_Config(void) { /* Configure unused pins as output push-pull 0 to enter low power */ /* Port A */ GPIO_Init(GPIOA, GPIO_Pin_All, GPIO_Mode_Out_PP_Low_Slow); /* Port B not AIN */ GPIO_Init(GPIOB, GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_7, GPIO_Mode_Out_PP_Low_Slow); /* Port B LEDs, so they don't flash at power on */ GPIO_Init(GPIOB, GPIO_Pin_3|GPIO_Pin_4|GPIO_Pin_5, GPIO_Mode_Out_PP_High_Slow); /* Port C not wakeup pin!! */ GPIO_Init(GPIOC, GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6, GPIO_Mode_Out_PP_Low_Slow); /* Port D */ GPIO_Init(GPIOD, GPIO_Pin_All, GPIO_Mode_Out_PP_Low_Slow); /* Port E */ GPIO_Init(GPIOE, GPIO_Pin_All, GPIO_Mode_Out_PP_Low_Slow); /* Port F */ GPIO_Init(GPIOF, GPIO_Pin_All, GPIO_Mode_Out_PP_Low_Slow); } |
|
|
|
嗨,
我正在使用stm8L051F3微控制器。 在我的系统中,VDD上隐含3.7V电压。 我应该测量的最小电流消耗是多少? 根据数据表,典型值为350nA,而1.8V至3.6V电压下最大值为2microA。 谢谢, Ivgeni。 以上来自于谷歌翻译 以下为原文 Hi, I am using stm8L051F3 micro controller. In my system, 3.7V voltage is implied on VDD. What is the minimal current consumption that I should measure ? According to datasheet, the typical is 350nA while maximum is 2microA on 1.8V to 3.6V voltage. Thanks, Ivgeni. |
|
|
|
嗨,
我正在使用stm8L051F3微控制器。 在我的系统中,VDD上隐含3.7V电压。 在暂停模式下我应该测量的最小电流消耗是多少? 根据数据表,典型值为350nA,而1.8V至3.6V电压下最大值为2microA。 谢谢, Ivgeni。 以上来自于谷歌翻译 以下为原文 Hi, I am using stm8L051F3 micro controller. In my system, 3.7V voltage is implied on VDD. What is the minimal current consumption that I should measure in halt mode ? According to datasheet, the typical is 350nA while maximum is 2microA on 1.8V to 3.6V voltage. Thanks, Ivgeni. |
|
|
|
非常感谢你附上的示例代码,它真的很有帮助。但是,我是这个低功耗MCU的新手,目前我对低功耗MCU进行了研究。我遇到了如何制作stm8l的问题
152C6 MCU从停止期间再次唤醒,比方说10秒钟。即上述MCU将暂停10秒钟然后唤醒以闪烁LED然后再次停止。非常感谢你。 以上来自于谷歌翻译 以下为原文 thank you very much for the example code attached, it is really helpful. but, I am new to this brand of low power MCUs and currently I have a research on the low power MCUs. I faced a problem on how to make the stm8l 152C6 MCU wake up again from the halt period of let's say 10 seconds. I.e. the mentioned MCU will halt for 10 seconds and then wake up to flash the LEDs and then go to halt again. Thank you pretty much. |
|
|
|
“
我测量了+ 3V3和GND引脚之间的电流,' 你不可能做到这一点。因为如果你这样做,你会炸掉电源或电表。 你所描述的是奇怪的(出于这个世俗的奇怪),更可能是一个测量问题。如果我是,你,我会拿出一个原理图,准确地显示你测量电流的方式和位置,并从那里开始。 以上来自于谷歌翻译 以下为原文 ' I measured current between +3V3 and GND pin,' you couldn't have possibly done that. because if you did, you would have blown up either the power supply or the meter. what you described is weird (out of this worldly weird), and more likely a measurement problem. If I were, you, I would take out a schematic and show exactly how and where you measured the current and go from there. |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2747 浏览 1 评论
3244 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1813 浏览 1 评论
3655 浏览 6 评论
6044 浏览 21 评论
1342浏览 4评论
204浏览 3评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
359浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
449浏览 2评论
STM32处理增量式编码器Z信号如何判断中断是正转的还是反向转的?
276浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-29 00:27 , Processed in 1.494527 second(s), Total 99, Slave 82 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号