micro-controller programming

Status
Not open for further replies.

j0k3r

Seniorius Lurkius
40
The Texas Instruments MSP430 is your cheapest starting point. 16-bit, ADC, serial ports, free C compiler and IDE. The compiler is code size limited, but the size limit is smaller than the ROM size of most MSP430 CPUs. The programming hardware is less than $5, and has in circuit debugging capability:

http://processors.wiki.ti.com/index.php ... nchpadwiki

Next step up in power and price is the Microchip 16-bit PICs. Much more peripherals than the the above MSP430, including DACs, I2S, etc. Free IDE, C compiler, but code size limitation of compiler is more restrictive than the above, but should be enough for most beginner projects. Programming hardware starts at $25, and includes in circuit debugging:

http://www.microchip.com/stellent/idcpl ... e=en548414

Both TI and Microchip are very generous with online free CPU sample requests.



A lot of people will recommend Atmel AVR, but their cheap tools lack in circuit-debugging, which is a feature you want. Also, Atmel requires some social engineering to get free samples from.

Also, Renesas periodically gives away free dev kits for their line, from their 16-bit CPUs all the way up to their 32-bit SuperH line (used in Sega Saturn & Dreamcast).
 
Atmel 8-bit AVR is my favourite - there's a great community at avrfreaks.net to tell you all you need to know. It uses the GCC toolchain with a decent* free IDE from Atmel. The programmer can be very cheap indeed or if you want luxury look at the JTAGICEMKII. Using a cheap development board and Dean Camera's free LUFA USB library I build a nifty RGB build light that sits on the continuous integration box at work.

If you have never done such a project before it might be a good idea to start with the LED cube kit from Sparkfun: http://www.sparkfun.com/products/9867 - starting with 8x8x8 and getting it wrong could be expensive.

*by free embedded tool standards anyway
 

chirpflare

Ars Scholae Palatinae
1,328
Blacken00100":3acf8ant said:
Assembly for microcontrollers is not overly common anymore; usually you can at least use C.

Were I you, I'd look into an Arduino kit.

I got my 10 year old nephew an Arduino for Xmas after he got frustrated with a Mindstorms kit he got a couple years ago, and he absolutely loves it. Thats not meant to put you off, just illustrate how easy to use and well thought out it is. I'm not sure how close to the metal you can get with it (you program it using Java) but they're still a good way in.
 

bech0t

Ars Scholae Palatinae
717
When I started programming uProcessors, the method was to learn assembly on a really old, but well documented processor, and then by the end of the process, they would introduce the magic which was C programming. We used the HC12 processor but this method is more academic and I wouldn't really recommend it to anyone.

So, that leaves you with three different options of where to go.

1. Get a quasi uP product such as the Arduino. I say quasi because they have a bootloader and you are programming in a highly toned down, library based way. This is really good for beginners because everything is pretty much guaranteed to work and you don't need to learn the specifics. There are simple functions for everything you want to do.

2. Get a dev board of your favorite uP brand. Personally I like the PICs from microchip. I have one of their new PIC32 dev boards and it does almost anything you would ever want. However, there are other good uP brands out there such as Atmel and TI. All of these have huge online support networks, free tools, etc.

3. Take one of the above uPs, and build a board around it. Or, buy a 3rd party board made around it. This is useful if you are more into the hardware aspects of the learning process. Also, you could add other chips and stuff that interest you. Some of these are really simple. For example, some of the PICs need only ground and 5V. They have an internal oscillator and can be setup with just those two pins!

Basically it is down to what you want to learn, and what your long term goals are. If you have a project, and you want to just do something cool and possibly learn some new stuff, I'd go with an Arduino. If you want to learn about uPs and you have a project to try it out on, I'd go with a PIC development board like the PIC32 starter kit. You could use it for this project and then also learn more advanced stuff.

I would skip assembly all together unless you are going to later be an Electrical Engineer working in ultra low power or ultra high performance uP design. It has all but been eliminated with modern compilers.
 

deas187

Ars Scholae Palatinae
880
i gathered the same ideas about assembly language after a couple days of reading this book and poking around in the internet. i find it really interesting though, learning about registers and memory, and how they 'work'.

on a side note, had anyone actually built one of these LED cubes? i am having some difficulty understanding how the wiring of the LEDs works; are they all wired together or does each strip of LEDs have it's own connection?
 
deas187":2wrvr1ze said:
i gathered the same ideas about assembly language after a couple days of reading this book and poking around in the internet. i find it really interesting though, learning about registers and memory, and how they 'work'.

