2025-11-11 6:19 AM - last edited on 2025-11-11 6:43 AM by Andrew Neil
Good morning, so we are currently doing research; however, we recently switched microcontroller to the STM32 G431RB Nucleo board, and currently, there is an issue on how to read the Hall sensor frequency using Simulink. We already have done this using textual code; however, Simulink is needed for this research for further improvement and autonomous prediction.
Currently, I have configured Timer 1 to generate a PWM of 26 Hz with a prescaler value of 169 and a counter value of 99, and configured Timer 3 to read the frequency by setting only the prescaler of the channel to be 169, and the channel is one. (the microcontoller clock is 170 Mhz and so is the timers)
In Simulink, I configured the PWM, which was observed in the oscilloscope to be fine. However, when it came to using the timer capture block to capture the clock ticks to later convert to frequency, there was no output.
I’m fairly sure it’s my configuration; however, as there is no help online or videos or examples, it is extremely hard to reference. I currently only want to measure one PWM value’s frequency.
2025-11-11 6:42 AM
Simulink is an independent 3rd-party product - nothing to do with ST.
You need to go to Mathworks for support with Simulink - it's their product:
https://uk.mathworks.com/support/contact_us.html?s_tid=hc_resources
https://uk.mathworks.com/matlabcentral/?s_tid=user_nav_community