求助 STM32L152RBT6功耗测试
/* Includes ------------------------------------------------------------------*/#include "stm32l1xx.h"
/* Private function prototypes -----------------------------------------------*/
void RCC_Configuration(void);
void GPIO_Configuration(void);
/* Private functions ---------------------------------------------------------*/
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
/* System Clocks Configuration **********************************************/
RCC_Configuration();
GPIO_Configuration();
#ifdef VECT_TAB_RAM
/* Set the Vector Table base location at 0x20000000 */
NVIC_SetVectorTable(NVIC_VectTab_RAM, 0x0);
#else /* VECT_TAB_FLASH */
/* Set the Vector Table base location at 0x08000000 */
NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x0);
#endif
NVIC_InitTypeDef NVIC_InitStructure;
/* Enable the RTC Wakeup Interrupt */
NVIC_InitStructure.NVIC_IRQChannel = RTC_WKUP_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
/* RTC Wakeup Interrupt Generation: Clock Source: RTCDiv_16, Wakeup Time Base: 4s */
RTC_WakeUpClockConfig(RTC_WakeUpClock_RTCCLK_Div16);
RTC_SetWakeUpCounter(0x1FFF);
/* Enable the Wakeup Interrupt */
RTC_ITConfig(RTC_IT_WUT, ENABLE);
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, DISABLE);
PWR_UltraLowPowerCmd(ENABLE);
PWR_EnterSTOPMode(PWR_Regulator_LowPower,PWR_STOPEntry_WFI);
// RCC_MCOConfig(RCC_MCOSource_LSE, RCC_MCODiv_1);
//
while (1)
{
}
}
/**
* @brief Configures the different system clocks.
* @param None
* @retval None
*/
void RCC_Configuration(void)
{
/* Enable The PWR Clock */
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
/* Allow access to RTC */
PWR_RTCAccessCmd(ENABLE);
/*!
RE:求助 STM32L152RBT6功耗测试
只能通过RTC或者外部中断唤醒来判断。回复:求助 STM32L152RBT6功耗测试
回复第 2 楼 于2011-11-10 01:14:58发表:只能通过RTC或者外部中断唤醒来判断。
再请教一下
我在用外部中断唤醒的时候测到从STOP或者sleep模式唤醒到正常工作所需要的时间为2.5ms,觉得时间有些长啊,又找不到资料里有这个数据的,请问下这个时间正常吗?
注:我用的内部默认RC,MSI(2M),开始PA12置高,中断里取反
页:
[1]