Patience is a virtue

I found the bug in the TCD1304 driver firmware, or maybe I should rather say that I publicly exposed a flaw in my personality. I’m too impatient.

In the previous firmware the integration time was set to 1 s by default. Because I couldn’t always wait 1 s from I reset the nucleo board before pressing ‘record’ I got the aforementioned unpredictable behaviour.

I’ve long ago realised that it’s much easier to change my surroundings than my personality, and so I’ve changed the new default integration time is 20 µs. This gives the nucleo time to catch it’s breath before I try and interact with it after a reset.

This small but significant change ensures consistently good behaviour. And here is what may well be the last revision of the firmware for STM32F401RE in a long time:

Source code for the TCD1304 driver

You may also find it on hackaday.io. There’s also a short one-page-write-up of how to get everything up and running, in case you don’t feel like reading through every other post I’ve made on this blog.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s