views:

1064

answers:

13

Recently I've been playing with an Arduino board as one of my hobbies, I'm having lots of fun with it and I'd like to get into circuits etc in a much bigger way. I've done a lot of research on various avenues I could go down, but I'm sure some of you guys know which books/sites are best.

I'm comfortable in c++ and c# , I know there's a board that you can write c# code for (also see the net Micro Framework) and most chips use c, please feel free to answer any number of the following questions.

1) What are the best books/sites for someone looking to break into writing for microcontrollers, eg I've heard avrFreaks has lots of info (Most important question)

2) Is it true that for the majority of controllers C is the only choice? No OO possible?

3) Is there any emulation software that would give me a virtual microcontroller and let me try out code with different components etc connected to the controller, so I don't have to buy them to play with em?

4) I live in england, what sites do you know of that have a wide range of parts/good prices for components etc?

It seems like other users have interest in this as well, so I'm hoping someone in the know notices this. Thanks in advance !

+3  A: 

Hope this helps:

1) Programming and Customizing the AVR Microcontroller

2) C is primarily used but microcontrollers were first programmed in assembly language.

3) Assembler with Microprocessor Simulator 8086 4.04

4) Smiley Micros

Bryan Roth
+1  A: 

You might find some good information from the yahoo pic processor group

You can find some c++ compilers for microcontrollers here

My favourite source for electronic components is Maplin, and I have also used Farnell

David Sykes
A: 

I would like to know more about this Arduino board. Looking at the website it has its own programming language that is based on C/C++. I would like to start learning micro controller programming but believe straight C would be better for me. Is this something that can be programmed with C also? Is there a better setup than the Arduino board that uses just C?

marked
The Arduino is uses the Atmel ATmega168 microprocessor. The Arduino language is a "starter" c, which is actually pre-processed to C and then compiled by gcc.You can even program the Arduino directly in C without the Arduino environment using an ISP programmer such as the USBtinyISP.
Eric Lathrop
+5  A: 

The utterly dominant micro core in general embedded work at the moment is the ARM, (which should give the OP a moment of patriotic pride).

This a 32-bit processor, for which there are a heaps of different manufacturers, dev-boards and a high-quality (by the standards of GCC) port of GCC, as well as the usual collection of expensive commercial cross compilers. So if you want to full C++, then there's no problem with tools support.

There's a very good commercial IDE wrapped around GCC made by Rowley Associates - www.rowley.co.uk - ISTR there's a cheap hobbyist licence level for that.

The main issue with going to full OO languages vs. plain 'C' for small embedded systems is that although the language itself is no big deal (after all, the processor doesn't care how its binary code was generated), modern C++ programming assumes the existence of heaps and exception handling and RTTI, etc, which can start to look like quite an overhead on a small system.

But nothing stops you using a C++ compiler for its strong type-checking, easier variable declaration rules and constructor/destructor calling, while avoiding the use of exceptions, the STL, etc. What's appropriate just depends on the size of the system you're on.

Even in the UK, Digikey (www.digikey.co.uk, but they ship from the USA) is a competitive source of components and dev kit.

Will Dean
+1  A: 

I'd recommend trying http://www.xgamestation.com/ which seem like a fun project.

epatel
A: 

Will Dean you mentioned ARM as being the "dominant micro core in general embedded work". Do you know of a good starter kit for learning development with ARM? I would be looking for something like the all in one kit like the Arduino board provides for around that price ($50-$200 range).

marked
+1  A: 

To answer questions 3 on Emulation Software:

The Arduino platform is based on an AVR chipset, according to various people on the arduino forums using the windows based AVR Studio tool from atmel it is possible to burn the arduino bootloader in to the simulator and then execute code. For PIC based development there are a variety of solutions for little or no cost for hobby use. Your best bet is to pick up a magazine like Elektor and have a look at the Ads as there are usually special offers etc. for simulators etc.

And to answer 4 about buying parts:

I too live in the UK and frequently buy parts from the US. Given that individual components are low cost (and assuming you can put up with slow shipping times) you can frequently come in under the limits that incur import duty. Failing that, Maplins is probably the most mainstream provider of components with rs online being another popular choice.

On parts, you may also want to check out Octopart who are trying to create a google like application for components. It is US focussed but they are talking to people in the UK to provide more people who can supply parts.

In other notes, take a look at the Propeller chip from Parallax as an innovative emerging microcontroller. It has a number of processing cores and a specialised assembly language that could be of interest to people.

Clokey
A: 

I like to divide the various projects I've done depending on complexity. For simple projects I've use PIC processors (nice simple development board from Maplin with an 16F84). For medium complexity I'v used Reanses R8C (nice development kit from Elektor magazine). I've also used the Zilog Z8. I picked up a nice dev kit (with 64k flash Z8) for 40 quid including a full compiler/assembler IDE (Zilogs own dev kit). For complex projects the ARM is king, My favorite dev kit was the XPort from CharmedLabs which plugs directly into a Game Boy Advance. You can use the GCC chain of tools (C/C++) and a good GBA dev kit (DevKitAdv). The XPort also contains an FPGA which is fun to play with but leaving it in its default state gives you a pile of flash/ram and I/O on the GBA...

Latest (dec '09): I'm currently playing with an MBED controller (ARM based on DIL carrier, easy to use on breadboards etc). Aimed at educational uses as well as hobbiest, full C++ compiler is online and it's actully hard to explain how easy it is to use (easiest and quickest dev board I've ever used bar none). See http://mbed.org/ for info.

Tim Ring
A: 

Depending on exactly what projects you're implementing, you could look at the newer embedded x86 chip boards, using processors like the Intel Atom or the VIA chips. The power requirements are around 4W, which might be too much for what you're doing, but for around $200 you can get a very small-sized, fanless motherboard that will boot from a simple CF card. That gives you a full-featured x86 system that can be programmed in whatever language you like, generally running on a small, customised Linux distribution (although you can install Windows if you like!), which in turn could probably be easily run in a virtual machine right on your desktop.

I like LinITX for such equipment. As an alternative to C, my undergraduate studies involved doing some programming on the BLT board using Modula-2. I remember it as being as powerful as C and very well suited for doing low-level system programming.

David Hicks
+1  A: 

Atmel AVR series of microcontrollers are quite popular and well supported by communities such as AVRfreaks.net.

They are 8 bit microcontrollers with on board flash, ram and eeprom. Also, typically on the chip as well will be a variety of peripherals such as UARTS and analog to digital converters.

JeffV
A: 

One choice for OO programming of microcontrollers is Ruby Arduino Development: http://github.com/atduskgreg/rad or http://rad.rubyforge.org RAD is a framework for programming the Arduino (mentioned above in another answer) in a Ruby framework inspired by Rails. It lets you do a lot of the normal configuration boilerplate through declarative class methods and lets you use a lot of the power and flexibility of Ruby to write simpler and clearer code. Ruby is not C# or C++, but it's syntax is heavily C-flavored and it is extremely easy to learn so I bet you could pick it up quite rapidly.

(Disclaimer: I am the original author and one of the core maintainers of RAD.)

Greg Borenstein
A: 

w.r.t an emulator/simulator, you might want to check out the open source 8085 simulator "GnuSim8085", it's specifically meant to be used for educational purposes, and it was in fact written by student while preparing for his exams. It runs on both, Linux and Windows.

none
A: 

2) Even for 8 bit micro controllers like AVR you have rudimentary C++, but keep in mind that it has limited resources so do not expect full OOP. For that you have to move to 32 bit world (ARM for example). 3) Proteus and TINA can emulate AVR with various peripherals.

avra