Getting started in Microcontrollers

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
Post Reply
User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Getting started in Microcontrollers

Post by philba »

This is an ambitious post and as such can't possibly cover all the bases. All suggestions and ideas welcome.<p>Basic starter kit:
- uC hardware
- programmer/downloader
- development software<p>Hardware: uC hardware is straight forward but there are a zillion choices. You can buy lab kits, prototype boards or complete trainers. Don't forget a 5V power supply. MELabs has some decent boards to play with. For the adventurous (or experience hobbiest), you can put a PIC on a breadboard and skip the proto boards altogether. Microchip has a very generous sample policy - basically, you have to be able to fog a mirror. Just dont abuse it (2 or 3 chips is good).<p>Programmer: this is how you get the code into the uC. These range from $10 for a kit to >$100 for an in circuit debugger. I use the EPIC+ from MELabs. It works ok but there are many many choices. check to make sure the programmer you are considering will program the exact chip you (including the A versions of chips, they can be different). Check out sparkfun - here is their PIC page http://www.sparkfun.com/shop/index.php? ... 7089&cat=3&
caveat - I've never bought from them but they have a good reputation. <p>One variant of this is a uC with a bootloader programmed in. This allows you to skip the programmer and use a serial cable to download your code into the chip.<p>Dev software: This is a compiler or assembler. MPLAB IDE from microchip is free and has simulator and assembler. You can also get C and BASIC compilers. Some have free trials. If you haven't used assembler before, you might want to use BASIC or C. You buld you code, assemble/compile it and download it into the chip. Your programmer will come with downloader software.<p>One approach for learning is to get a Basic Stamp. It has all the parts you need and plenty of handholding tutorials. Just be aware that its cheap as a learning environment but expensive for using in a project.<p>If I were starting out, I'd look closely at the brains of the Portland Robotic Society's robot controller from their minisumo robot. At $30 its a pretty good deal. Its sold here: http://www.junun.org/MarkIII/Info.jsp?item=3 and includes the board, the microcontroller and a bootloader (so no programmer is needed). I think it includes a basic compiler but the page is unclear on that. I've used these boards in several robots I built and they are quite nice.<p>Finally, there are lots of PIC and AVR (atmel uC) support on the net. Google and ye shall find!<p>That's enough for now. questions? just ask.<p>Phil<p>edit: fixed several typos.
[ January 23, 2005: Message edited by: philba ]<p>[ January 23, 2005: Message edited by: philba ]</p>
User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Re: Getting started in Microcontrollers

Post by philba »

Here's a getting started page. http://www.mhennessy.f9.co.uk/pic/<p>He builds his own programmer and incorporates that into the text. I did things quite a bit differently but he gets there in a reasonably clear fashion.
User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Re: Getting started in Microcontrollers

Post by philba »

Another question that comes up is what PICs to pick, if choosing the PIC line.<p>Here are some choices to help cut through the vast number of PICs to choose from.<p>A good starter chip is the 18 pin 16F628A. Its about $2.25 quantity 1. (of course, free as a sample from microchip) You can easily get 14 I/O pins from it and more with a little effort. Its got 3 timers, serial I/O, 2 comparators, plenty of code space and even a little eeprom.<p>For projects with lots of I/O pins needed, people use the 16F877A. Its a 40 pin chip and has 3 timers, 8 ADC channels, PWM hardware, comparators, serial, I2C, ... it is commonly used for hobby robotics. Its around $6 Q1.<p>For really low end projects, the 8 pin 12F675 is a nice chip with ADC, timers and comparators. The 12F629 is the same chip with out the analog. the 675 is around $1.30 q1 and the 629 is about $1.10 q1. The 6 pin 10F series is around $0.70. I keep a bunch of the 629s in stock since they are great for all manner of little projects. I'm looking at the 12F50x chips - they are 8 pin low feature but less than a buck in single quantities. Maybe it will be my new stock-up chip.<p>To see the chapter and verse on the features of PICs, look here: http://www.microchip.com/stellent/idcpl ... &nodeId=74
Then find the line for the general characteristics of the chip you want. Say you need 12 I/O pins for your application - click on the "view and sort" icon next to the 4-17 pins line. In this case you'll 84 chips that match and you can compare their features. Lots of info but a great way to see what's available. There is also a parametric search that can be mind-numbingly detailed.<p>Where to buy (if you dont go sample route): I like 2 suppliers: Mouser and Glitchbuster. Mouser has very good prices for quantity 1 but shipping overhead for very small orders can kill the value. If you buy $50 worth of stuff, its not so bad, though. Glitchbuster is a bit more expensive per chip but only charges $1.65 for shipping and gives absolutely great service. No relationship here - just a happy customer. www.glitchbuster.com I wouldn't buy from digikey, allied and so on. Their prices are basically there to discourage small quantity purchases.<p>Have fun<p>Phil
terri
Posts: 404
Joined: Sun Nov 07, 2004 1:01 am
Location: colorado
Contact:

Re: Getting started in Microcontrollers

Post by terri »

T H A N K Y O U ! !<p>There have been a couple of debates on this board which approached the level of religious passion --with the attendant brainlock syndrome.<p>I appreciate the courtliness in your replies as well as their thoroughness.<p>I shall print out your responses and investigate further.<p>2 e19.93157 TNX!<p>[ January 23, 2005: Message edited by: terri ]</p>
terri wd0edw
User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Re: Getting started in Microcontrollers

