Archives

All posts by Leo Hendrawan

While writing C codes, many times you will need to write an array of input-output like pairs table. One of the most common example is to have a table containing state/command – function pointer pairs, which basically is a look up table of the function pointers to be executed based on the given input state/command. In this case, you would probably want to use X-macros to avoid/reduce mistakes in your code. Here is great tutorial on how to use x-macros for this purpose which I found on embedded.com:

http://www.embedded.com/design/programming-languages-and-tools/4403953/C-language-coding-errors-with-X-macros-Part-1

http://www.embedded.com/design/programming-languages-and-tools/4405283/Reduce-C–language-coding-errors-with-X-macros—Part-2

http://www.embedded.com/design/programming-languages-and-tools/4408127/Reduce-C-language-coding-errors-with-X-macros–Part-3

It is really worth to spend 30 minutes reading it!

While writing codes, a lot of times I need to do some math calculation which I did on paper/calculator only to get some constant values (e.g. hardware register settings, etc.). Either you realize it or not, these kind of calculation tasks can be really simply done using the C preprocessor to get the job done.

Continue Reading

The CC3000 SDK (Software Development Kit) contains examples for MSP-EXP430F5529 development kit + CC3000EM. The MSP-EXP430F5529 (TI e-Store price: 175 USD) is far more expensive than the MSP-EXP430F5529LP Launchpad (TI e-Store price: 112.99 USD), and the CC3000EM is no longer available, replaced by the CC3000BOOST. This short guide shows how to modify the examples delivered in the CC3000 SDK (for MSP-EXP430F5529+CC3000EM), so the same code can run on the MSP-EXP430F5529LP Launchpad + CC3000BOOST boosterpack.

Continue Reading

In my previous post, I have shown the step-by-step guide to compile the basic hello-world demo of Contiki 2.7 for CC2538DK on Windows. Looking into the list of examples, the Contiki 2.7 is also delivered with a CC2538DK specific example which is located under contiki-2.7/examples/cc2538dk. The example shows basically basic input-output operation (push-button input, LED output), and also basic Rime broadcast communication (Rime is the light-weight wireless protocol used in Contiki).This blog post describes step-by-step guide to compile, run, and analyze the cc2538dk example of Contiki 2.7.

Continue Reading

The CC3000 comes with an interesting way on how to passing the information of WLAN network (SSID and password) to the CC3000 embedded WiFi device to which it shall connect to. This technology is called the SmartConfig. It basically uses another host (could be smart phones or PCs) to send out some packets to the air which are neglected by any other devices on the network (since the packets look meaningless to the other device,will show it later), but can be interpreted by the CC3000. In this guide, I will show how a step-by-step guide on how to work with SmartConfig technology using the Basic WiFi Host from my previous post and also the SmartConfig Java Applet from TI.

Continue Reading

I had the chance to play a bit with the CC3000 Boosterpack which can be used together with the MSP-EXP430G2 Launchpad, and it seems like a very interesting device. It enables WiFi/Internet connection for microcontrollers with small memory size. The CC3000 works such as network processor running a TCP/IP stack which basically does the whole stuffs related to the WiFi/Internet connection, and users need only to implement the application on the host microcontroller. A very nice thing from the software point of view which I found also is that the host source code uses similar API to the BSD socket which is basically the standard API for socket programming .

One of the basic example provided for this kit is called the Basic WiFi example, where basically the MSP-EXP430G2 Launchpad kit is connected via USB to a PC and receives command to execute some basic functionalities such as connecting to a WiFi Access Point, opening a UDP socket, sending and receiving data via the UDP socket, etc. It is basically a nice example to get started working with the platform, however I find it a bit hard to test the example since you need to work with hyperterminal and type in the command code manually. Therefore I decided to write a python based script tool running on the PC which can be used as a host for the CC3000 Basic WiFi example, and it can be found here.

Continue Reading

So finally, I made it to make my first post about wireless communication. I have been playing with TI’s SimpliciTI protocol stack for a while now, and I have seen a lot of cases where people have a common issue when people trying to use the stack with their own custom hardware. There is a small guide on TI wiki on how to debug the RF link which can be found at the following link, however I found out an additional simple test mechanism which can help people deploying the stack on their custom hardware.

DISCLAIMER: before we start, just want to give a disclaimer that I am basically more a software guy than hardware guy (in fact I almost know zero about antenna tuning on RF hardware), so I am basically writing this small guide from the eye of a programmer :)

Continue Reading