2015-10-06 06:01 PM
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 HzOr 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.2015-10-06 06:40 PM
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.98320167983201679832016798322015-10-06 08:46 PM
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.