Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

software PLL

Status
Not open for further replies.

kvrajasekar

New Member
Hi all,

I am planning to implement PLL using software(16f72 asm code)is it possible?.I dont get the required details to implement in software.

My input frequency is 50Hz(free run 50Hz).Lock range is 45Hz to 55Hz.

what i read from some article is it required reference frequency.can i use 4MHz crystal,but it seems too high.because the formula for divide ratio is fosc/fin.which gives 80000.

Why we need reference freq(is it for step wise increment/decrement of frequency?).How can i choose the reference frequency for 50Hz input.Please give me the steps to be followed for software PLL.

Please help me on this.
 
The idea of a PLL is that you can generate a different frequency, or a more accurate one.

What is it that you are trying to do? Are you trying to generate a multiple of the 50 Hz reference or are you wanting a frequency that is more accurate?

A 4 MHz crystal is fairly accurate, so the if you want better accuracy than that, it seems strange that you want a lock range of 45 - 55 Hz.
 
Thanks for the response Mr.Diver300,

Actually i am going to do single 50Hz.It is for inverter.If i use 4Mhz crystal,then my divider ratio become 80000.

Is it mean that to generate 50Hz freq need 80000 steps. that is each step needs 0.25us increment or decrement to achieve lock range.But how can i generate .25us delay.

or i have to create a new oscillator freq in KHz.Please let me know.

Steps to implement(correct me if i am wrong)

1.Initially starts with 50Hz free run mode.

2.Monitoring input frequency 50Hz.

3.In lock range decide whether to incre/decre the free run 50Hz.

4.If phase lock is need, can i use the rising edge match?
 
Last edited:
Most inverters have a fixed frequency. A 4 MHz crystal is more accurate than the mains electricity, so if you just divide by 80000 that will be fine.

(The only exception is that some electricity grids make sure that the average frequency for each day is very accurate, to keep synchronous electric clocks accurate)

If you only need to keep to within 45 - 55 Hz, the crystal would do that easily. It is probably going to keep within 49.999 - 50.001 Hz.

You said
2.Monitoring input frequency 50Hz.

Where is this "input frequency" coming from? Are you trying to synchronise an inverter to the existing mains? If not, you don't need a PLL or "adjustments". You just need to get the correct divide ratio.

A 16f72 takes 4 clock cycles to execute one instruction. So with a 4 MHz crystal, any instruction takes 1 µs. You use this to make delay loops.

is an example of delay loop codes.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top