Need help choosing microcontroller

Thread Starter

CanElec

Joined Nov 23, 2008
24
Hi all,

First off I am an electrical engineer and I work in industrial automation, mostly programming/configuring/wiring PLCs and programming industrial robots. I am pretty good with C, VB, Basic. I also tinker with hobby electronics. However, I'm new to microcontrollers.

As far as I can tell from the research I've done, you can either order just the microcontroller, or get a development board. What exactly comes with the development board?

I am looking for something that I can use to create some robot projects. I will probably want to re-use the microcontroller for a few different projects. I'll probably start off simple with a line follower, then move onto something more interesting.

I'll also want something capable of doing PID. As far as I can tell from reading, the Basic Stamp is a good starting platform, but I'm worried about a BASIC microcontroller not being powerful enough, plus I'm better with C anyways, so I'd probably want something that can be programmed with C.

I'm guessing it would be a good idea to go with at least a 16-bit or 32-bit microcontroller?

I'm not worried about spending some money, as I want to ensure that I get something that I will not outgrow. I want something with all the goodies basically: lots of digital/analog I/O, PWM, PID capable etc and I will want it to be capable of handing some more advanced robot projects that I'll probably get into.

Can anyone point me in the right direction? I know there probably isn't a single perfect microcontroller/development kit for me, but I'm sure someone can recommend something that will suit my needs.

Thanks and I look forward to learning on these forums.
 

jim77

Joined Nov 21, 2008
7
Everybody has their own ideals on this...
Personally, I only use Microchip, and compile it with Proton Basic (I'm too lazy to learn C !)
There is a very cool tool called PicKit2,(Made by Microchip too) which is very cheap, and programs the chip in circuit, with ease..
You could spend hours comparing the pro's and cons of each type of Microcontroller, but from my own experience, PIC's have always solved my problems, and I mainly work in 24v automation too..
Most Pic's have A/D converters and at least 1 hardware PWM module built in. Some are available with USB too.
If you're in the UK, EPE magazine have a deal with Microchip at the moment, if you're quick, for a PicKit2 and a 44 pin development board, for £9.99 inc P+P.
Like I said, its your choice. Others will reccommend AVR etc, but its up to you. :)

Hope this helps

regards
 

John Luciani

Joined Apr 3, 2007
475
As far as I can tell from the research I've done, you can either order just the microcontroller, or get a development board. What exactly comes with the development board?
It depends on the board. A minimal board will have a crystal, reset circuit, power
regulator, IO connector and a debug LED. A more advanced board may add
switches, pots, more LEDs, motor drivers, buzzers, etc

The board I designed adds a USB interface for program download and a socket for a Zigbee radio. The datasheet for my board (which includes schematics) is at http://tinyurl.com/5lnhtj

I am looking for something that I can use to create some robot projects. I will probably want to re-use the microcontroller for a few different projects. I'll probably start off simple with a line follower, then move onto something more interesting.
A lot of people are using the AVR uCs and the Arduino software to do similar projects.
The Arduino software is free and runs on Linux, Macs and Windows. There is a very large software development community and a lot of software examples.

(* jcl *)
 

Arm_n_Legs

Joined Mar 7, 2007
186
You can try evaluation kit from Silicon Labs. They come complete with evaluation copy of Keil C51 compiler and has different variants of 8051. If I am not wrong, the C8051F120 can goes up to 100 MIPS. Or try the C8051F226 for its close resemblance to the basic 8051. All their varients come with debugger on chip.
 

Thread Starter

CanElec

Joined Nov 23, 2008
24
If you get a development board, it comes with built in switches etc for testing? It also has an interface that allows you to plug the uC into the dev board to program it (RS232/usb)?

Then once it's programmed, you can pop the uC out of the dev board and put it into a breadboard or whatever and wire it up to your actual project?

Am I correct with this line of reasoning? Or do you buy a chip on a dev board and it's stuck in there permanently, requiring you to attach the entire dev board to every project you use it in?
 

John Luciani

Joined Apr 3, 2007
475
If you get a development board, it comes with built in switches etc for testing? It also has an interface that allows you to plug the uC into the dev board to program it (RS232/usb)?
It depends on the board. The more expensive (and larger boards) have more hardware.
Almost all of the boards have the minimum configuration I described earlier.

Then once it's programmed, you can pop the uC out of the dev board and put it into a breadboard or whatever and wire it up to your actual project?
You can do this but most people don't. Since a minimal development board does not
cost much most people just build the board into their project.

Unless you use a special ZIF test socket you are likely to damage the uC by
inserting and removing it from a standard socket.

Am I correct with this line of reasoning? Or do you buy a chip on a dev board and it's stuck in there permanently, requiring you to attach the entire dev board to every project you use it in?
The chip is socketed. If you damage it then you would remove it otherwise I would
leave it in the socket.

Since the development board has an I/O connector you could place a mating I/O connector on your project. If you wanted to use the development board on a different
project you would unplug the two boards.

(* jcl *)
 

Thread Starter

CanElec

Joined Nov 23, 2008
24
It depends on the board. The more expensive (and larger boards) have more hardware.
Almost all of the boards have the minimum configuration I described earlier.



You can do this but most people don't. Since a minimal development board does not
cost much most people just build the board into their project.

Unless you use a special ZIF test socket you are likely to damage the uC by
inserting and removing it from a standard socket.



The chip is socketed. If you damage it then you would remove it otherwise I would
leave it in the socket.

Since the development board has an I/O connector you could place a mating I/O connector on your project. If you wanted to use the development board on a different
project you would unplug the two boards.

(* jcl *)
I was looking at something like this: http://www.mikroe.com/en/tools/bigavr/