Post by philba »

thanks for the compliments. What you will find, however, is that I have barely scratched the tip of the tip of the iceberg. There is a LOT of stuff here. Good luck. Once you get your first "hello world" circuit done (flash an LED) it will seem a lot less daunting.
Sterling Martin
Posts: 52
Joined: Wed Dec 15, 2004 1:01 am
Location: Missouri
Contact:

Re: Getting started in Microcontrollers

Post by Sterling Martin »

I'm in the same boat as terri. I would also like to learn uc's. I have gotten a cheap kit from eo-tek that utilizes a 8051 uc. I haven't gotten the time to play with it yet, and my question is, is this a good choice for a "first time"? Also, would it be easier to learn useing C or would it be easier with assembler? I know a little C (just enough to be dangerous) and know nothing of assembler.
JB-82-Delft
Posts: 9
Joined: Wed Jan 19, 2005 1:01 am
Location: Delft
Contact:

Re: Getting started in Microcontrollers

Post by JB-82-Delft »

Some pics have only 32 assembler commands. That's fairly easy to learn.
some PIC 16F84 & Assembler tutorial: <p> http://www.mstracey.btinternet.co.uk/pi ... icmain.htm
Engineer1138
Posts: 458
Joined: Thu Feb 05, 2004 1:01 am
Location: Minneapolis, MN
Contact:

Re: Getting started in Microcontrollers

Post by Engineer1138 »

Throwing my $0.02 in, the book I always recommend to beginners is _Understanding Small Microcontrollers_ by James Sibigtroth. This little book used to come with all Motorola uC evaluation kits and it is a very good introduction, if you can find it.
User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Re: Getting started in Microcontrollers

Post by philba »

<blockquote><font size="1" face="Verdana, Helvetica, sans-serif">quote:</font><hr>Originally posted by Sterling Martin:
I'm in the same boat as terri. I would also like to learn uc's. I have gotten a cheap kit from eo-tek that utilizes a 8051 uc. I haven't gotten the time to play with it yet, and my question is, is this a good choice for a "first time"? Also, would it be easier to learn useing C or would it be easier with assembler? I know a little C (just enough to be dangerous) and know nothing of assembler.<hr></blockquote><p>8051 is a pretty common uC - its the basis of product lines from quite a few companies. Atmel has a lot of designs using it (in addition to the AVR line, which is different). So, it would not be a bad one to learn at all. Since you've got it, use it!<p>Asm vs C. It depends on you. I use both but prefer ASM for small projects. Asm is great because it allows you very precise control of the uC and forces you to understand the features of the chip. If you like to understand that kind of stuff, use ASM. C, however, will allow you to focus more on the algorithm and less on the mechanics of making the chip work. Of course C hides some of the details of the uC architecture from you. That could be good or bad. There is little you can do in assembler that you can't do in C.<p>A lot of this language decision depends on your debugging environment. If you have a decent simulator (or in-circuit debugger), then learning ASM can be reasonably easy. Write a couple lines of code, step through it to see what happens.
terri
Posts: 404
Joined: Sun Nov 07, 2004 1:01 am
Location: colorado
Contact:

Re: Getting started in Microcontrollers

Post by terri »

OK, well, thanks everyone. Years ago I had an SDK-85 (8085 Systems Development Kit) with which I had a lot of fun and I was getting pretty good at jumping through the hoops it held up for me.<p>Trouble was, of course, that it had a volatile memory, and I had to leave it powered up for anything extensive --otherwise I had to re-enter the code. I was toying with the idea of writing a program to store the code to a PC, and reload it when desired.<p>But, naturally, I would have had to leave it powered up to write/debug the code to do this.<p>I finally had a rush of brains to the head and realized the circular problem with that method. Like Gollum.<p>So I gave it to my son, and as far as I know it yet resides under an attic eave at his house.<p>So that's why I was interested in latter-day uCs --which opened the possibility of doing the coding on the PC at my leisure and pleasure.<p>And I am sure that after my re-entry to this field I would sooner or later develop my own preferences for control devices. Nothing to do with my working life, you understand, just as a challenge to my wrinkled old cortex. (No less profitable a pursuit than, say, chess or crossword puzzles, mais non?)<p>So, again, everyone, thanks.<p>And thanks for your civility.<p>[ January 25, 2005: Message edited by: terri ]</p>
terri wd0edw
alby
Posts: 10
Joined: Sun Jan 30, 2005 1:01 am
Contact:

Re: Getting started in Microcontrollers

Post by alby »

This book is currently available for free at the freescale website:<p>http://www.freescale.com/files/microcon ... HC05TB.pdf<p>Albert<p> <blockquote><font size="1" face="Verdana, Helvetica, sans-serif">quote:</font><hr>Originally posted by Engineer1138:
Throwing my $0.02 in, the book I always recommend to beginners is _Understanding Small Microcontrollers_ by James Sibigtroth. This little book used to come with all Motorola uC evaluation kits and it is a very good introduction, if you can find it.<hr></blockquote>
Post Reply

Who is online

Users browsing this forum: No registered users and 89 guests