AVR

From uCtrl.net

Jump to: navigation, search
Info.pngTo visit Atmel AVR product page, click here: www.atmel.com/products/AVR
ATTiny2313

Contents

Information

AVR is a series of microcontrollers from Atmel. Fitted with A/D converters, comparators, timers, interrupts, internal oscillator, etc. Flash memory is used for the main program, SDRAM for variables and EEPROM for values that needs to be saved through a power loss. Cheap, fast and easy make them perfect for home automation projects. Speeds up to 20 Mhz, USART (e.g. RS-232, RS-485) and low power consumption are some other benefits. A starting kit such as the STK500 is a good basis, here you can test and program a variety of devices. A full list of developing tools at Atmel.com. For developing PCBs software such as Proteus is useful.

Programming

AVR Studio
BASCOM AVR

There are many different compilers available, so programming can be performed in many different languages:

Assembly
AVR Studio
Basic
BASCOM-AVR
C and C++
CodeVision
WinAVR

Devices

This is not the complete Atmel device list:

Basic circuit

Avr2313 standard circuit.png

This basic circuit has 7 inputs and 8 outputs and uses a ATTiny2313 with internal oscillator. This is max capacity if you don't count PA.0, PA.1 and PA.2, normally used for a crystal oscillator and a reset switch. If an external crystal oscillator is to be used it must be connected between XTAL1 and XTAL2 with a 22pF capacitor to GND on both sides. Like this.

I/O

Input

Digital

Avr-input-n.png Avr-input-p.png

If the input has a pull-up resistor it needs a negative signal to trigger, this inverts the input. To use a positive trigger signal the input needs a pull-down resistors.

Analog

Analog inputs are connected to a signal source from 0-5 Volt, no resistor is required. Connect AVCC and AREF pins to VCC, and both GND pins to ground.

For voltage measurements read about the voltage divider. For resistive sensors read the the Wheatstone bridge.

If a 4-20 mA signal is to be used a 250 ohm resistor is needed, the voltage over this resistor will be 1V at 4mA and 5V at 20mA.

Output

Avr-output-1.png Avr-output-2.png

The output on the AVR devices is positive, it's able to power a LED with amplification. But for more then 20 mA you need a bipolar NPN transistor. For power transistors you still need the bipolar small transistor. PWM outputs can be connected the same way.

RS-232

Max202-avr.png

This makes the AVR device able to communicate with a computer using the serial port. The circuit on the schematic drawing for MAX232, the capacitor values are not necessary correct for MAX202. Check the specifications for your device.

Images

Resources

Files

Links

Retrieved from "http://uctrl.net/w/AVR"
Personal tools
Namespaces
Variants
Actions
Navigation
Categories
projects
Toolbox