# [SOLVED]Help to generate 50KHz to 200KHz SqueareWave of 5VPP in step of 100Hz.

Status
Not open for further replies.

#### dhruv_electro

##### Advanced Member level 4
Hay can anybody suggest me some idea about following detail

Variable frequency square wave : 50Khz to 200Khz
Step of the variation : 100Hz
Duty cycle : 50%
VPP: 5V.

I have tried using MCU (PIC16F1939). But it cannot give perfect step of 100HZ. Because in MCU there is a "count" which divides system clock by its value. Or in some other word i only count in time domain. And when we convert it in to frequency domain it is not linear.

Here is the example

Say may system clock is 2MHz

if my count is 10 then output freq is 200KHz
when my count is 11 then output freq is 181.8181KHz
when my count is 12 then output freq is 166.66KHz

so f1-f2 is now equal to f2-f3. I need this step equal to 100Hz. Or will you please give me schematic of any VCO?

#### Kripton2035

##### Advanced Member level 4
use a dds like the ad9850 from analog devices
you can have a precision of 1/100e of a Hz with it
and you can drive it from your pic mcu with serial bus.
regards,

#### dhruv_electro

##### Advanced Member level 4
use a dds like the ad9850 from analog devices
you can have a precision of 1/100e of a Hz with it
and you can drive it from your pic mcu with serial bus.
regards,

dear there,
Thanks for your valuable reply. But I have already gone through ad9850 kind of ICs. It is very expencive for the application which i wanted to designe. Can you suggest any chipper solution. And many functions in this IC which we dont want. Thank you again. but would you consider my budgetary problems?

#### dhruv_electro

##### Advanced Member level 4

Thanks for your help I will see your advised links and tell you the results.

V
Points: 2

#### dhruv_electro

##### Advanced Member level 4
Thank you for your reply here i have also foun some reply from microchip. I am pasting here link:
I will consider your both the options. I am also tring to do on microchip also. I have no issue of AVR or PIC.
you can also go through link given below. will give you reply about result. Thanks for your valuable response.
Help to generate 50KHz to 200KHz SqueareWave of 5VPP in step of 100Hz.

#### dhruv_electro

##### Advanced Member level 4
Yes finally i got the answers thanks to every one. Every solution works fine.
1. AD9851 an spi interface worked very well. (But expensive).
2. I have tried to go through PIC16F150x. details are useful may be used in future
3. Right now i have tried to generate PWM signal with duty cycle vary form 1 to 100%. converted it into a variable voltage of 1v to 4.5V and gave it to the input of HEF4046B (NXP) (you can use TI version of same IC). Which give me result with following details:
a. 50khz to 200khz square wave with 50% duty cycle.
b. 143Hz step with 10 bit resolution of pwm duty cycle at 32MHz internal clock (8MIPS)

#### Kripton2035

##### Advanced Member level 4
hi
just to add some examples to this topic, here is a simple dds example that does 300KHz frequency with a resolution of 0.07Hz !!!
only one avr chip - have a look
Jesper's AVR pages - MiniDDS

Status
Not open for further replies.