k64f lcd panel adafruit made in china
This is Part 3 of a Mini Series. In Part 2, I described how to set up the development tools and to debug the first project (see “Tutorial: Adafruit WS2812B NeoPixels with the Freescale FRDM-K64F Board – Part 2: Software Tools“). Now it is time to look into the software concepts. The goal is to drive Adafruit’s NeoPixel (WS2812B) with the Freescale FRDM-K64F board:
This article explains the protocol and timing to talk to the WS2812B (or Adafruit NeoPixel) LEDs. It explains an approach with timers and DMA to meet the hardware requirements. I’m using GNU ARM Embedded (launchpad) tools with an Eclipse based IDE (Freescale Kinetis Design Studio v3.0.0). As software drivers I’m using the Freescale Kinetis SDK v1.2.
The WS2812B is the never variant, and has slightly different timing. The newer Adafruit NeoPixels are all WS2812B. As the timing has some tolerances, I’m driving it with the following timing for ‘0’ and ‘1’ bits:
That way the operation can happen in the background, without CPU involvement :-). And good new is: many modern microcontroller have DMA capabilities, and the Kinetis K64F on the FRDM-K64F board does have it too :-).
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:
In this article I use DMA (Direct Memory Access) to do memory to memory operations to generate the required bit stream for the WS2812B LEDs. In the previous tutorial I have used the FTM of the FRDM-K64F device to generate three signals:
I’m using DMA on the FRDM-KL25Z board for things like reading ports in a DIY Logic Analyzer, or driving WS2812 pixels. The ARM Cortex-M4F microcontroller on the FRDM-K64F board has an eDMA (enhanced DMA) controller on it. It can use up to 16 independent DMA channels for DMA operations, with advanced source/and destination address calculations. That eDMA controller is described in the K64F Reference Manual.
I have a K64F board connected to an Adafruit LCD backpack [schematic] that I have verified works on an Arduino. The backpack is basically an I2C device, an MCP23008 [datasheet]. The backpack is running on 5V.
In setting up a Parallax Propeller micro-controller(3.3v) to work with a Matrix Orbital LK204-25 LCD (5v) using a I2C interface, I needed a bi-directional logic-level converter. This module/board worked out great. I needed only two channels for the SDA & SCL I/O lines, but having an additional two channels on this module/board will be useful for future expansion.
I realized that I need 6-bit converter. So I"ve re-designed and laid out 6-bit converter with BSS138 MOSFET. Now waiting for my board to arrive from being fabricated. That way, this board will make a nice interface board for the SparkFun Micro OLED Breakout (LCD-13003). Less wiring!
I had a Kinetis FRDM-K64F that spoke 3v3 I2C, and an Adafruit LCD Backpack that only spoke 5v I2C, and couldn"t trigger off 3v3. This converter was exactly the thing to get the two talking.
To download. click the DOWNLOADS button in the top right corner, rename the uncompressed folder Adafruit_ILI9341. Check that the Adafruit_ILI9341 folder contains Adafruit_ILI9341.cpp and Adafruit_ILI9341.
Place the Adafruit_ILI9341 library folder your arduinosketchfolder/libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE