Close

Too slow!

A project log for 10MHz Rubidium Standard

I have a working Rb 10 MHz oscillator, so why not give it a nice home?

tomcircuittomcircuit 04/09/2015 at 03:140 Comments

I started on the firmware for the PIC that I chose for this project - the PIC16F887. I had several of these laying around, so it seemed appropriate to use one of these for the job. I also decided to take a try at the Microchip XC8 free C compiler, rather than Sourceboost C I had been using for many years now.

I used a state machine approach for the control code, because that's normally how I think. In this case, it's really simple, so the state machine is a breeze.

One of the goals for this project was also to use a WS2811 based T-1 3/4 LED for the status indicator. These have a pretty annoying PWM-type interface, that runs a bit fast. Unfortunately, so fast that the PIC 16F877 can't generate the proper bit timing when running from the internal 8 MHz clock. I even tried bodging in a 20 MHz xtal oscillator clock, but it was still too slow (why? not sure. wouldn't have expected that).

So, I'm swapping out the PIC 16F887 for a PIC 18F45K22, which has an internal 16 MHz oscillator and a 4x PLL, so I can boost the clock up to 64 MHz. That will most certainly be able to generate the WS2811 bitstream.

So, yes, pretty dumb that I ended up going to a whole new micro just to accommodate the status LED but, hey, that's the way things go sometimes. I'm also eager to work with the PIC 18 series again - it's been a long while since I've done so.

Discussions