STM8AF2588 supply current in halt mode

OP #7875261
Lesenswert?

Hi, I use a PCB that is reduced to one STM8AF5288 and 3 100nF Capacitors at the supply pins. No other components, all are removed. I supply it with 3,3V. I want to reduce current consumption in halt-mode to 4,5µA (datasheet). My current consumption in halt mode is:

  • 350µA @ 3V
  • 550µA @ 3,3V
  • 1050µA @ 3,7V Here is my code, can anyone please help? I am really in trouble. Thank you very much, Holger

void main(void) {
CLK_HSIPrescalerConfig(CLK_PRESCALER_HSIDIV8); // 2 MHz GPIO_Init(GPIOA, GPIO_PIN_ALL, GPIO_MODE_IN_PU_NO_IT); GPIO_Init(GPIOB, GPIO_PIN_ALL, GPIO_MODE_IN_PU_NO_IT); GPIO_Init(GPIOC, GPIO_PIN_ALL, GPIO_MODE_IN_PU_NO_IT); GPIO_Init(GPIOD, GPIO_PIN_ALL, GPIO_MODE_IN_PU_NO_IT);
ADC1->CR1=0x00; CLK_PeripheralClockConfig(CLK_PERIPHERAL_ADC, DISABLE); //Only Timer 1, 2 and 4 seem to exist TIM1->CR1=0x00; TIM2->CR1=0x00; TIM4->CR1=0x00; CLK_PeripheralClockConfig(CLK_PERIPHERAL_TIMER1, DISABLE); CLK_PeripheralClockConfig(CLK_PERIPHERAL_TIMER2, DISABLE); CLK_PeripheralClockConfig(CLK_PERIPHERAL_TIMER4, DISABLE); CLK_PeripheralClockConfig(CLK_PERIPHERAL_AWU, DISABLE); CLK_PeripheralClockConfig(CLK_PERIPHERAL_UART1, DISABLE); UART1->CR1 = 0x20; UART1->CR3 = 0x00; #define CAN_MCR (((volatile uint8_t)0x5420)) CAN_MCR = 0x02; //CAN->MCR = 0x02; //This does not work, the above code is a workaround CLK_PeripheralClockConfig(CLK_PERIPHERAL_CAN, DISABLE); SPI->CR1=0x00; CLK_PeripheralClockConfig(CLK_PERIPHERAL_SPI, DISABLE); I2C->CR1 = 0x00; CLK_PeripheralClockConfig(CLK_PERIPHERAL_I2C, DISABLE); IWDG->KR =0x00; WWDG->CR=0x00; AWU->CSR = 0x00; FLASH->CR1=0x00;
abschalten(); disableInterrupts(); CLK->CKDIVR = 0xFF; // max. Prescaler für CPU und Peripherie asm("halt");
while (1) { } }

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren