Difference between revisions of "Microcontrollers"

From OpenCircuits
Jump to navigation Jump to search
(subtle difference between ISP and self-flashing -- too much detail for this introduction?)
(→‎further reading: link to general discussion about how to choose a microcontroller.)
Line 192: Line 192:
  
 
== further reading ==
 
== further reading ==
 +
 +
* [[Microcontrollers for Beginners]]
  
 
* [http://www.instructables.com/id/How-to-choose-a-MicroController/ Instructables: How to choose a MicroController]
 
* [http://www.instructables.com/id/How-to-choose-a-MicroController/ Instructables: How to choose a MicroController]
 +
* Thomas A. Coonan. [https://web.archive.org/web/20120117133103/http://www.mindspring.com/~tcoonan/design.html "Microcontroller Design Checklist. Or, My Top Seven uController Issues"].
 +
* [http://www.digikey.com/techxchange/thread/4280 "Help Me Select a Microcontroller"].
 
* [http://en.wikibooks.org/wiki/Embedded_Systems/Particular_Microprocessors#brief_selection_guide Wikibooks: brief selection guide]
 
* [http://en.wikibooks.org/wiki/Embedded_Systems/Particular_Microprocessors#brief_selection_guide Wikibooks: brief selection guide]
 
*[http://www.veys.com/index.php?title=Main_Page Main Page] May have been a one man effort, now dropped.  Has a bit of content that looks good.
 
*[http://www.veys.com/index.php?title=Main_Page Main Page] May have been a one man effort, now dropped.  Has a bit of content that looks good.
Line 200: Line 204:
 
*[http://www.ladyada.net/library/picvsavr.html PIC vs. AVR Ultimate fight]
 
*[http://www.ladyada.net/library/picvsavr.html PIC vs. AVR Ultimate fight]
 
* [http://chiphacker.com/questions/1092/whats-the-difference-between-a-microcontroller-and-a-microprocessor Chiphacker: "What’s the difference between a microcontroller and a microprocessor?"]
 
* [http://chiphacker.com/questions/1092/whats-the-difference-between-a-microcontroller-and-a-microprocessor Chiphacker: "What’s the difference between a microcontroller and a microprocessor?"]
 +
* [http://piclist.com/techref/piclist/begin.htm "Beginners checklist for PIC Microcontrollers"].
  
  
 
[[category:microcontroller]][[Category:Components]]
 
[[category:microcontroller]][[Category:Components]]

Revision as of 20:07, 23 November 2015

Microcontrollers

First, a few definitions:

  • a CPU is something that can execute software programs. The earliest CPUs were built out of many parts, but now most CPUs are in microprocessors.
  • a microprocessor is a kind of single integrated circuit that includes an entire CPU. In the earliest microprocessors, and some famous kinds of microprocessors still being made, the CPU fills the entire chip, and so require external RAM and ROM/FLASH memory. But now most CPUs sold are in microcontrollers[1].
  • A microcontroller is a kind of microprocessor that, in addition to the CPU, also includes RAM, ROM/FLASH memory, and digital I/O on a single chip. Many microcontrollers also have a UART, analog to digital convertors, and even comparators on the same chip/die/package.

A microcontroller is a little computer on a single Die/Package. The computer includes a CPU core, RAM, ROM/FLASH, and peripherals often including UARTS, A/D converters, SPI, and I2C. Microcontrollers differ from microprocessors in that the microprocessors generally have bigger more powerful central processing units, but need support chips for ram, rom and other peripherals. Most modern microcontrollers use FLASH ram instead of a ROM so they can be programmed over and over. Most modern microcontrollers support in-system programming (ISP) or in-circuit serial programming (ICSP) or some similar protocol to enable a programmer/debugger to burn a program (often a bootloader) into the microcontroller after the microcontroller has been soldered in, without pulling the chip from the circuit. Many modern microcontrollers allow self-flashing to enable bootloading or a firmware update without using a programmer/debugger.

Unlike PCs, which have a wide range of programming languages available, microcontrollers have only a few programming languages available -- C programming language, Basic programming language, Forth programming language, assembly language, and (on a few microcontrollers) Python programming language.

Microcontrollers and microprocessors only understand machine code and compilers regardless of type all translate the program to machine code. Machine code, while tedious to learn and device specific, is the most efficient.

People often have strong opinions about their favorite programming language[2].


General

Many hobbyists use microcontrollers, sometimes even multiple microcontrollers, in their projects. Prices have fallen below $5 for the cheapest 32-bit microcontroller and below $1 for the cheapest 8-bit microcontroller.

I've written a little about the various kinds of microcontrollers at Wikibooks: Embedded Systems. --DavidCary 06:15, 10 March 2007 (PST)


About 55% of all CPUs sold in the world are 8-bit microcontrollers. Over 2 billion 8-bit microcontrollers were sold in 1997.[3] (Anyone have more up-to-date statistics?)

Somebody always thinks their microcontroller is the best microcontroller, so we have listed all of them as best.

Microchip PIC

consider merging the following section to Which PIC to use, to gain the advantages of consolidating information.

Note about choosing a PIC:

The number of PIC models is huge so it is worth saying a few words on how to choose a PIC.

Things to consider as a hobbiest or making a small production run:

  • Microchip tends to produce the same chip with minor variations. The exact same chip with the exact same pinout may be available in 8k, 16k, or 32k flash. Spend a few extra pennies and take the best.
  • SMT parts take practice to work with, so beginners should focus on DIP package parts with <= 40 pins. On the other hand, SMT parts can yield simpler and smaller PCB designs so they are worth consideration even for a hobbiest.
  • Contrary to common sense, older parts are often more expensive then newer parts.
  • Consider if a free/student version of a C compiler is availible. Microchip provides free/student student versions for the 18f,dsPIC/PIC24, and PIC32.

List of some of the best PICs for hobby purposes:

PIC Pin Count Important Features Typical Use
PIC12F683 8 ADC, I/O PWM, Comparator Very Simple Projects/Glue Logic
PIC16F88 18 ADC, I/O PWM, Comparator, UART, I2C/SPI General Purpose
18F2620 28 ADC, I/O PWM, Comparator, UART, I2C/SPI General Purpose
18F4620 40 ADC, I/O PWM, Comparator, UART, I2C/SPI, 8 Bit Parallel Port General Purpose
18F2550/18F2553 28 ADC, I/O PWM, Comparator, UART, I2C/SPI, USB USB Connectivity
18F4550/18F4553 40 ADC, I/O PWM, Comparator, UART, I2C/SPI, USB, 8 Bit Parallel Port USB Connectivity
P24FJ64GA002 28 ADC, I/O PWM, Comparator (with software selectable pin assignment), 2 UART, 2 I2C, 2 SPI General Purpose

Note: J means the PIC is a native 3.3V part. Other PICs will run at 3.3V but only at slower clock speeds.

External Links:

Atmel AVR

Atmel's line of 8 and 32-bit RISC microcontrollers are extremely easy to use and a great choice for beginners. With four series—ATtiny, ATmega, ATxmega, and AVR32—there is a large variety in price, processing power, and size, making it simple to meet a variety of needs. Many small chips are available in a DIP package that allows for quick prototyping and breadboard use.

Combined with an AVRDragon for about 60€ everybody with a budget of about 70€ is able to build and debug his own microprocessor applications. The AVRDragon allows you to debug all ATmega & ATtiny processors with less than 32k flash using DebugWire or JTAG and to program all ATmega / ATtiny devices using HVPP, ISP and JTAG.

ATtiny

Small and somewhat lacking in I/O, but still quite powerful (20MHz System Clock, 20MIPS, 64MHz Fast Peripheral Clock). Ideal for small spaces, limited resources, or a tight budget.

Features include 10bit ADCs, USI, 8/16bit timer, PWM, I²C, SPI , BOD, and WDT.

ATmega

Middle of the road AVR with a good amount of I/O and a large amount of processing power.

Features include 10bit ADCs, USARTs, 8/16bit timer, I²C, SPI, BOD, and WDT.

Processors:

  • ATmega88
  • ATmega16/32
  • ATmega640/1280/2560
  • ATmega1281/2561

ATxmega

Geared toward application that require a large amount of processing power or a large number of I/O.

Features include 12bit ADC, 12bit DAC, 16 bit timer, USARTs, SPI, I²C, DMA, real time clock, crypto engine.

Processors:

  • ATxmega64A1/128A1/192A1/256A1
  • ATxmega64A3/128A3/192A3/256A3

AVR32

High performance 32-bit microcontroller for multimedia purposes, with system clocks of 200 MHz or more.

Processors:

  • AP7000
  • AP7001
  • AP7002
  • AT32UC3A0128/0256/0512

Links

Development Boards

Development Boards are printed circuit boards that contain a microcontroller and enough circuitry to get it going, typically at least some of the following: clock, voltage regulator, reset button, communications chip, buffer amplifiers, led's, prototyping area, and/or off chip connections. Sometimes the manufacturer of the chip sells development boards ( often called evaluation boards ). Development boards can be really basic, just enough to make the processor run, with connections to the IO pins. Or the boards can include communications, displays, input buttons etc. Often you can jump start a project by using a development board that does the boring standard stuff and let you focus on your project. The development board can let you use high density parts and surface mount parts that you might not want to mess with. The BitWacker kit from SparkFun is priced close the to the total price of the parts. This is probably true of some other development boards as well. Note that some development boards require you to build them they have not been made available as kits, some come both ways.


Other demo boards: see demo board.

Cypress PSoC

  • Cypress PSoC 8-bit and 32-bit FLASH microcontroller + mixed-signal array on one chip.

External Links:

ARM

There are no ARM chips currently manufactured in a through-hole package -- they are *all* surface-mount. However, there are many "adapter boards" aka demo board that make them easier to use, such as:

further reading