[time-nuts] yet another version of PIC 1pps code, for 16F1823

Richard H McCorkle mccorkle at ptialaska.net
Thu Mar 3 00:40:59 UTC 2011


Hi John,

Nice port to the 16F1823 but there are a couple of changes I would make
so the 5M/10M select and 10k resets get disabled in the 26M mode. For
a 26M clock the 10K output should be reset 130 instructions after the
output at the start of the loop to give a 20% duty cycle output. The
50% output will be correct as it changes only at the start of the loop.
The OutByte can be inverted and loaded into W after the delay, so a
separate StoreTemp register isn't needed. See the attached file for
the changes I would have incorporated for your application. I hope
you had fun customizing the divider and can find uses for similar
code in other specialized divider applications.

Good Job!

Richard


> I got some of the cheap Pletronics OHM40480526 26MHz OCXO parts for
> experiments (couldn't resist $2 each :-). For this purpose I modified the
> Richard H McCorkle/Tom Van Baak code for generating a 1 pps output from a
> PIC, to work with 26 MHz input, and also target the PIC 16F1823 since
> that's the part I had handy. But, being new to the PIC16F family it took
> some time to get all the configuration bits correct. So in case anyone else
> is in that position, here's the code I ended up with:
>
> http://bealecorner.org/best/measure/time/source/PIC16F1823-26MHz-1pps_asm.txt
>
> My M12T+ GPS board is coming on a slow boat from China, so I don't yet have
> any real standard to compare this with.
>
> But I set up two OCXOs driving two PICs, and compared the two 1pps outputs
> on a 2-ch scope, after tweaking my 10k 10-turn trim pot feeding the ADJ pin
> on one part to be pretty close in frequency to the other. I see a slow
> steady increase in phase lag, accumulating 167 ns in 7 minutes, so I have a
> frequency difference between my two oscillators of 1.67E-7/420 = 4E-10 or
> 0.4 ppm. For better measurements I guess I want a PIC-TIC or equivalent.
>
> -John Beale
>
> _______________________________________________
> time-nuts mailing list -- time-nuts at febo.com
> To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> and follow the instructions there.
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PIC16F1823-26MHz-1pps.asm
Type: application/octet-stream
Size: 15413 bytes
Desc: not available
URL: <http://www.febo.com/pipermail/time-nuts/attachments/20110302/e5707bf7/attachment.obj>


More information about the time-nuts mailing list