cancel
Showing results for 
Search instead for 
Did you mean: 

Signal Generator using STM32F4 Family

bagasprima
Associate II
Posted on October 07, 2015 at 03:01

Hello, i got a trouble designing a rectangular signal generator, with specification like these:

1. I need to generate a 1 MHz rectangular signal, (i got it already)

2. Next was 1,0001 MHz, and i screwed up.

So, i just curious, is there any way to create that using STM32F4, maybe like applying a frequency shifting function so i can make a signal generator like this:

1 Mhz + xx Hz, or 100 kHz + xx Hz

Or maybe it is impossible to make so i am just circling aroung all these time?

Please anyone? I am new here and to these STM32 things, so i'll be glad if there is some help, and pardon me for my bad language.
2 REPLIES 2
Posted on October 07, 2015 at 03:40

Probably not easily. The TIM can only do integer division.

I suspect you could get close to 1000100 Hz by dividing 168 MHz down by 168 mostly and 167 occasionally in a modulating pattern.

168000000 / 1000100 = 167.9832016798320167983201679832

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
bagasprima
Associate II
Posted on October 07, 2015 at 05:46

hmm ya i've tried the TIM clock division by changing the prescaller and period, but still couldn't do the math to get there, and.. sorry what do you mean by ''occasionally in modulating pattern''?

actually it makes me wonder, is there really any way to create a signal precisely without any external component with this mcu? or i must get other component to do so? any suggestion?

i've read on an article that it can be done easily using DDS/PLL..  but i don't really understand what's all that about.