Author Topic: uController freq generation?  (Read 511 times)

0 Members and 1 Guest are viewing this topic.

Offline oceandesignTopic starter

  • Newbie
  • Posts: 2
  • Country: us
uController freq generation?
« on: April 15, 2020, 04:13:25 pm »
I am working on a project where I need a accurate, stable low to no jitter square wave in the range of 0 to approx 300khz to 400khz. I need to be able to set the frequency with an accuracy of 1 hz steps or better.  I would like to use a uController to do the job, the simpler the uC the better,  there is not alot of  processing power needed for other things, just a few buttons and LED, beeper for I/O,  an I2C or SPI  pins, channel of basic A/D and possibly D/A.

It only needs a square wave (50% duty cycle) not sine or anything else so I don't think I need anything more complicated such as DDS like this https://www.qsl.net/zs1ayj/page11.htm

I can't seem to get around the problem that at lower frequencies a clock of say 32MHZ is adequate  for accurately creating a square wave but at 300khz there just is not enough accuracy there to get 1hz resolution or better, as far as I can figure out.  Does anyone have ideas or suggestions or schemes how I might approach this?

thanks

Csquire
« Last Edit: April 15, 2020, 04:18:50 pm by oceandesign »
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 14864
  • Country: de
Re: uController freq generation
« Reply #1 on: April 15, 2020, 04:28:13 pm »
The task is not so easy as it looks, but it depends on the Jitter level needed. If the requirements are not so high one could use a DDS to generate a sine,  followed by a comparator and divider (:2) to get exactly 50% on/off.

With a µC it is relatively simple to have a simple divider, like 32 kHz / N  and than a variable N of some 800 to a little of 1000. However this would not give 1 Hz resolution.
The alternative to DSS would be some PLL system, but this may not be so simple or involve quite high frequency chips.  One may still need an extra divider after the PLL chip as it may be easier to get some 300 MHz with 1 kHz resolution.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf