Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

What is a microcontroller?

Status
Not open for further replies.
Basically a small computer, with a CPU (central processing unit) + other stuff (memory, controllers) all in one chip, as opposed to a typical computer (desktop, notebook, etc.) which has separate CPU, memory, etc., chips.

"Microcontroller" and "microprocessor" are pretty much interchangeable terms.
===================================================
Hmm, it appears that's not the case: according to Difference Between.com, a microprocessor is just the CPU, while a microcontroller is what I described above, a "computer in one chip". Now we all know better.
 
Last edited:
There are also quite a different number of microcontrollers. There are families of controllers as you can see from the sub-category groups.
The more popular microcontrollers are;
PIC chips (and PICAXE) from Microchip.
AVR chips from ATMEL which includes arduino boards.
8051 chips from Intel
68HCxxx chips from Motorola.
and there are many others.

Each family of chips tends to use the same or similar Assembler language, with hardware differences the most obvious.
So a PIC 12F508 uses the same language as a 16F877A even though these chips are physically very different.

But assembler for an ATMEL chip is very different from a PIC chip.
While each assembler language is very different, the basic principles behind them are the same. So learning assembler for another chip is like
learning another human language with the same grammatical rules.

A lot of people these days now program microcontrollers using BASIC, or C or even PASCAL.
The advantage of this is that their program can be easily compiled for another chip with minor changes, or so that's the theory behind it.
In the perfect world writing software in C for a PIC should also compile onto an ARM. (but it's not the perfect world).


So the Microcontroller itself. What is it ?
Well it's basically a computer. I would say that they are very simple computers, but some of them can be very complex and have a lot of processing power.

On the bottom end, they can be just a chip that can do very simple calculations like addition, AND, OR and XOR and that's about it. They have limited connections to the outside world, sometimes only one or two wires and only about 16 bytes of memory. Despite this simplicity they can do some very complex things.

On the other end of the scale, the bigger chips can do very complex DSP (digital signal processing) and run multiple internal devices like timers and A2D converters and masked interupts and several external functions like ethernet or USB and multiple buses.

The defining characteristic as mentioned above is that all of this is on one chip.
If you think of an old Comode 64 computer, consider the whole computer in a chip.
 
Thank you for the help, and how do You program it? Do u need connect the chip to a PC for programming? Is the microcontroller expensive?
 
Generally speaking, you connect the microcontroller to a PC to program it, these days usually through a USB port (though some still use the good old serial port). The chip maker gives you software to do this, and you can either buy or build a programmer. Expensive? Lessee ... looking through my actual, physical paper Digi-Key catalog, I see ... let's take this one, a PIC (PIC16F688-I), with 4K of program space, 256 bytes of RAM, 12 I/O pins, 1 A-D channel, for a cost of $1.88. Of course, you can spend more for more features. But they're pretty cheap.
 
simple terminology difference

> microprocessor: just the processing engine, all memory, I/O & functions on separate chips; (what we built with before larger scale integration).
> microcontroller: integrates memory (both RAM & program ROM), and ports: parallel, serial, USB, ADC, timer/counter... etc

Microcontrollers make tasks I deal with a single chip answer.
Example: an instrumentation block built in ~'90 used a MC68000 and 5" x 13" of protoboard, 2nd generation (~'99) used a MC68HC908GP32 and used 3" x 3.5" of board.

Current integration scale allows me to build stuff historically impossible. Way Fun for an ... {see handle} <<<)))
 
Last edited:
There are a couple of programmers on the market.
Microchip make their own http://www.microchip.com/
There are kits to program them like **broken link removed**
Mikroelectronika have a nice development board http://www.microchip.com/
Or you can build into your design an in circuit programmer.

Shop around because some are very cheap and others over priced.
 
so are all microcontrollers same to operate in a specific topic? Or are there variants to do a special kind of operation?
 
Last edited:
so are all microcontrollers are same to operate in a specific topic? Or are there variants to do a special kind of operation?
It's a bit of a chicken and an egg thing. Microcontrollers like all computers are a non-specific piece of hardware looking for an application.
But yes, some are manufactured for more specific markets.

Generally if we look at PIC chips you will find some are ultra simple. WW2 computers were more complex :)
The 12F508 is one that jumps to mind. It basically has nothing more than a couple of I/O pins and a timer on board.
While something like the 12F510 which is the same size is packed with features like comparators and A2D converters etc. in the same size chip.

The 16F84A, which everybody loves to remind you it's out of date is one of the best chips to learn on.
It's easy to port code to the newer chips and you do not need to worry so much about checking and setting registers which don't mean much to you.

The 16F88 is like a sooped up version of the 16F84 so it doesn't take long to take advantage of these different or better and cheaper chips.

Same can be said for the 16F877. Another good chip to work with and learn on. But as I've just found out, there is the 16F887 which is probably better.
There's no need for me to rush out and buy some 16F887 chips. I will just use the 877's until they run out.

If you're looking to get into programming PIC chips the next question is what language are you going to use.
Basic, C, Assembler or something else ?

Is there a reason why you've taken an interest in micro controllers or just general curiosity ?
 
The 16F84A, which everybody loves to remind you it's out of date is one of the best chips to learn on.
It's easy to port code to the newer chips and you do not need to worry so much about checking and setting registers which don't mean much to you.

I would completely disagree - the 16F628 which replaced the 16F84A last century is a far better chip to learn on, plus it's a fraction of the price.

To be honest, the 628 is rather old now, and the starting should perhaps be something more modern? - but the 628 has the advantage of simplicity like the 84.
 
my i sugest a june bug for programing and learning on, it has a built in/on tutorial board with leds and switchs etc. great to get started with and will program all the microchip pic microcontrollers. also has the advantsge of the guy that designed it (Blueroom) is a active member on here so tech support is easy to get. another bonus is many of us here have junebugs so there is plenty code floating about to try out.
wlecome to the forum and a whole new world is about to open when you step into the world of microcontrollers!
regards jason
 
Status
Not open for further replies.

Latest threads

Back
Top