[time-nuts] STM32 based thing (was GPSDO Alternatives)
gxti at partiallystapled.com
Thu Dec 6 04:32:38 UTC 2012
On 12/05/2012 08:03 AM, Fabio Eboli wrote:
> I'm seriously thinking to attempt a gpsdo.
> It's mainly to learn something new.
> For some reason I collected some Rb oscillators,
> and I'd like to have a 10MHz absolute reference,
> so I will try to discipline one of the Rb, and
> later maybe an OCXO.
> The project will proceed slowly and there is
> some probability (small, but not null) that
> it will be abandoned, because of time problems
> of the author (could be a paradox?).
> The platform I will try to use is the STM32F103
Coincidentally, my previous time-nut project was built around the same
chip. I built a simple GPSDO using a STM32F103C with a bit of support
circuitry, using the timer in "input capture" mode to timestamp pulses
and act as a coarse time-to-digital converter. I got a simple PLL
control algorithm working but haven't yet refined it so it tracks rather
poorly. My intent was to adopt some of the self-tuning attributes of
NTPns, which I will likely revisit for the next project.
Some more details about what was on the board:
- A NC7WZ14 CMOS inverter to square up the sine wave from the OCXO,
which then feeds...
- A PIC12F1501 as a programmable divider, using TVB's picDIV code
lightly modified to work on that particular chip
- The STM32F103 itself, which compares pulses from the divider to pulses
from the GPS receiver and makes adjustments via...
- A slow 16-bit DAC constructed from a PWM output on the STM32, a
two-pole RC filter, a buffer op-amp, and a third RC pole. This drives
the OCXO's frequency control. The PWM is also tweaked over 16
consecutive periods to add 4 more bits of precision, a sort of crude
- There's also an op-amp to buffer the 10MHz sine wave for 50 ohm
output, and a digital buffer for a 50 ohm PPS output from the divider
Here are the design documents, if you're curious:
The precise parts of course are not important, it's just an example of
things I chose to get the job done. The general shape of it is the same
as many, if not all, other GPSDOs out there. I'm reasonably happy with
the hardware as a GPSDO experimentation platform (but not looking to
sell anything at this time).
The current project, as I've mentioned before, is a self-contained
GPS-to-NTP server based on STM32F107, which has built-in ethernet but is
otherwise very similar to the F103. The finished board won't be nearly
precise enough to compete with a "real" GPSDO as it is based on a small
on-board VCTCXO but should shore up the algorithms enough for me to
revisit the GPSDO again.
-- m. tharp
More information about the time-nuts