Wednesday, August 11, 2010

Forget about the hardware and learn C

Many people are afraid of 32-bit microcontrollers, or even 16-bit ones. Why? Because they have lots of pins? Lots of registers? If you are an 8-bit PIC assembly language programmer, why do you think it would be more difficult to program a 32-bit controller in assembler? Or is it that the more powerful controllers are meant to be programmed in C instead of assembler? Many people are afraid of C (let’s not even talk about C++). I have been programming in C for too long now to understand why you would be afraid of C, but I do know that it scares many 8-bit developers and newbie programmers.

This is a shame because new controllers nowadays always come with a free C-compiler. It may be limited in some way, but it is free and gets you started. Also, these new controllers come with evaluation kits that are cheaper and cheaper. The MSP-EXP430G2 kit from Texas Instruments for instance costs only $4.30 and includes two (2) 16-bit RISC processors, a PCB with programmer/debugger and a USB cable. Now that’s value for money. Or what about the STM8S-Discovery kit from STMicroelectronics. True, that is a kit for an 8-bit controller, but it costs less than $10 and includes a programmer and a breakaway controller board with capacitive touch sensor.



Hardware is becoming so cheap that it is becoming much like the paper you write on. Unless you’re an artist, you hardly ever care about your paper, the back of an envelope is often good enough. And it will be the same with hardware. You should no longer care about the platform you are working on as long as you can get your application to work. If you learn a language that is supported by all platforms, you can use whatever processor you like instantly and you’re application will be ready much sooner. The language is the pen, write your article and when it is ready send it off to the printer. They will then reproduce your design in the best and cheapest way. They may even decide to change the microcontroller, which is not a problem as your code was written to be portable.

No comments:

Post a Comment