Question
Why is the Halt() function not working?
#include <stm8l15x.h>
#include <stm8l15x_pwr.h>
void main(void)
{
GPIO_Init(GPIOA, GPIO_Pin_All, GPIO_Mode_Out_PP_Low_Fast);
GPIO_Init(GPIOB, GPIO_Pin_All, GPIO_Mode_Out_PP_Low_Fast);
GPIO_Init(GPIOC, GPIO_Pin_All, GPIO_Mode_Out_PP_Low_Fast);
GPIO_Init(GPIOD, GPIO_Pin_All, GPIO_Mode_Out_PP_Low_Fast);
PWR_UltraLowPowerCmd(ENABLE);
halt();
while(1);
}I'm using the STM8L151G4. I wrote the simplest program that only performs the Halt function. The current draw I'm measuring is 9.7 mA!! It's definitely not going into the ultra low power halt mode. What could cause the Halt function to not work?
