Hi, i am an STM32 rookie and I have a problem with properly connecting STM32L432KCU6 microcontroller, with the BLDCDriver6PWM driver in the library. I can’t find it clearly stated in the datasheet, which pins operate on the same timers and which pins support hardware interrupts. Basically i dont know how to connect the pins to the BLDCDriver6PWM driver and to the mosfet drivers, to be able to use hardware interrupts on this microcontroller. I would be very grateful for some tips.
Hi @Lambert14, and welcome to SimpleFOC!
My #1 tip in this regard is to download the (free) STM32CubeIDE.
This software from ST Micro lets you set up a project, choosing your specific MCU type. Then it will open a hardware configuration view, where you can check exactly which pin can do what for your MCU type.
After choosing the pins, you can go back to ArduinoIDE and continue programming with the pins you found.
It looks like this:
For 6-PWM mode you should use pins from the same timer, using the normal channel and the negated channel for the same phase, like TIM1_CH1 with TIM1_CH1N, TIM1_CH2 with TIM1_CH2N, and TIM1_CH3 with TIM1_CH3N.
This MCU does not have many pins, so you’re a bit limited in choices. I think the pic above might be the only configuration.
Alternatively, it can also work if you use pins from some different timers, but using the same timer on each phase, like this:
(here you would use the pins on TIM2 for one of the phases, and the pins on TIM1 for the other two phases.
Are you using the Nucleo board for this chip, or a different board?
Thank you @runger for this extensive answer it clarifies preatty much everything. I had no idea STM32CubeIDE had these features. Yes, i am using the arduino nano sized Nucleo board.