on a side note, had anyone actually built one of these LED cubes? i am having some difficulty understanding how the wiring of the LEDs works; are they all wired together or does each strip of LEDs have it's own connection?

Assembly is interesting and in the bad old days of PIC development it was the way it was done. But it doesn't really have advantages especially not for a beginner and now that compilers are so cheap or free there isn't much reason not to start in C.

The non-intuitive wiring of something with so few outputs driving something with so many inputs is why it might be a good idea to start with a small cube, and possibly even a build-by-numbers kit. No microcontroller has 8x8x8x3 output leads and I don't know of any with even 3x3x3x3. The main trick is multiplexing, where each LED has an address. The controller selects the LED and then sets a value, and moves onto the next. All this can happen so fast you don't notice each LED is being driven sequentially. The kit I mentioned uses a 74HC238 decoder that makes a binary address from 3 input lines to result in 8 effective output lines.
 

deas187

Ars Scholae Palatinae
880
BeowulfSchaeffer":1yiot2l6 said:
God, I need a break. I saw the title and thought it read "Mind-Controller Programming"

made me laugh. thanks.


i've modified my plan a little bit. the LED cube is on hold for the moment and i am instead making a blinking LED tuxedo for this valentine's day rave ahem party i am going to. should be cool. and arduino it'll have to be!
 
Sounds like someone has been trolling Instructables lately :) The LED cube project posted there a few weeks back is awesome. I've considered taking a whack at rolling my own version, but free time is at a premium lately.

If you want to jump into microcontrollers I cannot recommend the Arduino enough. It's been mentioned numerous times already in this thread for a reason! The hardware is simple, cheap and very easy to program, yet still manages to be capable of doing a _lot_ of things. It is a great place to get started and leads nicely to working with smaller scale specific applications (like doing things with a PIC16 etc... directly).
 

deas187

Ars Scholae Palatinae
880
Skinny Little White Boy":2je2vj5p said:
Sounds like someone has been trolling Instructables lately :) The LED cube project posted there a few weeks back is awesome. I've considered taking a whack at rolling my own version, but free time is at a premium lately.

If you want to jump into microcontrollers I cannot recommend the Arduino enough. It's been mentioned numerous times already in this thread for a reason! The hardware is simple, cheap and very easy to program, yet still manages to be capable of doing a _lot_ of things. It is a great place to get started and leads nicely to working with smaller scale specific applications (like doing things with a PIC16 etc... directly).

aye, i did a bit of trolling. the LED cube looks so tight, i want to put it in my living room for when i have parties, with expectations that it'll get me laid a little more often. it appears to require quite a bit of work from both a hardware and a coding perspective, nothing like some good old self improvement!!!
 

Deffexor

Ars Tribunus Angusticlavius
7,607
Moderator
So I just got my Netduino yesterday. It's pretty neat being about to program a microcontroller in C# and VS2010. Makes life pretty fun with Intellisense and all.

Unfortunately, there are things about MS's .NET Microframework 4.1 (aka NETMF) that I hadn't realized, but which makes plenty of sense if you think about it.

[*]No support for Generics

So it's like programming for .NET 1.1, bleh. :(

That said, it does have System.Collections, so you do have ArrayList, Hashtable, Stack, and Queue available to you.

I forgot how small 60KB was, too. I made a program which tried to add 1000 Integers to an ArrayList. Ran out of RAM at 711. :scared:

Right now, I'm just researching the NETMF to see what's available to me.
 

Bixmen

Ars Scholae Palatinae
902
For Dev kits, NXP's is hard to beat. built in debugger, online compiler. it's super easy: http://mbed.org/

for more features, ST makes a killer eval board for their cortex line. it's a bit more at $150, but worth it if you want to do anything more than blink leds. Plus you can use IAR, which is a nice universal IDE.

Renesas' new RX series has a nice eval baord as well. built in debugger. But I personally hate their IDE. HEW is toilet.

I never really liked microchips. their proprietary debugger is kinda annoying, and I hate MPLabs almost as much as HEW.
 

deas187

Ars Scholae Palatinae
880
SurfaceTension":8p7qa6t3 said:
Cry me a river. Try implementing a feature with 4 bytes of RAM in assembly. Bit packing FTW.
Hahah, been there. And try doing a bug fix with twelve bytes of flash left. Bet you've been there too.

Off topic: looks like these embedded folk are very look-but-don't-touch re. posting ...

ehhhhhhh? i haven't ordered mine yet! i have to get paid this week, pay rent, which is obviously too high, and then use that extra cash to buy me some equipments. tru story, i went into radioshack last week to see if they had anything like this and the guy was like "do you know what the internet is?"
 
Status
Not open for further replies.