Maker Pro
Maker Pro

How to (ab)use a PIC ;-)

A

Anthony Fremont

Jan 1, 1970
0
First off, big thanks to everyone for the overwhelming amount of help I
received.

I've been playing around with LC oscillators and other RF like things lately
and I decided to try my hand at making a superhet WWV receiver. Not being
an analog kinda guy I was plagued with too much drift at 9.545 MHz, amongst
other things. Being a PIC kinda guy, I thought it might be neat to apply
one here. ;-)

So I took a couple of variactor diodes and added them to the oscillator. I
tapped the oscillator buffer output, fed it thru a Schmidt trigger to square
it up and then into a PIC to clock TMR1. Over a 4mS (actually 4.096mS), I
count pulses with the 16 bit timer. This gives a decent count without
overflowing the 16 bit timer. Every 20mS I look at the counted frequency
and then "dink" the duty cycle of the hardware PWM. The PWM output is fed
thru a low-pass filter to smooth it out and then applied as reverse bias to
the varactors.

The end result is that the oscillator "locks" within a second or two of
power on and then stays within 100-200Hz of the correct frequency from there
on out. Not fantastic stability, but should be entirely usable for AM
reception. Of course there is lots of room for improvement, but I thought
it neat anyway. :) The PWM could be upped to 10bits and the frequency
counter gate period increased. This would allow _much_ more precise
frequency control than I presently have.

Here is a pic of the circuit constructed on breadboard (800KB):
http://i55.photobucket.com/albums/g143/afremont/DSC00885_edited.jpg

The top left is the oscillator, just to the right of that is the buffer
stage. Further to the right is the NE602 mixer that combines the signal
from the antenna/preselector and the LO. The detector is not finished yet,
but the receiver is hearing on 10MHz, just not very good yet. ;-) The
bottom half of the board contains the PIC which is clocked by a 4MHz crystal
and the 74HC14 gyrator...er..um hex inverting Schmidt trigger.

Just thought some of you all might get a kick out of it. :) Thanks for
looking.
 
J

jasen

Jan 1, 1970
0
So I took a couple of variactor diodes and added them to the oscillator. I
tapped the oscillator buffer output, fed it thru a Schmidt trigger to square
it up and then into a PIC to clock TMR1. Over a 4mS (actually 4.096mS), I
count pulses with the 16 bit timer. This gives a decent count without
overflowing the 16 bit timer. Every 20mS I look at the counted frequency
and then "dink" the duty cycle of the hardware PWM. The PWM output is fed
thru a low-pass filter to smooth it out and then applied as reverse bias to
the varactors.

The end result is that the oscillator "locks" within a second or two of
power on and then stays within 100-200Hz of the correct frequency from there
on out. Not fantastic stability, but should be entirely usable for AM
reception. Of course there is lots of room for improvement, but I thought
it neat anyway. :) The PWM could be upped to 10bits and the frequency
counter gate period increased. This would allow _much_ more precise
frequency control than I presently have.

It sounds kind-of like you've invented the PLL... :)
 
H

Henry Kiefer

Jan 1, 1970
0
| First off, big thanks to everyone for the overwhelming amount of help I
| received.
|
| I've been playing around with LC oscillators and other RF like things lately
| and I decided to try my hand at making a superhet WWV receiver. Not being
| an analog kinda guy I was plagued with too much drift at 9.545 MHz, amongst
| other things. Being a PIC kinda guy, I thought it might be neat to apply
| one here. ;-)
|
| So I took a couple of variactor diodes and added them to the oscillator. I
| tapped the oscillator buffer output, fed it thru a Schmidt trigger to square
| it up and then into a PIC to clock TMR1. Over a 4mS (actually 4.096mS), I
| count pulses with the 16 bit timer. This gives a decent count without
| overflowing the 16 bit timer. Every 20mS I look at the counted frequency
| and then "dink" the duty cycle of the hardware PWM. The PWM output is fed
| thru a low-pass filter to smooth it out and then applied as reverse bias to
| the varactors.
|
| The end result is that the oscillator "locks" within a second or two of
| power on and then stays within 100-200Hz of the correct frequency from there
| on out. Not fantastic stability, but should be entirely usable for AM
| reception. Of course there is lots of room for improvement, but I thought
| it neat anyway. :) The PWM could be upped to 10bits and the frequency
| counter gate period increased. This would allow _much_ more precise
| frequency control than I presently have.
|
| Here is a pic of the circuit constructed on breadboard (800KB):
| http://i55.photobucket.com/albums/g143/afremont/DSC00885_edited.jpg

This loosely coupling in a pll is general known under the name huff-puff.

