Parallax Propeller / precise time and frequency projects

20-Dec-2020

Introduction

This page describes several precise time/frequency projects based on the Parallax Propeller chip. The Propeller is an innovative 40-pin, 8-core, 80 MHz, 32-bit microcontroller with several features that make it useful for perfect cycle accurate timing.

In the world of precise timing, instruments that measure frequency, or period, or time interval are common tools. Some of these instruments also count pulses, measure pulse widths, determine duty cycle, or compare phase over time. It turns out that simple microcontrollers can perform some of these tasks. Let's explore this.

Background

To this day I continue to use $1 8-bit Microchip PIC microcontrollers for low-jitter, precise time/frequency projects. See picDIV for a series of digital frequency dividers. See picPET for a series of precise timestamping counters with 400 ns resolution. More info at the main PIC timing page.

In spite of their convenience and low cost these 8-pin PIC 12F675 chips are somewhat limited. For example, although the picPET makes a nice timestamping, or period, or frequency counter, it is awkward to pair two of them for start/stop time interval measurement. Also, scaling to 4 or 10 of them to make simultaneous measurements of multiple clocks is even more tedious.

I wanted a MCU with absolute deterministic timing, higher resolution, faster data rates, and more input channels. When the Propeller chip appeared in 2006, I knew it was worth implementing my PET project (Precision Event Timer). Yes the Propeller is 10× more expensive than a PIC, but compared to my PIC-based picPET, the Propeller-based ProPET has 32× better resolution, 6× more channels, and 6× faster data rate. You could argue it's a thousand times better at only ten times the cost.

Propeller

Parallax, Inc. designed the Propeller after the success of their PIC- and SX-based Basic Stamp. Having been a fan of Parallax since it began in the early 1990's I wanted the Basic Stamp and Propeller to succeed. Unfortunately for them, the Arduino concept was born and took over the hobbyist world. If that wasn't enough, ARM is now killing PIC and AVR, maybe even x86. Then another bomb; Linux exploded into the embedded world. As a result the Basic Stamp is a relic these days and the Propeller remains an obscure processor that never really caught on. The embedded world moves fast. Now it's moving to ARM-based processors and embracing platforms like Teensy, Beaglebone Black, ESP32, Raspberry Pi, to name a few.

When it debuted 15 years ago, and compared with a 12F-series PIC, I found the Propeller attractive because it has 32 I/O pins, an 8-core architecture, an internal 16× PLL, 100 MHz top speed, zero interrupt latency (because it cleverly and boldly, does not have interrupts), and a single shared coherent 32-bit cycle counter. It thus lends itself to all manner of precise timing applications.

Still, in 2020, I would probably label Propeller as NRND (Not Recommended for New Designs). The Propeller and its ecosystem is a weird outlier. If like me you already know Parallax and its products well, then use the chip for timing. But if not, there are so many other learning curves that are more productive, such as the list of processors and platforms listed above, or even FPGA.

Either way, the purpose of this page is to hand you a ready-to-use solution. No programming required. No learning curve. No Propeller rabbit hole. No debugging. What follows is a series of time/frequency projects, based on the Parallax Propeller chip, that just work.


ProTIC-1 — Propeller-based 2ch time interval counter (A→B)

Description

The ProTIC-1 is my implementation of a time interval counter (TIC) on a Propeller chip. It has two digital signal inputs and one serial output. The elapsed time from the rising edge of channel A to the rising edge of channel B is output over rs232 as a plain ascii number of seconds to 10 decimal places. It's that simple. Here's a photo of a ProTIC.

Specs

Setup

The following shows the input side. The start input (chA, green wire) goes to pin P0. The stop input (chB, red wire) goes to pin P1. Note the chip uses 3.3 V signal levels so add whatever circuitry you need to handle 50R termination, AC/DC coupling, amplification, attenuation, etc. For most of my work recently the signals are already fast risetime 3.3 V CMOS so P0 and P1 can be used without any additional passive or active components.

The following image shows the output side. Pin P14 is the serial output (115,200 baud). This is 3.3 V inverted RS232, which typically goes to a serial/USB adapter. In this case the FTDI-Friend from Adafruit is used. As a side-effect it provides +5 VDC from the USB port, which allows the Propeller to be port powered. There are jumpers on the back: make sure Vcc is 5 V and Vio is 3.3 V. Here we see ground, 5V power, and serial transmit (Propeller-out to PC-in).

