I have no clue about micro-electronics and embedded systems. I am a Web application architect and developer, working with very high-level programming languages such as Python (or Perl or Java). I hardly remember assembly language from my childhood experiments with an Apple IIe and almost never touched C or C++. But I have been dreaming lately of rapid-prototyping some advanced non-Web application in an embedded system using my programming skills. So I thought I could share bits of my ignorance here. Please bear with me and give me some hints in order for me to best get out of darkness ! :)
Microcontrollers are now gaining capabilities that are comparable to microprocessors of early personal computers. The two most popular microcontroller (uC) series are Microchip PIC uCs and Atmel AVR uCs. For instance the PIC18F25J10-I/SO costs around 3 or 5 euros per unit at Radio Spares (I am in France: think RS in the UK or Allied Electronics in the USA). It has the following characteristics: 40 MHz, RS-232 capabilities (serial port), a « C compiler optimized architecture », 48 kB of program memory (Flash mem) and around 4 or 5 kB of data memory (SRAM + EEPROM).
There are nice peripherals available, too. For instance this Texas Instrument CC2500 2.4GHz RF data transceiver (= transmitter + receiver) at around 2 to 3 euros per unit or current sensors approximately at the same price. In fact, periphals possibilities are limitless…
For free software hackers, there was a linux version for such chips : uCLinux. But is it still an active project ? I think I read that the comon linux kernel now includes everything that is required for it to run in embedded sytems. What about GNU utilities ? I know there are things like busybox on bigger but still embedded processors (phones). Anything equivalent on microcontrollers ?
There are simulators that will… let you pretend your desktop computer has a microcontroller inside, or sort of. :)
There is at least one C library for microcontrollers. C is considered as a « high-level programming language » in the embeddeds world ! That is to say that assembly language has been the norm. Some higher-levels languages can be used with microcontrollers, including some exotic-to-me Pascal-like languages like XPlo or PMP or Java-like but living dead things like Virgil and… what about my beloved Python ?
There are at least 2 projects aiming at allowing Python-programming on microcontrollers. pyastra is a « Python assembler translator » that can be used with some PIC12, PIC14 and PIC16 uCs. But it looks dead. Pymite looks sexier but not much more active :
PyMite is a flyweight Python interpreter written from scratch to execute on 8-bit and larger microcontrollers with resources as limited as 64 KiB of program memory (flash) and 4 KiB of RAM. PyMite supports a subset of the Python 2.5 syntax and can execute a subset of the Python 2.5 bytecodes. PyMite can also be compiled, tested and executed on a desktop computer.
At the moment, it seems like Python programming on microcontrollers is a dead end. Nothing worth investing time and efforts unless you want to also have to maintain a Python compiler… Same may be true for Java, not mentioning Perl. In fact, it seems to me that the object-oriented crowds are too far from microcontrollers applications to generate enough interest in initiatives such as Pymite, at the moment. Oh, and I am knowingly ignoring C++ which I did not investigate, having no experience in C++.
So what is left in terms of (open source) programming languages that would be of higher level than C ? The best guess I can make is Great Cow Basic, which is a free software Basic (procedural) language. Example programs look nice to me. It has been active recently. And it supports most of the chips I would consider experimenting with.
Next steps for me, I guess, would be to pick a PIC simulator and an IDE for Great Cow Basic (any eclipse plugin ?). Then I will probably have to figure out how a Basic program can be executed on a simulated PIC. And how a PIC simulator can be useful without all of the electronics that would surround it in any real setup. I’ll see that. When I have time to pursue my investigations and experiments in this micro-world.
And piclist is a great site for beginners.
Have you ever tried arduino ? It has an easy development ide ….
I haven’t tried arduino. The project I was referring to in this post may have required smaller components, though.
Anyway, my motivation for experimenting with microcontrollers has dropped down a lot because of my lack of time.
Thanks for pointing to the existence of an IDE for arduino.
PyMite ain’t abandoned:
http://code.google.com/p/python-on-a-chip/
Last update two days ago.
nice work.im interested in java,have you ever tried java before? programming in arduino is good with C, unlike java which is not so hardware friendly.if you have any ideas i believe it would benefit everyone who hits on this page
Also check eLua, embedded Lua .
We have written some FAQ here:
http://www.simplemachines.it/index.php?option=com_content&view=article&id=20&Itemid=44
Check out http://www.synapse-wireless.com/index.php?mainID=3&subID=1&type=product&prodID=1
Can program in python for their gear