Tutorial: Adafruit WS2812B NeoPixels with the Freescale FRDM-K64F Board – Part 5: DMA

This is Part 5 of a Mini Series. In Part 4, I described how to set up the FTM (Kinetis Flex Timer Module) to generate the required waveforms used for DMA operations (see “Tutorial: Adafruit WS2812B NeoPixels with the Freescale FRDM-K64F Board – Part 4: Timer“). In this post I describe how to use to trigger DMA (Direct To Memory) events. The goal is to drive Adafruit’s NeoPixel (WS2812B) with the Freescale FRDM-K64F board:

FRDM-K64F with Adafruit NeoPixel

FRDM-K64F with Adafruit NeoPixel

Continue reading

Advertisements

Slow 32 kHz Oscillator Startup

In an IoT (Internet of Things, see “IoT: FreeRTOS Down to the Micro Amps“) project I’m using the Freescale KL15Z microcontroller. The nodes are moving around, and the board is using a special inductive charging ‘on the fly’ when nearby the charging station. The energy is stored in capacitors, so no batteries are needed. That worked very well, but some system failed: they need to quickly check sensor signals after power-up. Tracking down the problem, it was obvious that most of the systems failed because it took them too long to boot from the power-on reset. So I instrumented the application to toggle an LED so I can monitor what happens: It was over 400 ms after power-on! Yikes!

413 ms for startup

413 ms for startup

Continue reading

Getting Bluetooth Working with JY-MCU BT_BOARD V1.06

For my embedded course at the University of Lucerne of Applied Sciences and Arts I needed more Bluetooth modules for the Zumo/Sumo robots. I run out of stock as the modules are getting popular and are used in many student projects. So I ordered a handful more from DX/DealExtreme of the same HC-06 type/part number I already ordered a while back. I expected that they will work as the modules I had ordered from DX half a year ago. Was that naïve? Probably. Because they did *not* work, and caused me to reverse engineer the modules and to apply a hardware fix to get them working….

Set of JY-MCU Bluetooth Modules

Set of JY-MCU Bluetooth Modules

 

Continue reading

Processing the Pololu Motor Shaft Encoders

For the first generation of the INTRO Zumo robots, I have Pololu optical wheel encoders (see “Adding Quadrature Encoder to the Zumo Chassis“) which were available last year. It seems that Pololu heard my feedback, and are offering new encoders. Time to move things to the next level, using an optical encoder attached to the motor shaft:

Optical Motor Shaft Encoder

Optical Motor Shaft Encoder

Continue reading

Freedom Logic Analyzer with DMA

The FRDM-KL25Z Open Source Logic Analyzer based on SUMP presented here was already very useful with the added trigger support. But it was not capable to do a sampling rate above a few hundred kHz. That’s ok for slower probing, but not for anything with a higher speed. Using DMA (Direct Memory Access) instead of timer based sampling can remove that limitation :-).

FRDM-KL25Z used as Logic Analyzer on another FRDM-KL25Z board

FRDM-KL25Z used as Logic Analyzer on another FRDM-KL25Z board

Continue reading

Tutorial: PWM with Processor Expert

For many of my applications I’m using a PWM (Pulse Width Modulated) signal. One example is the motor driver used in this project where I use one PWM signal for each motor. Another usage of PWM is to control the brightness of an LED. Processor Expert makes usage of the PWM hardware easier. Still, for some settings it is good to have the resulting signals in mind. So in this post I’m showing how the settings impact the PWM signal generated.

Continue reading

Freedom Logic Analyzer with Triggers

The first FRDM-KL25Z Freedom Logic Analyzer firmware was missing one important feature: Triggers! But this weekend the firmware has evolved a bit :-).

Triggers

Trigger Settings

Trigger Settings

Continue reading

Be Aware of the Baud Problem

I’m using serial communication in different flavors for my project: with the shell, with OpenSDA USB CDC, to use printf(), and with the Bluetooth module. Processor Expert is a big helper, but as for any software, it is not bug free. And there is a problem with Processor Expert in CodeWarrior for MCU10.3 in respect with Baud settings for a serial interface.

Probing the Bluetooth Module Serial Connection

Probing the Bluetooth Module Serial Connection

Continue reading

Turning the Freedom Board into a Logic Analyzer

I think the most important tool for a firmware engineer is a Logic Analyzer. I always have one on my desk. Working in different locations, sometimes I forget to carry it with me. And  for sure I would need it. To buy another one to compensate my laziness? Or maybe there is another solution? And here I stumbled over an article about the Logic Sniffer project recently: it is about an open source logic analyzer hardware and firmware project. What a cool idea! Why not using my FRDM-KL25Z Freedom board as a Logic Analyzer? Heck, that would be awesome 🙂

I2C Capture with Decoder

Logic Analyzer with the KL25Z Freedom Board

Continue reading