I would use this to test out different functions with the built in accessories.

I guess if I can't remove the uC from this board, I could just buy a few extra uCs correct? Keep on in the board at all times for testing, then just download the tested program to another uC, and use that in my projects.

Is there a downside to doing it this way? Other than not learning from setting up the peripherals on the board (but this will have to be done for the project anyways)?

Also, this board I'm looking at looks like it only does 60 and 100 pin AVRs and not the smaller ones, so I may have to find a different one.

This huge dev board seems like a great idea, but I get the sense that most people don't buy these, what is the reason for that?

Also, I do want to learn to do everything myself, so hopefully dev boards come with a schematic of the board so that you're able to duplicate things in your actual projects.
 

Thread Starter

CanElec

Joined Nov 23, 2008
24
Also, since a board like this is for AVRs, I would be able to use a free C compiler to program it in the board, correct? Or do individual boards require special software? They appear to be trying to sell some expensive compilers with the dev boards, even for AVR. http://www.mikroe.com/en/compilers/
 
Last edited:

John Luciani

Joined Apr 3, 2007
475
I was looking at something like this: http://www.mikroe.com/en/tools/bigavr/

I would use this to test out different functions with the built in accessories.

I guess if I can't remove the uC from this board, I could just buy a few extra uCs correct? Keep on in the board at all times for testing, then just download the tested program to another uC, and use that in my projects.
Using two different uCs can make development more difficult. You need to take
the differences between the uCs into account when you do the development.

Is there a downside to doing it this way? Other than not learning from setting up the peripherals on the board (but this will have to be done for the project anyways)?
If they provide you a schematic I do not see a downside. You can look at the
schematic and read the app-notes to learn about the peripherals.

Also, this board I'm looking at looks like it only does 60 and 100 pin AVRs and not the smaller ones, so I may have to find a different one.

This huge dev board seems like a great idea, but I get the sense that most people don't buy these, what is the reason for that?
The reason is cost. If you do not use the majority of the resources on the board
you have paid for features you are not using. If you plan to use the majority of the
resources of that large board you are getting value for your money and it will save
you time.

Most of the projects for these small uCs involve only a few peripherals (control LEDs,
motors, MIDI, etc). The simple boards provide a low-cost solution to quickly develop
these type of applications. Also if you could embed the entire simple board in your
project.

Also, I do want to learn to do everything myself, so hopefully dev boards come with a schematic of the board so that you're able to duplicate things in your actual projects.
Mine does :)

(* jcl *)
 

John Luciani

Joined Apr 3, 2007
475
Also, since a board like this is for AVRs, I would be able to use a free C compiler to program it in the board, correct? Or do individual boards require special software? They appear to be trying to sell some expensive compilers with the dev boards, even for AVR. http://www.mikroe.com/en/compilers/
I would not buy any board that requires expensive software. If the board has a
custom bootloader and software library in flash it could be more difficult to use a
free C compiler.

AVR ATmega devices can be programmed with gcc (which is free). Boards that use
the Arduino bootloader can use the Arduino programming environment (which is free).
The Arduino programming environment is a frontend for gcc.

(* jcl *)
 

leftyretro

Joined Nov 25, 2008
395
I've had my Arduino board (clone) for a couple of weeks. Kit form that cost me $20 (RS-232 version) The Arduino programming environment is the nicest way to start that I have seen yet. Before I had started with the British PIC based PICAXE series and that is also a very low cost entry system, but it's Basic does limit it's performance compaired to compiled C.

Chip selection (manufacture and model)is not the most important initial decision needed, they all will work, it's the IDE software environment provided that is your first important decision. If you like C and like free then do your self a favor and at least research the Arduino series. It's totally open source on both the hardware and software so there will never be any vendor look in or obsolescence.

Good luck and get a Arduino http://www.arduino.cc/
 

davebee

Joined Oct 22, 2008
540
If you like breaking new ground, you could try the Parallax propeller. I think the cheapest starter board is about $30, and the software is free. It uses its own high-level language which is sort of a mix between Pascal and Basic, and its own low level assembly code. The high-level code is very easy to get started with; easier than Basic, in my opinion, if you don't mind learning a new language.

It has 8 distinct 32-bit microcontroller cores. What you do is have your high-level code load one or more cores with a program, then start the cores, and the cores run independently from your main code, communicating via shared memory if you want. Or you can just run a main program in the default core and not bother with multiprocessing. Each core controls as many of the 32 IO pins as it needs.

One fun thing about developing code for the propeller is that you write your code in a Windows GUI, then hit a key, and your code is downloaded and running in the propeller in just a second or two. Its great for speeding the cycle of development.

You can code a core to perform serial IO (or SPI or I2C or parallel) but the chip has no hardcoded serial routines. You can code a moderately fast ADC from a core but its not all that fast or precise; you're better off with an external chip if you need speed better than about 30 kHz, if I remember right, or better than about 10 bits of precision. But you can code a PWM DAC good enough for quite good audio.

The Parallax website has a library of some user-provided routines, including some PID routines, robotics routines, video, audio, mouse and keyboard drivers, SD card drivers, etc., and there's a large forum of users available for support.

Parallax also sells the Scenix line of microcontrollers which power the newer Basic stamps, but I wouldn't recommend them. They're powerful little things for single-application small jobs but not suited for larger work like robotics. Plus the memory segmentation is hard to deal with.

The propellers are so much more capable than Basic stamps that its like comparing a skateboard with a Cadillac. Propellers have MUCH more speed, more IO, more memory, can run larger programs, and they're cheaper, too. But some people like Basic, I guess, and the stamps are fine for projects where all you need is a small, relatively slow controller.
 
Top