Newbie questions: Can I do this PLL all digitally in a FPGA? 8Khz clock locked on a 100hz pulse

Can I do this all in a FPGA?

I would like to sync to an incoming pulse (its actually going to be a register write) that I will receive at approx 100hz, and generate a

8Khz output clock.

This will be a recovered sync from a master device, but the devices are SW based so there will be a fair amount of jitter (~+/- 500us) .. but this jitter is expected to be bounded and stable (not slipping in time) over a long period.

Is it possible to use a local 50Mhz oscillator and create and up/down counter based on the 100hz signal, then slightly adjust the 8Khz clock rate based on this?

I=E2=80=99m a newbie so please bare with me =EF=81=8A.

Is there something out their like this? I did some searches, but seems most PLL type applications are not syncing to such a slow input (100hz). Also I am only concerened with long term frequency lock (well average) from the master providing the 100hz to the slave generating the 8Khz (the 100hz is based on the master 8K on the other side of the network, unfortunitly I cannot increase the 100Hz pulse rate)

I would like to try to keep this all digital if possible since I do not have a local PLL on board to work with.. I do have a Altera Cyclone II FPGA that I will be targeting for this application.

Thanks much!

-Bill

Reply to
ZR1TECH
Loading thread data ...

Yes, definitely. Getting *really* good results may be quite tricky, though.

For sure. The interesting question is, what are you really trying to achieve? Are you trying to ensure that yuo get as nearly as possible 80 output pulses between each pair of 100Hz register writes? Or are you trying to get an essentially constant frequency that is, over very long periods, locked to the long-term average of the 100Hz?

What I'm getting at is that anything that responds promptly to changes in the 100Hz input will obviously cause jitter on the 100 Hz to propagate to the output. Likewise, anything that smooths the 8kHz output so that it has minimal jitter, and its frequency changes slowly and smoothly, will of course fail to respond to rapid changes in the 100Hz signal's behaviour. You need to know something about the statistics of the reference signal, and the desired behaviour of the output.

Having said all that, the frequencies you describe are so slow that you have LOTS of time to do any calculations that might be needed; so you can do quite sophisticated filtering with a small amount of hardware (or even with software in an embedded CPU of some kind).

I did something loosely similar when I wanted to know the exact position of a rotating flywheel, but could see only a single index pulse per revolution. In that case I was able to make use of the known physics of the rotating object, and the known behaviour of the index pulse sensor, to make things work better. Some interesting juggling was necessary to get the thing into lock quickly at startup time - it's often a good idea to have two operating modes, "acquiring lock" and "holding lock". And then you have to be VERY careful about what happens as you transition from one mode to the other. By the way: that example was recovering a roughly 5kHz pulse train from a roughly 30Hz signal, and I did it all in a little PIC microcontroller! And no, you can't have the code; it was so long ago that I have certainly lost it all!

--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
jonathan.bromley@MYCOMPANY.com
http://www.MYCOMPANY.com

The contents of this message may contain personal views which 
are not the views of Doulos Ltd., unless specifically stated.
Reply to
Jonathan Bromley

Hi Jonathan,

Thanks much for the info!

I am in fact trying to get an 8K clock locked to the long-term average of the 100Hz..

The system has one timed master (M) this master generates sync packets to another system at a rate of 100hz, when the slave (S) recovers these packets the hardware is updated via a register write to the FPGA. Jitter is introduced via SW trasmit (though very little), network (most of the jitter, as well as a possible packet loss every so often), as well as the SW receiver.. this jitter will be bounded, but its there :)

so a clock based on the master that does not slip significantly over time (wander is ok.. just no long term slipping) is what I am after.... Lock time can be in the order of minutes, and quick changes are not what I am looking for..

Im just starting on it so I obviously have alot more homework to do :)

thanks much! any info or advice is greatly appreciated!

-Bill

Reply to
ZR1TECH

Is it possible to post a picture a diagram on here?

Reply to
ZR1TECH

**** ** ******* /**/** /** **/////** /**//** /** ** //** /** //** /**/** /** /** //**/**/** /** /** //****//** ** /** //*** //******* // /// /////// :-)HTH, Syms.
Reply to
Symon

Maybe a pointer to a diagram.

formatting link

-- Mike Treseler

Reply to
Mike Treseler

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.