The background bits
The proposal for this roadtest plus was written around the TI TPS92512 which is an LED Driver Buck converter. The idea was to design a 4Channel Lighting solution along with a variety of LED panels. In addition to RGB Lighting Panels, it was proposed that custom ones can be made using special LEDs for agricultural lighting more commonly known as ‘Grow Lights’. Additionally, the control over the colour as well as intensity of the lights should be controllable over say Wi-Fi which can be accomplished by using a CC3200. The system is to be designed in an enclosure that can replace the conventional home or industrial lighting hence the title “Multipurpose Modular Light Bar Project”.
In the previous posts, I showed you what my PCB looks like. I made a booster pack so that it can be used easily and sent it for fabrication. This time I go on to program a TI CC3200 LP to make a WiFi Connection for my light. Lets go...!
The premise
I wanted to have a wireless connection to the light so that I may be able to control the color, brightness etc like in the case of phillips hues. I however wanted something that I could modify to have four channels so that I may use my own make and color of LEDs. This ofcourse later will be used for a hydroponic garden I have already setup BUT right now the point is to have a wireless connection. I had an assortment of options from 433MHz AM modules, to a cc2500 with MSP430 or Si4455s or LPRS eRICs or even my fav CC110L. I even bought a Cypress PSoC BLE kit to experiment with because writing firmware can be a tad bit boring at time. At this point I decided to try out Energia with the CC3200 and I had tried it before but I have had... issues.
My past experiences involved messing with service packs and there were a lot of problems with the REV3.2 board and the newer service pack. Long story short- it did not work out then and now I have a new project and so Energia was given a go.
Energia?
Skip this section if you have already used energia.
So what is Energia? Energia is TI's delayed answer to Arduino- Simple! AVRs rule the DIY world because they are easy to use and that is due to the enormous community and the arduino IDE. Its based on processing IDE and is written in Java. The compiler is GCC and it can be ported to most OSs and for the most part, you don't need to 'install' anything. Just copy the whole folder and bam! You are ready for the show. No messy configurations etc. You select the boards from a list and there is a library of demo code which comes with the thing, ready to go.
The downside? Its more or less based on prewritten C code like if you want to set a pin HIGH, then you call
digitalWrite(myPIN, HIGH);
which in turn passes your arguments to somewhere else and then the compiler is supposed to convert it into assembly blah blah blah. You get the point. In short, if you are an absolute control freak(like me who has memorized ASM for 8080, 8086, 8051 and AVR to the instruction cycle- I teach this stuff to undergrads!) you will never be truly happy. That is one of the reasons why I usually go Assembly or C that I know how to write and which I can predict most of the time. Energia comes in when you are either a beginner or a non-engineer or a lazy engineer ... like me in this instance. There is library for getting wifi up and running and that was my interest here. I did write a C application for a few CC3200 projects sometime back but I am not going to talk about that here. Maybe later.
Setting up the launchpad
Sounds interesting but its actually just a sequence of steps that you have to follow... EXACTLY OR YOU WILL DESTROY TIME AND SPACE!!!!
Just kidding. The CC3200 is a pretty tough cookie. Here is what you do.
If you have just taken out the LP out of the box, you should check the version of the board and the silicon. There are labels in the board that identify it like in my case REV 3.2 which tells me that its not the latest board and the latest software or firmware updates may not work for me. See the images below from http://www.ti.com/lit/ug/swru372b/swru372b.pdf
Next we need to checkout the part or silicon number. In my case it is the XCC3200HZ which is preproduction version as per https://e2e.ti.com/support/wireless_connectivity/simplelink_wifi_cc31xx_cc32xx/f/968/t/399389 and there are 80Kbs used for internal purposes. The service pack release notes at http://processors.wiki.ti.com/index.php/CC32xx_Release_Notes also tell us that the device is indeed supported. Cool! Lets move on.
For our exercise we want to use the Energia platform and in my case i had already use my launchpad for previous applications. Hence I downloaded and installed the standalone version of uniflash from http://www.ti.com/tool/uniflash and when your run it,
There is an option to 'Format' which is what we need to do. Connect a jumper as shown in the image below and then the launchpad to the USB port. Type in the correct port number and when it asks for the size, simply enter 1MB.
At this point, my launchpad is pretty much good to go. Note that if you are trying to update the firmware, the instructions can be found http://energia.nu/cc3200guide/
Doing the Energia
The CC3200 is an internet on a chip device so instead of the conventional Blinking LED, I setup the MQTT Demo. Start Energia and then... Follow the screeshots...
The Hello WiFi example is pretty straightforward and all you need to do is supply the Wifi Access Point Name, password and MQTT Topic. Done. To program the board, again connect the jumper as before and then reset the launchpad. Next use the Energia's Upload button and it should tell you that the board was successfully programmed. Take out the jumper and reset the board and when you do, it will connect to the access point and start sending messages via MQTT. Use your favorite MQTT Client to subscribe to the topic you mentioned and you should see the CC3200 talk!
I was unable to get the Demo video up but you can browse this link https://vine.co/u/1287373220458483712 for some 6sec clips of the work in progress.
Project Status
My PCBs are officially lost. They were received by someone while we were not and home and possibly one of my neighbors has them but will not confess. I will be ordering a new batch this week in the hopes that they reach in time BUT if they do not, I have a plan B which is not as fancy but will demonstrate the Project none the less. I am getting less and less time to post updates due to overdue papers that I was supposed to write as a part of my PhD work and that coupled with the fact that we are expecting a child any day now has left no wiggle room for project work. Most of my Lab has been moved to the university where my engineering students are crunching stuff everyday so that should be interesting. I will prolly have just one or two more posts for this Roadtest+ before I sign off.
Catch ya next time.
Cheers,
IP
Top Comments