EspoTek Labrador: Five Powerful Lab Instruments. One Tiny, Open Source Board

← View All Updates
Jan 20, 2017

The Rise of the Clock Skew

So, I’m going to be upfront and honest with you: that major software bug from the Christmas update still hasn’t been fixed.  Not for a lack of trying, mind you.  What I thought was the DMA controller not being triggered during a short interrupt actually turned out to be a hellish clock skew problem that stems from an incorrect assumption about the Xmega’s DFLL that I’d been making for over two years.

I’ve managed to force the assumption to be true by building a software routine that recalibrates the Xmega’s system clock on the fly based on integral error between it and the USB start-of-frame signals.  After receiving n USB signals, the routine ensures that the system has run for a total of 24000n ± k cycles, where k is a small constant (~150).  

This has been tested for long periods of time, with instructions to halt if k ever became too large- yet the error still persists.  An error of about 0.004% from ideal, mind you, but that’s still enough to cause the board’s buffer to become corrupt after about 25 seconds.

I’m looking into solutions to this.  The easiest involves running a similar calibration routine on the DMA’s counter directly, in addition to the current one running on the system clock.  This would likely make the problem go away, but it doesn’t explain why it was there to begin with.  In theory, the steady state error should be zero, and this has been tearing me apart for days.  Perhaps it’s time to move on…

Either way, whether the problem gets solved in two hours or in two weeks, the whole of China will be closed from the 22nd until the 4th due to the Spring Festival.

This means that the boards won’t ship until the end of February, or perhaps very early March.

I’m truly sorry about that, especially after the last update made it seem like the hardware was ready to go.  As explained above, I just didn’t see this becoming such a large problem.

There are a couple of upsides, though:

  • When building the calibration system, I found out that there’s a second oscillator and PLL on the Xmega.  The current code actually uses this second oscillator to generate the system clock.The reason why the scope runs at 750ksps is because its sample rate must be scaled down by a binary factor from the system clock, and the system’s clock source was the 48MHz USB oscillator.  With a separate oscillator, it should be possible to run the system clock at 32MHz or and scale that down by a factor of 32, meaning that the scope could run at 1Msps, with nothing more than a software update.  Of course,the current focus is simply to get it working at the nominal speed of 750ksps.
  • Assuming there aren’t any issues with manufacturing and this bug can be killed quickly, there shouldn’t be any further delays with the hardware.
  • By the time the boards rock up, there should be some Android software ready to go.  ;)

As always, if you have any complaints, comments or suggestions, you’re welcome to contact me by email at admin@espotek.com.

Have a fantastic 2017,

~Chris

$22,992 raised

of $9,000 goal

Funded! Order Now

Oct 20 2016

funded on

255%

funded

871

pledges

Product Choices

$5

Support the maker movement!

You will be simultaneously helping the Labrador project and maker movement grow. For every $20 raised through the “Support Now” button, a Labrador board plus microUSB cable will be sent to an organisation promoting STEM education and/or the maker movement.


$29

Your very own Labrador!

You will receive a Labrador board, fully assembled with headers. All you need is your own microUSB cable and you’re ready to go! No soldering required.


$725

Class Set

25 fully assembled Labradors, 25 MicroUSB cables, 25 breadboards and a selection of components to get your students started: there will be resistors, capacitors, inductors, transistors, op-amps, 555 timers, and LEDs! Perfect for teaching a class the fundamentals of electronics.


$2,000

101 Labradors (we ran out of Dalmatians)

A huge pack of Labradors! Perfect for universities. Comes with 101 fully assembled Labradors, 101 microUSB cables, 101 solderless breadboards, and free shipping - a savings of over 40% compared to individual units. Hand these out like candy to first-year students and then watch their interest in electrical engineering grow!

Ask a Question

Have a question not answered in the description above or in the Updates?

Ask EspoTek a Question or Browse the Crowd Supply Guide

Credits

EspoTek

A new, Aussie startup created by a new, Aussie engineering graduate. Our aim is to bring technology to the world that allows everyone to create new things. Labrador is the beginning of this.


Chris Esposito

Subscribe to the Crowd Supply newsletter, highlighting the latest creators and projects: