Instructables

24 Channel USB Connected LED Controller, upto 1A per Channel

Step 10: Firmware Options and Explanation

Picture of Firmware Options and Explanation
code.png
processingscreen.png
UPDATE: ColorMotion Version 2 is now available, please visit http://www.chromationsystems.com/colormotion.html for more Information. Or utilize the Demostrantion HEX file found in the project files on Step 1.

Available in the ZIP file on Step 1 are a few different firmware options. The Full Featured ColorMotion Compatible Firmware must be purchased from the Store, but the demo version is included and has most of the same features, but has full Live Mode compatibility.

Project 2:

ColorMotion Version 1 Compatible Demo Firmware- 18f4550-ColorMotion-Demo-v1.hex
or
ColorMotion Version 2 Compatible Demo Firmware-18F4550-ColorMotion-FirmwareV2-rev-b-1.hex (recommended)

This firmware is a demonstration version. All features of the Full ColorMotion firmware work except for the uploading and saving of user created patterns and settings. Patterns can still be created and previewed(Demo Button) and will run till the device is powered down. Live communication from a computer to device is fully functional.

There are several patterns included in the Demo Firmware, they can not be changed. The full version of the firmware is available from the The Store.

Project 4:

MonoMotion Compatible Demo Firmware- 18F4550-MonoMotion-Demo-v1.hex 
- Link to Webpage
Similar to ColorMotion, but full of enhancements, additional features, more dynamic pattern storage, and ability to update to future versions, but is used to create patterns for single color LEDs. There are currently a few supported controllers and more will be added.

Processing Application - Live Mode Demo Software - Link to Webpage

The included application, including source code, can be found in the Project files on step 1. The program is used to demonstrate how to control a compatible ColorMotion device using Live Mode communication over USB. Using this software, colors can be selected on a computer and sent to the device to display. The color select options are Sliders, which select Black -> White -> Red -> Green -> Blue -> Purple, or there is an option to open a gradient image, then use the mouse to select the colors to display. There is a Color Cycle button which starts sending the device data that cycles it through all the colors. And lastly there are buttons, Settings Up and Settings Down, that can cycle through the patterns that have been uploaded to the device.

The code is well commented and can be used to create new compatible software or tweak to do what you require.

Project 1:

USB Communication, Old Processing Application - This is obsolete but still included.

Included is an application written in Processing, quite a simple language to learn, it is Java based, so works on most OS Platforms. Included is versions that should work on Windows, Linux and Mac.

It is just 24 sliders, that are labeled 0  - 100, position the sliders then press Spacebar to send the data to the circuit board. It converts the number to 0 - 255 and sends it to be used in the PWM routine. If more or less data bytes are sent, the data used in the PWM, will be out of alignment and the circuit will have to be reset.

Sliders are provided by the G4p library

Feel free to use any of my code for other projects, but please credit if it is released.

Firmware: 18F4550-24chanusb.hex

The firmware included here, written in C18, outputs 8-bit PWM to all 24 channels with the data sent from a Processing application. USB Communication is set up to go to the high interrupt and the simple PWM sequence is done in software in the main() function. But could easily be moved to an interrupt routine.

The project was originally in Microchip's Solutions library, under USB Device - CDC - Serial Emulator. So there are lots of comments and un-needed code still in it. The project already had setup files for the PICDEM USB board, which uses a 18F4550, so it was a matter of changing some lines of code and project setup.

In the Project folder I have included all the USB headers and Includes with in it, otherwise it expects them to be in the default folder, which gets confusing. So it should compile as is after changing the directories.(above)



Converting Microchip Solutions to work with the 24 Channel USB LED Controller, from Microchip's  Solutions Install folder: Any PICDEM Sample Code or Projects can be converted to work with this controller.

Open Project -> Build Options -> Project -> Directories

Add ../.. and ../../.. to Include & Library Search Path

Change include search paths to YourMicrochipDirectory\MCC18\h

Change Library search Path to YourMicrochipDirectory\MCC18\lib

Should compile then.

Converting Microchip solutions to work with the 24 Channel USB LED Controller from a different folder:

Open USB Device - CDC - Serial Emulator - C18 - PICDEM FSUSB.mcp

Open Project -> Build Options -> Project -> Directories

Add ../.. and ../../.. to Include & Library Search Path

Change include search paths to YourMicrochipDirectory\MCC18\h

Change Library search Path to YourMicrochipDirectory\MCC18\lib

Copy the USB folder from YourDirectory/Microchip/microchip solutions/microchip/include to your project directory.

Copy compiler.h from YourDirectory/Microchip/microchip solutions/microchip/include to your project directory.

on Hardware Profile - PICDEM USB.h comment out #define PROGRAMMABLE_WITH_USB_HID_BOOTLOADER