Byron J.

Member Since: September 10, 2013

Country: United States


Apparently, the J is for JFET.

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


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 Hookup Guide

August 14, 2014

How to assemble and use the SparkPunk Sequencer kit.

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 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.
  • 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.

  • There’s one little piece of trickery in FreeRTOS you’ve missed.

    FreeRTOS has some hooks that allow the user to add functionality to the heart of the system. You can read a bit more about it in their Hook Functions page.

    This port assigns the loop() function to the idle task (in FreeRTOS_AVR/idlehook.c). It’s not called by the Arduino boilerplate, instead by the scheduler when no other tasks are ready to run.

  • I’ve used it with a RedBoard (Uno equivalent) and ProMini, under Arduino 1.6.5.

    I haven’t looked any closer at the ARM side of the family, so we’ll have to take the readme at it’s word.

  • A funny effect of intermixing markdown and raw HTML.

    The text is correct in our CMS.

    Apparently the pointy brackets were being translated as an HTML tag, and not displayed by the page rendering code. I’ve replaced them with > and <, and it seems to be OK.

  • Try <FreeRTOS_AVR.h>

    Somehow it fell off in the cut/paste. I’ll go fix the example.

  • These are indeed make before break, knows as “shorting” in the parlance of the datasheet.

  • It sounds like something isn’t right. It should power up without issues.

    What servo motor are you using?

    Also, what power supply are you using?

    If you can provide links or part numbers for those, I can try to recreate the situation here.

    Since you encounter problems when you power everything up together, but it works OK if you power up the trigger, then add the servo, it sounds like there might be some startup interaction between the motor and the power supply. If you have an oscilloscope (or even a DC voltmeter), watch the 5V line while you power up, and see what happens - if it dips or spikes, it might be causing the servo or trigger to get confused. I’ve seen servos draw an amp or more right when they start, then settle to a much more reasonable draw, maybe 20 mA.

    There’s some more info about this in the hookup guide, in the Power Notes section.

    If you can substitute a different servo or power supply (like 3 flashlight batteries), that might help isolate what’s going wrong.