- BasicStamp range from parallax inc.
- The 16F84 from Microchip
- The Atmega128 from Atmel
Micro-Controller are very important to modern electronics they replace hundreds of discreet logic chips with a single IC. A modern micro-controller has:
Flash ROM for the machine code that constitutes the program that will be run.
Ram that will be used for user variables at execution time.
EEPROM data area for storing non-volatile user data during execution time
Programmable trimmers for use internally at watch dog timers and other counters like the program counter that tells the micro-controller where it is in the program being executed
IO-ports to communicate to the outside world.
And of course the core that will include the ALU (Arithmetic Logic Unit) where most of the magic is done.
This is a PIC Micro-Controller (Programmable Integrated Circuit)
This IC is old and there are a lot of other new versions available that can do lots more, and use a lot fewer external components.
One of my first micro-controllers was the 16F84 and I still use these from time to time. They are great chips and are relatively easy to program and inexpensive. There are many nowadays that use less external components like the 16F88 that can run without an external crystal oscillator.
PIC micro-controllers are not humans they are machines, and machines can not understand human language to programme a PIC you will use assembly language which is mnemonic codes for machine code that they understand.
For example on a 16F84 which has 14bit OpCodes:
ADDLW (8 bit value to be added),(destination: 0 = store in working register//1=store in file) This means add a literal value to the working register.
In other words this means that the initial value in the working register (which is a storage place for a byte of information that the CPU is currently working with) will be added to a user supplied byte value and then stored back in the working register.
in machine code:
11111x is the code for ADDLW
and 00000101 is the binary value for decimal 5
x is ignored
so the 14bit opcode is
As this can be difficult for most new comers to micro-controllers there are packages available to program PICS in higher programming languages like C which can be easier for some things but I much prefer to work in assembly myself.
Also to program the PIC you will need a programming board to transfer your code from your PC to the actual microchip that will do the work I build one many years ago that worked for years until I decided to buy a nicer looking one from Maplin electronics.
Velleman k8048 PIC Programmer
Interpreted Language Microcontroller: Basic stamp
You can even get Basic interpreters preloaded on to PICS so you can program in a much simpler way that reads more like human language On. A good type of micro-controller that uses this is a Basic stamp
Flashing LED example for BasicStamp2:
DIR0=1 ‘ make Port 0 outputs
OUT0=1 ‘ turn on the LED
PAUSE 500 ‘ pause 500 milliseconds
OUT0=0 ‘ turn off the LED
PAUSE 500 ‘ pause 500 milliseconds
GOTO Begin ‘ Repeat this until the end of time.
As you can see this reads more naturally and is easy to see what is going on. The basicStamp can easily be programmed through a RS-232 port of a PC.
Arduino is kind of a open-source version of the Basic Stamp it is programmed in the Arduino programming language, “Wiring” an open source Programming language based for micro controllers you can download the latest version from:
Buy from these suppliers:
AT90USBKEY demonstration board from Atmel uses a AT90USB1287 micro-controller this is a very nice and simple micro-controller as it uses a USB interface and is becoming very popular. It has the following features:
- USB-OTG support
- 16 MB of DataFlash,
- a small joystick
- temperature sensor (thermistor).
- clocked at 8 MHz with the onboard crystal
- comes with software which lets it act as a USB Mass Storage device
- It’s operated from an external power source battery, mains or USB
Teensy USB Development Board
The Teensy is a complete USB-based microcontoller development system, in a very small footprint! All programming is done via the USB port. No special programmer is needed, only a standard “Mini-B” USB cable and a PC or Macintosh with a USB port. Features:
- USB can be any type of device
- AVR processor, 16 MHz
- Single pushbutton programming
- Easy to use Teensy Loader application
- Free software development tools
- Works with Mac OS X, Linux & Windows
- Tiny size, perfect for many projects
- Available with pins for solderless breadboard
- Very low cost & low cost shipping options