To 'stabilize' the frequency from the 'twisted' wire oscillator as described in previous posts, and to be able to set it via RS232 and read it, I wrote some PIC 18F14K22 asm and added a simple 2 line LCD. The first line shows the requested frequency ,as typed in via RS232. The bottom line shows the measured frequency (against a 10 MHz xtal). http://panteltje.com/pub/GPG_freq_counter_PLL_IMG_3646.GIF On the little board a PIC18F14K22, and a MAX232. The board with the LEDs on the left is my PIC programmer. The 'twisted' wire oscillator I replaced with simple 2 lead electricity wire, as I stated earlier, this thing works with capacitive coupling, as twin-lead is easier to cut... The PLL is done in software, and for now only has the integral part. The measure frequency after multiplying with the prescalers, is subtracted from the requested frequency. If sign bit is set the PIC PWM out is increased else increased by a given value (1 now). The PWM is filtered and used to control the frequency of the twin-lead oscillator. Works like a charm. Not due to the prescalers and the measurement time resolution is limited, this is no problem in this case. I now measure once per second. PIC timer 0 is the frequency counter (16 bits with :8 prescaler). PIC timer 1 is the clock tick (1 second measurement gate). PIC timer 2 and 3 are part of the PWM I think, used old code I had. There is a :256 prescaler on the twin-lead oscillator board, and a buffer amplifier. It is nice, you can dial a frequency in this band.. asm source is here: http://panteltje.com/pub/jps.asm 'jps' stands for Jan's Positioning System of course ;-) Code is not finished by a long shot, just a proof of concept I hacked together today. Hopefully that will wake the 4046 PLL club too. No diagram, but the LCD connections are clearly indicated in the source code. The rest is simple and I described before in an other thread. Nothing is very critical except the LCD initialization, type 'R' in terminal to restart if nothing shows, will probably work OK on a real 5 V supply. but the load of the LCD backlight + prescaler + oscillator, was not what this PIC programmer was designed for. Anyways it is just a test. But it can easily be adapted for any other (even extremely high, note the 32 bit support in the numbers) frequencies. Have fun:-)
GPS frequency counter + PLL PIC based
Started by ●October 19, 2012
Reply by ●October 23, 20122012-10-23
On a sunny day (Fri, 19 Oct 2012 19:53:12 GMT) it happened Jan Panteltje <pNaonStpealmtje@yahoo.com> wrote in <firstname.lastname@example.org>:>The bottom line shows the measured frequency (against a 10 MHz xtal). > http://panteltje.com/pub/GPG_freq_counter_PLL_IMG_3646.GIF > >On the little board a PIC18F14K22, and a MAX232. > >The board with the LEDs on the left is my PIC programmer.As I need a lot of Gold code generating shift registers and preferably also better accuracy than the PIC timers provide, maybe synthesize some frequencies, if jitter is low enough, I started up the old Spartan 2 Digilab board (last used last century?) After some software modifications, and I could not even read my own Verilog code anymore, been a while, http://panteltje.com/pub/spartan2_frequency_counter_IMG_3649.GIF Installed old Xiling webwrack from some old HD, dust is still all over this, now there you go. Also today I build a 1.5 GHz BPSK modulator, with BAT diodes, but a better one will perhaps materialize once the chips come in (not ships, although it may arrive ships,  A bit of a rant against Microchip. Are their digital designers Alright? Normally I do not want to think too much about HOW peripherals are implemented in a micro I use, but ran into some illogical (tm) things in the PIC counters timers. At least illogical to me,. On top of that it seems every peripheral unit has a bug in it. i2c defective, SPI defective, timer 'strangeness' (to put it politely), Did these guys EVER design with normal logic? Or are they just out of school simulation freaks simulating hardware? Anyways, long way to go... Xilinx does Gold code generators with SLR, and then uses several of those some driven parallel, taps where it ends, guess it is efficient silicon space wise. SLRs have no parallel out... IIRC, mm, will take some time to get used to all that.. again. Actually I wanted to go see a movie, but ended up with this spartan stuff. At least the hard + software platform is up and running again to write that stuff.