regards -
Henry
 
J

john jardine

Jan 1, 1970
0
[...]
Here is a pic of the circuit constructed on breadboard (800KB):
http://i55.photobucket.com/albums/g143/afremont/DSC00885_edited.jpg

Nice idea, neat layout!.

On mine, I've 10u's at each end of the power rails acting as backup to the
local decoupling.
Wire links made on the spot from chopped up CAT5 (cat4-3-2-1?) twisted pair.
The wire size seems perfect and can be colour themed.
Sadly, I also have a little weep every time I have to chop the legs off
stuff (eg inductors). Sort of like, anything I can remember how much it
cost me to buy :)
 
A

Anthony Fremont

Jan 1, 1970
0
john said:
[...]
Here is a pic of the circuit constructed on breadboard (800KB):
http://i55.photobucket.com/albums/g143/afremont/DSC00885_edited.jpg

Nice idea, neat layout!.

Thanks allot John. :) I sorta cheated, this was the second build since I
ran out of room on the "single wide" proto-board and I also wanted to see if
I could get rid of the horrid bounce.

It was one of those projects that I just wanted to see if it would work. It
actually works allot better than I expected, once I got the frequency
counting lined out. :) Just one more stupid-PIC-trick in my collection.
On mine, I've 10u's at each end of the power rails acting as backup
to the local decoupling.

I'm always changing up the power jumper layouts from board to board. I'll
add some of those and .01uFs to go with some 10uFs in the corners. When I'm
using a new board, I often forget to put the little jumpers to connect the
upper side rails with the lower ones. That's usually good for five or ten
minutes of mystery. :-?
Wire links made on the spot from chopped up CAT5 (cat4-3-2-1?)
twisted pair. The wire size seems perfect and can be colour themed.
Sadly, I also have a little weep every time I have to chop the legs
off stuff (eg inductors). Sort of like, anything I can remember how
much it cost me to buy :)

I admit, I tend not to trim allot of the cap leads, but I do cut the other
parts down to about half their original leg length. I'm pathetic, I buy the
premade wires and use them most of the time. ;-) I can get them fairly
cheap locally. I'm not real happy with my latest protoboard purchases.
They're cheap, but I fold allot of wires over becuase of misallignment of
the holes and metal contacts, and man I really hate that. :-/ I do find
that as I use them, they become allot more friendly.
 
D

David L. Jones

Jan 1, 1970
0
First off, big thanks to everyone for the overwhelming amount of help I
received.

I've been playing around with LC oscillators and other RF like things lately
and I decided to try my hand at making a superhet WWV receiver. Not being
an analog kinda guy I was plagued with too much drift at 9.545 MHz, amongst
other things. Being a PIC kinda guy, I thought it might be neat to apply
one here. ;-)

So I took a couple of variactor diodes and added them to the oscillator. I
tapped the oscillator buffer output, fed it thru a Schmidt trigger to square
it up and then into a PIC to clock TMR1. Over a 4mS (actually 4.096mS), I
count pulses with the 16 bit timer. This gives a decent count without
overflowing the 16 bit timer. Every 20mS I look at the counted frequency
and then "dink" the duty cycle of the hardware PWM. The PWM output is fed
thru a low-pass filter to smooth it out and then applied as reverse bias to
the varactors.

The end result is that the oscillator "locks" within a second or two of
power on and then stays within 100-200Hz of the correct frequency from there
on out. Not fantastic stability, but should be entirely usable for AM
reception. Of course there is lots of room for improvement, but I thought
it neat anyway. :) The PWM could be upped to 10bits and the frequency
counter gate period increased. This would allow _much_ more precise
frequency control than I presently have.

Here is a pic of the circuit constructed on breadboard (800KB):http://i55.photobucket.com/albums/g143/afremont/DSC00885_edited.jpg

Cool. I'm a bit surprised you didn't have any problems with using the
breadboard at that frequency though.
How is the new scope going? Have you posted your initial comments on
it on the group yet? I may have missed it if you did.

Dave.
 
J

Joop

Jan 1, 1970
0
The end result is that the oscillator "locks" within a second or two of
power on and then stays within 100-200Hz of the correct frequency from there
on out. Not fantastic stability, but should be entirely usable for AM
reception. Of course there is lots of room for improvement, but I thought
it neat anyway. :) The PWM could be upped to 10bits and the frequency
counter gate period increased. This would allow _much_ more precise
frequency control than I presently have.

If you are interested, here is a 10Hz "huff-puff" VFO stabilizer
version by EI9GQ.
http://homepage.eircom.net/~ei9gq/stab.html
Perhaps you could combine his and your ideas.

Joop
 
Top