30
Jan
0

Avr atmega128 – Start Embedded Programming on Microcontroller efficiency

Where to buy? What to buy? What tools do you need? Is you programming level sufficient?

I will try to give you some answers about this subject.

This post is the first of several tutorials related to microcontroller and AVR atmega128.

Note: this subject is also related to self-made robotics.

Prerequisite

Programming

To program on embedded system you need C programming. You have to know the base: iterations, loop, etc. One of the most important thing is boolean operations: AND, OR, XOR, etc.

Electronics

No soldering competence is needed to start :) But you have to be able to understand electronic schematics. In fact, to know which variable is linked to a buffer, a button or a led it is important to understand a schematic.

Where and what to buy

If you search about microcontroller you will see so many products! you may feel “Wow which one will I take?” Let me give you an advice, the best and more easy to program microcontroller I found is the AVR atmega128.

It is also this one that is used by many Asian laboratories (included the TCL from Kaist ^^) for building Robots.

To buy this micro controller there is several methods. First, you can buy the chip and only the chip:

Avr atmega8

But by doing this it will be difficult to work on it: loading program, adding module and components, etc.

So it is recommended to buy a “board” or a “kit”. A kit is composed by a several modules, a communication interface, etc. You can find many type and different kits, with goes from $50 to $100 (and sometime for the same kits :s ). Here it one website that seam to be cheap:

http://microcontrollershop.com/

But, the best way to buy (and the one I choose) is eBay :) Go on ebay.com and search \”atmega128\ :

ebay.com atmega128

You can find small boards:

AVR atmega 128 board1

(from http://cgi.ebay.com/STK128-ATMEL-AVR-ATMEGA128-16AU-Development-Board_W0QQitemZ130335935274QQcmdZViewItemQQptZLH_DefaultDomain_0?hash=item1e58a08b2a#ht_1591wt_941)

But the one I bought (approx. $35) is this one: \”STK128+ Development Board kit for ATMEL AVR ATMEGA128\”:

AVR atmega 128 board2

(from http://cgi.ebay.com/STK128-Development-Board-kit-for-ATMEL-AVR-ATMEGA128_W0QQitemZ290307574167QQcmdZViewItemQQptZLH_DefaultDomain_0?hash=item4397ae0997#ht_2644wt_941)

The details of this board will be explained later. Anyways, as you can see on the board there is the chip, but the chip is on a very small board. So if one day you want to get more avr chip and if you already have a kit you can buy the atmega128 individually:

avr atmega 128 board indiv

(from ebay.com)

With the board I bought you have to put the chip directly on the board. For example, you buy the kit, create you program and use your chip in your car (why not). Then, if you want to program again you need another chip, so you buy one and put ii directly on your board:

avr atmega128 without chip

Then, you have to buy the link to load the program on the chip; this link is a USB (PC) to ISP (AVR board). To find the best price, go on eBay and search “AVR ISP”, you have to buy something like this:

USB ISP AVR

(from http://cgi.ebay.com/NEW-Mini-ATMEL-AVR-ATMEGA-STK500-USB-Programmer-ISP_W0QQitemZ350276836565QQcmdZViewItemQQptZLH_DefaultDomain_0?hash=item518e205cd5#ht_3181wt_1145)

The price is approx. $25 (Warning, do not confound a simple USB-ISP with a emulator which look similar but cost 3 times the price!)

Software

When you bought an AVR or a kit you will have some CD and soft with it. But, I do not use this kind software. I really prefer to use CodeVision AVR (http://www.hpinfotech.ro/html/cvavr.htm). This is not a free software (sorry for that) but Wow it allows gaining time! (and a free version limited to small program is available) When can easily generate code (sometime you also automatically generate bugs ^^).

codevision avr atmega

Some of the tutorials I will write will be based on CodeVision.

You have to know that there is also a free lib and free tools for Linux : AVR Libc (and you can find other libs if you search on Google).

A friend (Koosy) wrote a presentation about CodeVision, here it is.

Other resources

Official AVR atmgea128 pdf datasheet and description

Features from the documentation:

doc 1st page

doc 1st page 2

A tutorial on Linux from A to Z

Note: If you buy some product (excepted from UE to UE) from a foreign country, be careful with the customs/duty fees. For example, in France if we bought something from USA there is no fee if the products values are under €50 otherwise there is some taxes!

Enjoyed reading this post?
Subscribe to the RSS feed and have all new posts delivered straight to you.

Comments are closed.

Celadon theme by the Themes Boutique