The documentation states that “The STM32 DAC provides the user with a triangular waveform generator with a flexible offset, amplitude and frequency.” How would I utilize this in mbed? I have a STM Nucleo F303K8 board.
Build the triangle wave generator with the STM32CubeIDE.
- You use the same clock configuration for the NUCLEO-F303K8 as defined by Mbed in the
- You don’t use the
Timerused by Mbed for
us_ticker. Check in the `mbed-os/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303x8/device/us_ticker_data.h’ file. (For the NUCLEO-F303K8 it’s timer TIM2.)
When you are happy with the performance move your project to Mbed :
- Create a new program for the NUCLEO-F303K8 in the Mbed Online Compiler by selecting a
mbed os blinkytemplate.
- Replace the
main.ccontent of the
- Comment out (or delete) the
Copy & Pastethe other files with codes from the
STM32CubeIDEproject to the online compiler project.
- Rename and modify:\
“stm32f4xx_it.h” to “stm32f4xx_it_msp.h”\
“stm32f4xx_it.c” to “stm32f4xx_it_msp.c”
- Add additional features to the program as needed.
I used the same method to build the following programs:
Thank you for the reply! I will try and implement this.