Hello. It's been a while Interests in this hobby comes and goes, but now it's the PIC12F629 and mikroE C compiler I'm currently interested in.
I'm writing code for a 1-sec generator and clock. I'm using Bresenham Zero accumulative-error algorithm from Roman Black. That's where I got the inspiration from to do this project http://www.romanblack.com/one_sec.htm
I'm also going to make the inexpensive xtal oven later http://www.romanblack.com/xoven.htm
Now what I'd like to do is to sync this clock with gps unit that I have (FastraxUP300). It has a 1-sec pulse, and a serial data output (NMEA coded) , but for now I don't have a uart and I'd like to try to lock the phase and speed of the 1-sec generator with the GPS 1-sec pulse. I was thinking about allocating a pin on the PIC to listen for pulses and start the syncronizing prosess if the gps unit is connected to it. How is this possible ? I'm thinking it must be possible to use the TIMER1 (TMR0 is allready running the clock) as a start-stop watch with the gps 1-sec pulse and calculate a new and better Bresenham value for the Bresenham algorithm.. but how should I approach this.
Any other suggestions ? What kind of clock precission can I expect from this method? Will I get better results if I recalculate the Bresenham value by comparing number of seconds error after say one week since last syncronisation?
I'm writing code for a 1-sec generator and clock. I'm using Bresenham Zero accumulative-error algorithm from Roman Black. That's where I got the inspiration from to do this project http://www.romanblack.com/one_sec.htm
I'm also going to make the inexpensive xtal oven later http://www.romanblack.com/xoven.htm
Now what I'd like to do is to sync this clock with gps unit that I have (FastraxUP300). It has a 1-sec pulse, and a serial data output (NMEA coded) , but for now I don't have a uart and I'd like to try to lock the phase and speed of the 1-sec generator with the GPS 1-sec pulse. I was thinking about allocating a pin on the PIC to listen for pulses and start the syncronizing prosess if the gps unit is connected to it. How is this possible ? I'm thinking it must be possible to use the TIMER1 (TMR0 is allready running the clock) as a start-stop watch with the gps 1-sec pulse and calculate a new and better Bresenham value for the Bresenham algorithm.. but how should I approach this.
Any other suggestions ? What kind of clock precission can I expect from this method? Will I get better results if I recalculate the Bresenham value by comparing number of seconds error after say one week since last syncronisation?
Last edited: