Copyright
©
Kanda 2013
11
connects this header to the Port B header by default. Move the lead to another Port
header if you want to use a different AVR Port for LED output.
The 8 switches are also active low (0 when pressed), and are connected to the 10-way
header marked SWITCHES. A 10-way ribbon cable connects them to Port D by default.
Again, move the cable to another header if a different port is required.
Both the LED and SWITCH headers also have GRD and VCC pins.
Note:
AVR ports have three registers controlling them:
1) Port – value to write
2) DDR – direction register (0 is input)
3) Pin – value to read
So, to read switches, set DDR register to 0 and read PIN register – 0 is switch pressed.
To write to LEDs, set DDR to 0xFF and write values to Port register, where 0 is on.
Summary
There is sample code on the CD, which will be copied to install folder. The board
schematics are also available on the CD.
AVR Studio
AVR Studio is Atmel’s development environment. Documentation is available in the AVR
Studio folder in default install path.
There is a sub-folder called Documentation that contains
•
Getting started guide. This explains how to set up AVR Studio and create programs.
•
Instruction set guide, that lists the AVR instruction set
•
Tools set up guide, which explains how to add AVRISP to AVR Studio Tools menu
Here is a brief guide to using one of the sample files in AVR Studio, but more information
is available in the Getting Started guide and at
www.atmel.com
AVR Studio is project based, so you need to create a project before you can do
anything. Follow this procedure.
1) Run AVRStudio and select New Project from Welcome screen. If Welcome screen
does not appear, select Project Menu > Project Wizard
2) Choose Atmel AVR Assembler as Project Type (see end of section for C Projects)
3) Give the Project a name
4) Uncheck Create Initial File box
5) Set location of where to save Project files