Close

Working on firmware, Teensy audio library patches.

A project log for Teensy Beats Shield

An all-in-one, made to hack step sequencer built around the Teensy platform with LiPo charging, touch TFT, encoders, buttons, and RGB leds.

chris-millerChris Miller 09/22/2018 at 04:450 Comments

I've worked entirely on the firmware for the last few days, since the boards are on order and I can't make any hardware changes until I test them.  I found a limitations of the Teensy audio libraries that hindered progress.  So I submitted a few pull requests to the Audio and Teensy core libraries.  These allow effects that are connected at compile time to be bypassed at runtime.  This will enable a more flexible experience, with things like reverb selectively enabled through the UI.  Hopefully the PRs will be accepted at some point.

The latest commits enable the touch screen, and connect the home screen to note selection.  This also paves the way for an octave keyboard screen, which currently just displays the keys.  I'll be hooking up note generation tonight/tomorrow.  Once that's working, song making will get more exciting.

I also had some trouble with the battery charge detection circuitry and code.  In my board design, I copied the Adafruit power boost 1000c charger closely.  I used the existing status lines to both drive LEDs and signal to the MCU the current charging status.  Tonight I found that because I do not check the "power good" signal, and because those status lines are connected to VBUS, I cannot reliably detect when no battery is connected.  The solution required a little brain bending.  These lines appear to be floating when the battery is not connected.  They rapidly fluctuate between high and low. To detect this situation, I added a pin change interrupt on these pins.  If the pin changes within a certain threshold (200ms), I increment a counter.  If that counter indicates that the pin is fluctuating rapidly more than 3 times, I can deduce that I am in the floating state.  When both status lines are floating I display "No Batt".  So I now have a voltage reading, a charging reading, and a no batt reading.

Discussions