avatar

Byron J.

Member Since: September 10, 2013

Country: United States

Profile

Apparently, the J is for JFET.

Demonstrating a Teensy Audio-based drum machine.

Continue reading

Rather than a lengthy exploration of a single subject, I'm going to touch on a couple of smaller dishes.

Continue reading

I've got a project on my workbench that I was hoping to share, but I met some unexpected difficulty along the way.

Continue reading

A different approach to the problem we solved last week

Continue reading

Embedded Micro's new IDE and the Lucid language.

Continue reading

Thoughts and ramblings about numbers, plus an interesting discovery.

Continue reading

Examining one of the categories that occupies significant space on my workbench: wire strippers.

Continue reading

Drive the Moog Werkstatt-01 with the SparkPunk sequencer, and starting in on a MIDI-to-CV converter.

Continue reading

Experimenting with optics and imagery.

Continue reading

Servo Trigger Programming Guide

May 26, 2016

Looking under the hood of the Servo Trigger -- using the development environment and some finer details of the firmware.

Continuous Rotation Servo Trigger Hookup Guide

May 26, 2016

How to use the SparkFun Continuous Rotation Servo Trigger with continuous rotation servos, without any programming!

Hobby Servo Tutorial

May 26, 2016

Servos are motors that allow you to accurately control the rotation of the output shaft, opening up all kinds of possibilities for robotics and other projects.

Button Pad Hookup Guide

January 7, 2016

An introduction to matrix scanning, using the SparkFun 4x4 Button Pad.

Discrete Semiconductor Kit Identification Guide

November 19, 2015

Get to know the contents of the SparkFun Discrete Semiconductor Kit.

Preassembled 40-pin Pi Wedge Hookup Guide

October 29, 2015

Using the Preassembled Pi Wedge to prototype with the Raspberry Pi B+.

Raspberry Pi SPI and I2C Tutorial

October 29, 2015

How to use the serial buses on your Raspberry Pi.

MIDI Shield Hookup Guide

October 8, 2015

How to assemble the SparkFun MIDI Shield, plus several example projects.

MIDI Tutorial

October 8, 2015

Understanding the Musical Instrument Digital Interface.

Capacitor Kit Identification Guide

October 1, 2015

Learn how to identify and use a variety of capacitors using the SparkFun Capacitor Kit.

8-Pin SOIC to DIP Adapter Hookup Guide

August 13, 2015

Assembly and application of the 8-pin SOIC-to-DIP adapter.

Rotary Switch Potentiometer Hookup Guide

April 30, 2015

How to use the Rotary Switch Potentiometer breakout board, with some sample applications.

MP3 Player Shield Hookup Guide V15

April 6, 2015

How to get your Arduino groovin' using the MP3 Player Shield.

Servo Trigger Hookup Guide

March 26, 2015

How to use the SparkFun Servo Trigger to control a vast array of Servo Motors, without any programming!

Pi Wedge B+ Hookup Guide

December 18, 2014

How to assemble and start using the Pi Wedge to prototype with the Raspberry Pi B+.

Decade Resistance Box Hookup Guide

December 4, 2014

How to assemble the decade resistance box, then use it as a design and measurement tool.

SparkPunk Sequencer Theory and Applications Guide

August 14, 2014

Examine the inner workings of the SparkPunk Sequencer, then explore some modifications and alternate applications.

SparkPunk Sequencer Hookup Guide

August 14, 2014

How to assemble and use the SparkPunk Sequencer kit.

SparkPunk Hookup Guide

June 12, 2014

How to assemble and modify the SparkPunk Sound Generator kit.

Pi Wedge Hookup Guide

May 29, 2014

How to assemble and start using the Pi Wedge to prototype with a Raspberry Pi.

Sound Detector Hookup Guide

February 27, 2014

The Sound Detector is a microphone with a binary output. This guide explains how it works and how you can use it in your projects.

Large Solderable Breadboard Hookup Guide

February 27, 2014

This breadboard has a couple of tricks up it's sleeve!

VKey Voltage Keypad Hookup Guide

February 13, 2014

