2024-03-11 06:23 AM
Hi all,
I have a project with a SMT32L431. Right now it is running on the nucleo-64 demo board (its a STM32L4 33RCT6P) so nothing is connected to the board.
The project will use all UART and LPUART modules, the SPI1, the I2C2 and the CAN1 module. I have setup the clock at 2MHz using the MSI clock. When starting the module and configuring the clock, deactivating the TIM1 and setting in low power run mode, the consumption drops to 140uA. This is my starting point.
For now I only have LPTIM1 doing interrupts every 1s and a main loop that does nothing but check flags of the LPTIM1 interrupts and sends the device into low power sleep mode.
Clock config is very simple. I have setup MSI to 2MHz, distributed that to SYCCLK. Then PCLK1 and 2 runs at 2MHz. All modules use PLCk1 or 2 and ADC uses SYSCLK (so that PLL is not used)
2024-03-11 07:25 AM - edited 2024-03-11 07:27 AM
> Setting the GPIO, I get 170uA. However, if the PC11 is set as an input I get to 300uA!!
Let's just start here. What do you exactly mean by "setting the GPIO"? Read out and check/post content of GPIO and all other registers you have changed from default.
> deactivating the TIM1
Why would you need that? Does this mean that there is something else before the experiment? That's then a rather uncertain object to start with. Why don't you start from a clean slate, i.e. the reset states?
JW
2024-03-11 07:30 AM
I set all inputs to GND and now I get 270uA before SPI init. Much better. However, after SPI, I have 413uA and after I2C I have 500uA. So I2C takes 70uA which seems like a lot and SPI takes 143uA which is too much for sure.
For SPI, I set the MISO pin to GND
For I2C, I set SCL to 3.3V pull up, but when setting SDA to 3.3V pull up (4.7kOhm) the MCU resets)