Post
by shuffy » Tue Apr 07, 2015 1:37 am
Sinus have a look at the datasheet. There are 2 phase detectors in the SAA1057. A digital one does the fast lock and lock is maintained with the second (sample and hold) phase detector which has the lock detect signal on its output. This is what you will see on the test pin when you set bits T3 - T0 of word B to 0101 (respectively).
I'm guessing you're using Jan's code for the SAA1057 - I think (I haven't checked) that he configures the test output to show the output of this "in lock" counter, with those 4 junior bits of "word B" set to 0101.
Your mileage will vary however. This is an output from a counter. You will get pulses when it's not in lock, which is probably the weird stuff you're seeing. The code is pretty straightforward, just those 4 test bits. There may be a slight difference in performance depending on how you're using the chip (more of that later) but I think it's probably just the fact that this is not a black and white in-lock/out of lock indicator. I'm aware that many people don't trust using this as a lock indicator. Force your loop in and out of lock and look at the output of the pin on a scope - as I recall when in lock it should be high more rather than less of the time. You could try smoothing the output with a capacitor and follow it with a comparator and see how you get on.
Over the years I've built shed loads of exciters with this chip. I never use "on frequency" VCO designs for reasons which have been done to death here. Inconveniently, the SAA1057 is not designed to be used with an input frequency around 50MHz so I tended to run my VCO at a quarter frequency and use the AM input of the chip (which has a limit according to the datasheet of 32MHz). A variation is running the VCO at half frequency and then using a flip flop (like Steve Moss does) to get your 25MHz signal which then feeds the AM input of the chip.
You say you're using a half frequency oscillator. So, assuming you're using Jan's code unmodified, does this mean you're feeding your half frequency VCO output into the FM input of the SAA1057 (you've got to tell the SAA1057 which input you're using by setting a flag in word B) and using the divide ratio you would use for an input frequency of 100MHz and hoping for the best? Or does it let you use "exotic" divide ratios... I can't remember what Jan's code does with the dip switches. Are you doing something funky like using a reference crystal of half the recommended frequency?
Depending on exactly what you're doing here, it might affect the behaviour of the lock test pin, but generally that behaviour will be in line with what you'd get by using a 100MHz input with a standard reference crystal (4MHz or whatever). In other words you'll still get pulses.
Don't forget (you might recall a few "discussions" with Jan, Chris and others about this) that the frequency responses of the SAA1057 input circuits and FM prescaler are physical limitations, nothing to do with the crystal frequency - they are however alleged to vary by manufacturer. So, despite reference crystal frequency, you might have problems feeding 50MHz into either AM or FM pins on that chip.
Hope some of this rambling helps - I would be inclined to select a PLL chip which has a proper lock output and has 50MHz within it's allowed input frequency range! (e.g. MC145170).
He said shuffy! I said WOT? Woo!