A quick hookup for the VKey analog voltage keypad.
  • The buttons & LEDs are tied to the SPI port of the microprocessor using shift registers. A daisy-chain of three parallel-to serial for the buttons, three serial-to-parallel for the LEDs. They’re read using an three-byte SPI transaction. It reads the switches, and as a side effect, updates the LEDs.

    The switches are on a PCB I designed for the purpose - there are three of the PCB in the system.

    Once it’s read the three bytes from the registers, it compares the new values to the previous values. If they’re different, it sends button pressed messages to the editor routines. The editor routines translate button presses into actions.

    If you want more specific details, check the source files – everything is in the repository. The PCB is under /hardware/, and the software is under /TeensyBoom/. Panel-scanner.h/cpp, editor.h/cpp, and editor-modes.h/cpp are the foundation of the button interface.

  • Yes, it does. The 40-pin connector on the Pi 3 is the same as on the 2.

  • Are you using the CC3000 shield?

    That error message contains a nugget of truth: the SD card chip select lines are different between the boards.

    The MP3 shield uses D9 as SD_CS. The Wifi shield uses D8 as SD_CS.

    If we follow D8 and D9 around both boards, there are other conflicts. D8 is the reset pin on the VLSI chip on the MP3 shield! If you use the SD socket on the wifi shield, every time you select the card, you’re also resetting the MP3 player.

    My recommendation would be to use the card slot on the MP3 shield.

  • I don’t know if the 47 Effects library is up to date with the latest automatic Arduino library manager format. You might have to install it manually. I installed it by copying the contents of the /src/ directory into my Arduino library directory: C:\Users\byron.j\Documents\Arduino\libraries\MIDI

    After that, when I start Arduino, MIDI simply shows up in the ‘sketch->include library’ menu. You don’t need to ‘add…’ or ‘manage…’ the library.

    It’s building in Arduino 1.6.5, running under Windows 7.

    Perusing my libraries directory, I see a number of other libraries with underscores in the directory and file names, so I’m not sure that’s the problem.

  • The board outline is 1.7" by 0.9".

    The mounting holes are 0.125" in from each corner, and 0.13" in diameter, for 4-40 machine screws.

    The dimensions are in the Eagle BRD file. Turn on layer 47 (“Measures”) to see them.

  • I think one of the things that makes a matrix useful is that it doesn’t require very many extra components…but it requires some careful coding to keep the columns and rows straight.

    If you’re really being frugal with processor pins, then you could use shift registers, as you describe. I think the SPI interface would be plenty fast - it’s max rate is fosc/2, or 8 MHz on a 16 MHz Arduino. My scan takes about 2 mSec per column. That’s 16,000 bits at the max SPI rate. Seems reasonable.

    You could also arrange the SPI bus so the input and output registers are a single shift loop, all with a common chip select. One shift operation would shift in the switch input, while shifting out the next column selection.

    Saving chip selects might be useful, because shift registers often need some additional signals to get the data to latch. Off the top of my head, the 74HC595 and 74HC165 are double buffered, and have a signal that needs to be strobed to get the serial data to/from the parallel pins.

  • I got bored after 8 tasks on an R3. Each of those tasks was pretty trivial, not calling any further functions that would put a bunch more on the stack (IE: not calling printf()). This was using only the MINIMAL stack size, which I believe is 100 bytes.

    The stacks are allocated on the heap when the task is started.

    One of the nice things about this FreeRTOS port is that it’s distributed as source code. If you want to see how something is implemented, you can go read it. Actually reading it can be a little challenging, though, because it uses several layers of macros to keep it portable, and sometimes you have to unravel a bunch of nested references to find out what something really is (thus my hedge on the actual size of minimal stacks…).

  • There are a few things that you can check.

    First, make sure you’re declaring the Vkey library to match your power supply voltage in the sketch. The VKey::FIVE or VKey::THREE parameter, denepding if you’re in a 5V or 3.3V power supply. Also doublecheck that your connections are secure – that the buttons are soldered in neatly, and the power, ground and output connections are all solid. I recently chased my tail for a couple hours because an alligator clip was barely hanging on the end of its wire.

    Second, use a volt meter or oscilloscope to verify that the power supply is stable and sensible. Measure both VDC and VAC. The DC reading should be close to the nominal rating (3.3V or 5V), and not wiggling around. The AC reading should be close to 0 – an unstable supply will exhibit some AC voltage, and will wreak havoc with the VKey.

    Third, with the voltmeter still in hand, exercise the keys, measure the output voltage, and compare the results with the table in the hookup guide. While a key is held, the output voltage should be steady.

    Finally, you might glean some clues if you bypass the library, and call analogRead() directly. Are the conversion values reasonably steady?

  • This is actually a huge topic in RTOS programming – big enough that I didn’t want to even try to touch it in the post.

    You’re correct to assume that chaos can ensue if the data is freely accessible by any task. A given RTOS will have a number of features to allow data to safely move between threads. Different types of interaction call for different schemes, and learning how to use them is a big part of RTOS programming. The FreeRTOS structors for this are documented in their Inter Task Communication document.

    If the data in question is flowing unidirectionally from the one thread to the other, the monitoring thread could send a message to the other thread when data is ready. Messages can flow through queues (somewhat akin to pipes in unix/posix).

    Threads can also send simple binary indications between one another using semaphores – a semaphore being a more rigorous version of a flag. The frBlink demo sketch has an example of two threads using a semaphore.

    If the system is a free-for-all, with multiple threads all trying to read and write the global data, you can protect the data using a mutex, so that only one thread has access to it at a time. In my mind, A situation like this is an indication that the design might need further refinement – perhaps the data needs a thread of it’s own, with a more formal interface.

  • I think it’s a perfectly fair criticism of the example. Bringing familiarity of Arduino, and reading the example I posted, you reached what appears to be the obvious conclusion.

    FreeRTOS under Arduino quickly reaches a point where two very different approaches to structuring applications are coexisting, and we need to understand some of the subtleties of both approaches to get them to work together effectively.