The Propeller Mini development board has two onboard LDO regulators so that it can be powered by Vin (7-12 V), or 5 V, or 3.3 V. This photo shows a summary of the minimum connections required. power, ground, 2 inputs, 1 output. It's that simple:

Output

Data may be collected by a PC using any "terminal program". ProTIC is also compatible with TimeLab.
#: ProTIC-1, 80 MHz, 115200 baud, ver 24, 2-chan TIC, A->B
0.0061743250
0.0061449750
0.0061890625
0.0061750125
0.0061745625
0.0061742875
0.0061734625
0.0061886250
Within a few seconds of power-up a comment line is output. After that there is one line for every pair of chA (start) and chB (stop) pulses. Units are seconds. The LSDigit is 100 ps. Note the last two digits are always 00 25 50 or 75 because the resolution of the counter is 12.5 ns. Thus there is no roundoff error.

Timebase

The Propeller Mini contains an onboard 5 MHz quartz crystal. The accuracy is usually within 10 ppm, which is nothing special. If necessary, accuracy can be improved. 1) One way is to apply a scaling correction to any readings from the ProTIC. If you know the xtal is low by 12.34 ppm then simply adjust every reading by (1 + 12.34e-6). 2) Another way is to remove the xtal and give the board (at the now exposed XI pin) a clean, accurate, 3.3 V CMOS clock. On the Propeller Mini the xtal is conveniently socketed. Note that although the xtal usually isn't that accurate, its stability is on the order of 1e-9. For many applications the ProTIC can be used without resorting to an external 5 MHz clock.

Purchase

You can find Propeller chips (DIP and SMD) and various development boards at the parallax.com web site. They also appear on eBay now and then. It is a microcontroller so weird and rare that there are no unauthorized clones of it (I'm not sure if that's a compliment or not).

Download

Once you have a Propeller board you can download the ProPET-1 code ( ProTIC-v24.binary ), install the Windows Parallax IDE, import the file, and upload it to eeprom. This requires a PropPlug USB adapter, or equivalent.

If you don't want to mess with a Windows PC, the Parallax IDE, a USB PropPlug, and all the other details of Propeller programming then contact me and I can send you a pre-programmed, works out-of-the-box ProTIC-1 at cost.

The SPIN and PASM (the native Parallax Propeller languages) source code will be posted at some point too.

Applications

For years amateurs have been playing with DMTD (dual mixer time difference) systems, which require some sort of TIC (time interval counter) or TSC (time stamping counter). It turns out that the precision or resolution of the TIC/TSC is not that critical. This means instead of looking for a fancy $2500 commercial TIC good to ~1 ns or ~150 ps or ~20 ps, one can use a $25 hobbyist TIC that is good to ~1 us or ~100 ns or ~10 ns. The ProTIC has been used with DMTD and found to be a perfect fit. Not only is it vastly cheaper than a commercial counter, but it is also much smaller, uses far less power, is fanless, and glitch-free.

Details

Even professional TIC's, like 53131A/53132A, create trouble when readings get near a phase wrap. This is commonly seen when working with 1PPS or DMTD measurements. As the stop channel drifts too close to the next start channel the counter misses a start pulse while it is still busy processing the current measurement. This is called "dead time".

The ProTIC avoids this because internally it is actually a dual channel timestamping counter. Pulses from both channels are captured independently and asynchronously. What is reported as a time interval is just the delta of two time stamps. Thus no chA pulses are missed, no chB pulses are missed, and each matched pair of chA (start) and chB (stop) pulses create a measurement. True zero (chA coincident with chB) measurements are possible and no false negative measurements occur either.

TODO

ProTIC-3 — Propeller-based 6ch time interval counter (A→B, C→D, E→F)

details coming soon

ProTIC-5 — Propeller-based 5ch GPS time interval counter (A,B,C,D,E → G)

details coming soon

hexPET — Six channel dual edge hexadecimal timestamping counter

This is the Propeller-based timer that I used to analyze the John Harrison inspired, Martin Burgess designed, Clock B in Greenwich, UK in 2015. It captured every rising edge and falling edge, of three different signals, with 10 ns resolution. See Clock B for details.

more to follow

ProPET — Propeller-based multi-channel precision event timer (PET)

details coming soon

Comparison with hp/Agilent/Keysight 53131A/53132A

details coming soon

Comparison with SR620

details coming soon

Comparison with TAPR/TICC

details coming soon


Send comments or questions to tvb