Wednesday, June 13, 2012

CC430: Wireless Development (on-going) Adventure

CC430 is a very great microcontroller. The inclusion of the RF is a big plus. I am currently using this in my project. This uses CC430F6137.




The installation CD contains sample codes for the Chronos Watch. I reused some of the CCS RF codes from the Chronos CD to be able to get started quickly and did some improvements on the codes. For evaluation and range testing, I used Smart RF Studio to test some packet transmission but I am having problems receiving packets of data(using Smart RF Studio in receive mode). Instead, I used another TI's development board with a full JTAG connection (not Spy-Bi wire as what was implemented in the Chronos watch) to be able to receive the data.

I am also communicating to another device which is not a Chronos watch and I used Synchronous mode (since they have a very different preamble and sync word) with Manchester decoding/encoding. I learned this from CC1101's sample codes (it looks like an old code - it has the name ChipCon) - this can be downloaded also from TI's website.

If you will be needing source code samples for:
1. Less than FIFO (fixed packet length)
2. Less than FIFO (variable packet length)
3. Greater than FIFO (variable packet length)
4. Greater than FIFO (fixed packet length)
5. Asynchronous mode
6. Synchronous mode
you need to download this from TI's website as this is not included in the Chronos CD.

Since a customized wireless bootloader update is included in my project, I was forced to use IAR Kickstart (free version) since the sample bootloader code provided is written only in IAR.

Learning CC430 (especially the RF portion) is a little bit challenging at first but as I progressed, I encountered a lot of "Aha" moments. :D

Saturday, July 2, 2011

Fez Panda II... First Run



Fez Panda II is a very great way to learn .NET Micro Framework which is surprisingly open-source . All of the tools needed to develop firmware application for the Fez Panda II are free from the Internet.

On my initial experiment, the creation of Led Blinker, SD-Card accessing, up to multithreading was simplified by the .NET Framework. I recommend to have a good reference C# book as Fez Panda II uses C# as its main language.

Using C# as its main language has so many advantages. There are a lot of references on the Internet. Back then, I was hoping to be able to use C# in embedded systems development. Using C is very good in small systems. But when the program gets very huge, C becomes a double-edged sword. Used rightly, C# will be able to surpass design problems presented by C.

I just hope that Microsoft .NET Micro Framework will live forever, will be supported by the embedded community and will be available to different microcontrollers in the future.

Friday, February 18, 2011

PyScripter: A very good lightweight Python editor.

I am searching for a very good lightweight Python editor. I saw PyScripter, tried it, and fell in love with it. :)

Parsing XML with Python using ElementTree (link)

I am searching for Python XML parser and most of the codes that I had seen today contains lots of code. I saw a very good solution from this blog.

I had some slight modifications. Here is a fully working code.

Thank you so much Troy Grosfield.

Friday, February 4, 2011

What is the best programming language to start with?

Around 2003, I have a friend who would like to learn basic programming and asked me if I could teach him some basic stuffs for novice. I tried to teach C, but it took me time to explain the code line by line from the start up to the end of the source code (like Hello World with some computation):

#include < stdio.h >

int main(void)
{
int a,b,sum;
printf("Hello World!\n");

a=2;
b=5;
sum=a+b;

printf ("2 + 5 = %d\n",sum);

return 0;
}



Around 2008, I have a friend who wants to learn programming and I started to teach Python. Using the same goal above:

print "Hello World"
a=2
b=5
sum=a+b

print "2 + 5 = ",sum


I took less time explaining this Python code than with the previous C code.

Personally, I am in favor of using Python instead of C to those who wants to learn basic programming even at schools or universities. Python is a very good starting language and I am using this language since 2007.

Sunday, January 16, 2011

RedPine Wifi Card: Going through the Sample Source Code

Here's another part of the Redpine Wifi adventure.

My main aim is to modify the sample firmware source code and create a very simple app on Python on PC (and put it on my Android) and display the text on the LCD of the Renesas Starter kit. Another goal is to create a simple display of text on Hyperterminal from Renesas Starter kit.

Renesas and Wifi card in Receive Mode

I modified the recv_cb0 function on the rsi_spi.c file. Source Code Link

At the rsi_initialize_netwrok_config1 (by the way, the netwrok is not really spelled right on the source code) function on network_config.c file, you will see the networkConfig->stLocalPort = 800;. This is the port number in which the client program (like Hyperterminal, a python program that uses socket, etc.) will connect to. Here is a very short Python script to send a string to the Renesas kit and display the text on the LCD.

Renesas and Wifi card in Transmit Mode

This is easier than the receive mode. On the main function of the RSRX62N2201DEMO.c, I just modified the sending on the while loop to be able to see "Hello" periodically on Hyperterminal. Source code link (I included all the things inside the infinite loop and put my sample code inside the #if 1)

Saturday, January 15, 2011

RedPine Wifi Card: Getting Started



The Java Demo Application of the free RedPine Wifi Card is very easy to use. The demo application - by default - can connect to a router with no security key. I removed the security key on my router and tried the included Java demo app and it worked! :D



When you connect it to a router with security key, you need to modify the network_config.h file as stated on the Quick Start Guide. At minimum, here are the things needed to be changed.

Not stated on the Quick Start Guide is that it only supports WPA2 (AES) mode of security and does not support WEP and WPA (TKIP). I was stucked on the testing of the Wifi Card on my secured router (using WEP) because I quickly jumped on making it work and didn't even managed to read first the documentations on the CD (lesson learned here haha). So I just changed my router's key to a WPA2. And it can be controlled now by the Java demo app.

Next is to create a Python app on my desktop and control the Wifi card. Final project is to control the Renesas using Android.