0% found this document useful (0 votes)
223 views11 pages

Avr Atmega8 PDF

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 11

AVR DEVELOPMENT BOARD ( ATMEGA 8)

AVR ATMEGA-8 DEVELOPMENT BOARD

The Atmel ®AVR® ATmega8A is a low-power CMOS 8-bit microcontroller based on the AVR
RISC architecture. By executing powerful instructions in a single clock cycle, the ATmega8A
achieves throughputs approaching 1 MIPS per MHz, allowing the system designer to optimize
power consumption versus processing speed.

The Atmel®AVR® AVR core combines a rich instruction set with 32 general purpose working
registers. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU),
allowing two independent registers to be accessed in one single instruction executed in one clock
cycle. The resulting architecture is more code efficient while achieving throughputs up to ten
times faster than conventional CISC microcontrollers.

The ATmega8A provides the following features: 8K bytes of In-System Programmable Flash
with Read-While-Write capabilities, 512 bytes of EEPROM, 1K byte of SRAM, 23 general
purpose I/O lines, 32 general purpose working registers, three flexible Timer/Counters with
compare modes, internal and external interrupts, a serial programmable USART, a byte oriented
Two-wire Serial Interface, a 6-channel ADC (eight channels in TQFP and QFN/MLF packages)
with 10-bit accuracy, a programmable Watchdog Timer with Internal Oscillator, an SPI serial
port, and five software selectable power saving modes. The Idle mode stops the CPU while
allowing the SRAM, Timer/Counters, SPI port, and interrupt system to continue functioning. The
Power-down mode saves the register contents but freezes the Oscillator, disabling all other chip
functions until the next Interrupt or Hardware Reset. In Power-save mode, the asynchronous
timer continues to run, allowing the user to maintain a timer base while the rest of the device is
sleeping. The ADC Noise Reduction mode stops the CPU and all I/O modules except
asynchronous timer and ADC, to minimize switching noise during ADC conversions. In Standby
mode, the crystal/resonator Oscillator is running while the rest of the device is sleeping. This
allows very fast start-up combined with low-power consumption.

The device is manufactured using Atmel’s high density non-volatile memory technology. The
Flash Program memory can be reprogrammed In-System through an SPI serial interface, by a
conventional non-volatile memory programmer, or by an On-chip boot program running on the
AVR core. The boot program can use any interface to download the application program in the
Application Flash memory. Software in the Boot Flash Section will continue to run while the
Application Flash Section is updated, providing true Read-While-Write operation. By combining
an 8-bit RISC CPU with In-System Self-Programmable Flash on a monolithic chip, the Atmel
ATmega8A is a powerful microcontroller that provides a highly-flexible and cost-effective
solution to many embedded control applications.

The Atmel AVR ATmega8A is supported with a full suite of program and system development
tools, including C compilers, macro assemblers, program debugger/simulators, In-Circuit
Emulators, and evaluation kits.

Excel Technologies Page 1


AVR DEVELOPMENT BOARD ( ATMEGA 8)

FEATURES OF ATMEGA8
• High-performance, Low-power Atmel®AVR® 8-bit Microcontroller
• Advanced RISC Architecture
– 130 Powerful Instructions – Most Single-clock Cycle Execution
– 32 x 8 General Purpose Working Registers
– Fully Static Operation
– Up to 16MIPS Throughput at 16MHz
– On-chip 2-cycle Multiplier
• High Endurance Non-volatile Memory segments
– 8KBytes of In-System Self-programmable Flash program memory
– 512Bytes EEPROM
– 1KByte Internal SRAM
– Write/Erase Cycles: 10,000 Flash/100,000 EEPROM
– Data retention: 20 years at 85°C/100 years at 25°C(1)
– Optional Boot Code Section with Independent Lock Bits
• In-System Programming by On-chip Boot Program
• True Read-While-Write Operation
– Programming Lock for Software Security
• Peripheral Features
– Two 8-bit Timer/Counters with Separate Prescaler, one Compare Mode
– One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture
Mode
– Real Time Counter with Separate Oscillator
– Three PWM Channels
– 8-channel ADC in TQFP and QFN/MLF package
• Eight Channels 10-bit Accuracy
– 6-channel ADC in PDIP package
• Six Channels 10-bit Accuracy
– Byte-oriented Two-wire Serial Interface
– Programmable Serial USART
– Master/Slave SPI Serial Interface
– Programmable Watchdog Timer with Separate On-chip Oscillator
– On-chip Analog Comparator
• Special Microcontroller Features
– Power-on Reset and Programmable Brown-out Detection
– Internal Calibrated RC Oscillator
– External and Internal Interrupt Sources
– Five Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, and
Standby
• I/O and Packages
– 23 Programmable I/O Lines
– 28-lead PDIP, 32-lead TQFP, and 32-pad QFN/MLF
• Operating Voltages
– 2.7 - 5.5V
– 0 - 16MHz

Excel Technologies Page 2


AVR DEVELOPMENT BOARD ( ATMEGA 8)

FEATURES OF THE ATMEGA-8 DEVELOPMENT BOARD:

The ATEGA-8 Development Board has been developed to allow the beginners to learn about
the architecture and the applications of the micro controller. The Board once connected to the
computer allows the developer to write his programs in Assembly of ATMEGA8 or in C
language and compile the program to generate the Hex file (using the IDE provided by Atmel).

The Hex file so generated can be downloaded in the Flash memory of the micro controller and
executed automatically

The Development Board has the following hardware features.

Based on Atmel’s AVR Series Micro controller ATMega8


On Board 16*2 LCD Display
6 Key Switches
5 indicating LED’s
On Board Internal ADC interface with a pot to change the input
On Board Thermister Temperature sensor (NTC )
On Board LDR Sensor
On Board Buzzer output
IIC serial EEPROM interface
On Board Infra Red LED and IR Sensor Interface
Power Supply from PC through USB or External source
On Board USB interface for Downloading
Enclosed in a wooden Box
Necessary cables and software provided

The Board is either provided as just aboard with necessary cables etc. or some time on demand
also enclosed in a wooden Box for protection. When the Board is provided as just a Board, the
supply can be tapped from the System through the USB cable provided.

If the Board is enclosed in a Box, then built in power supply is also provided at the bottom of
the Box. However the power supply of the Computer can still be used by changing the jumper at
the left bottom corner of the Board.

The Block Diagram of the Board is given below for your reference.

Excel Technologies Page 3


LED4

Vcc

ISP Connector
I2C Bus
LED3
USB Connector
LED ENABLE
LED2 JUMPER

USB

Excel Technologies
JP6
Vcc

INTERFACE

S5
LED1

Vcc(+5V)
PC4 PD4

PD1
PD0
PD5
PD6
PC5

JP5
PD7

EEPROM
Thermistor PB4

S6
1K NTC
2X16 LCD

PB5

PC0
S1 PB6
PD2
S2
Contrast

32KHz

Analog Vin2
PB7
PD3

(Same as PC2)
PB0
RESET PC6 LED5
PC3
PB1
PC2
JP2
Buzzer

LDR
Vcc

PB3 PC1
PB2

EXT
Vin1
S3/IRSENSOR ENABLE
Vcc

ENABLE
Jumper

JP7
JP4

S3
IR LED

+5V
IR ENABLE
S4

S4/IRLED

GND
AVR DEVELOPMENT BOARD ( ATMEGA 8)

Page 4
TV Remote Receiver
Vcc
AVR DEVELOPMENT BOARD ( ATMEGA 8)

The Hardware of the Development Board is Described here:

1) POWER CONNECTION
The power to the Development Board can be provided either through USB Connector or through
External power supply selectable by a jumper JP1 at the left hand side lower bottom of the Board

If the Board is enclosed in a Box, then built in power supply is provided at the bottom of the
Box. This is essentially done to ensure the smooth functioning of the Board for long time as it
has been seen that some time the power of the USB gets weak and it is not able to supply full
current, so if the built in power supply is connected then this problem will never arise. However
any time the user wants to use the power of the USB, he can change the jumper as shown below

EXT PWR
POWER TO SYSTEM
USB PWR

2) OUTPUT LEDs
The Board has Five output LEDs LED1 to LED5 namely connected to the Pins PD7, PD6, PD5,
PD4 and PB0. Respectively ie

LED1 connected to -----------> PD7

LED2 connected to------------> PD6

LED3 connected to ------------> PD5

LED4 connected to ------------> PD4

LED5 connected to ------------> PB0

Note: All the above LEDs are Enabled through a jumper LED ENBL

Excel Technologies Page 5


AVR DEVELOPMENT BOARD ( ATMEGA 8)

3) INPUT SWITCHES

The Board Has six input switches S1 to S6 connected to the micro controller through PD2, PD3,
PB2, PB3, PC4 and PC5 respectively . The Keys switch S1 and S2 are connected directly to PD2
and PD3 respectively. But the other Keys S3 to s5 are connected through Jumpers as shown
below

S1 connected to ----------------> PD2

S2 connected to -----------------> PD3

S3 connected to -----------------> PB3 through jumper SE/ IR EnBle as shown below


S3/IRE
TO IR RECEIVER

SWITCH S3 PB3

S4 connected to -----------------> PB2 through jumper JP4as shown below

JP4 TO IR LED

SWITCH S4 PB2

S5 connected to -----------------> PC4 through jumper JP6 as shown below

JP6
TO EEPROM

SWITCH S5 PC4

S6 connected to -----------------> PC5 through jumper JP5 as shown below

JP5 TO EEPROM

SWITCH S6 PC5

Excel Technologies Page 6


AVR DEVELOPMENT BOARD ( ATMEGA 8)

4) 16*2 LCD DISPLAY

A 16*2 LCD Display ie 16 characters and two line Display is there on the Board with Back light

The Pin Diagram of the Display is explained here. The LCD is connected on four Data lines
D4 to D7 and the controls signals EN and RS are connected to PB4 and PB5 respectively
through Jumpers as shown below

EN 2
6
GND---RW
5 15
RS
4
NC
L
DO 7
D1 8 C
D2 9
PB4
10 D 3
PB5 D3
PD4
PD5 D4 11
PD6
PD7 D5 12 1

LCD D6 13
ENBLE 14 16
D7

5) BUZZER

A DC Buzzer is connected to theD7PB1 line through jumper JP2 as shown below. A low on PB1
will put the Buzzer in ON condition.

+5V PB1
1K Ohms
Buzzer JP2

Excel Technologies Page 7


AVR DEVELOPMENT BOARD ( ATMEGA 8)

6) INTERFACING ADC

ATMEGA 8 has in built six channels ( channel 0 to channel 5 ) of ADC of 10 bit accuracy. Out
of these only four channels are used on the Board using Pin PC0 , PC1, PC2 and PC3 of the
ATMEGA8 chip ( ie ADC0, ADC1, ADC2 and ADC3 ). The channel ADC0 and ADC1 are
used for sensing the Temperature and sensing the Light using the Thermister and the LDR
respectively. The other two channels are used for measuring the Analog Voltages.

A potentiometer is connected to channel ADC2 at Pins named as VIN1 providing 0 to +5Volts


variable input through jumper JP7. If you want to use the on Board variable source, then short
jumper JP7 where as if you want to give an external input, then keep the jumper JP7 removed
and give your external voltage at terminals VIN1.

The other ADC channel ADC3 is available at Pins VIN2 on the Board and one can connect
external Analog input on the pins VIN2. The circuit connections are shown here.

+5V

Pin--PC2

(ADC2) JP7

VIN1

Pin—PC3

(ADC3)

VIN2

7) THERMISTER AS TEMPERATURE SENSOR

An On Board Thermister of 1 K Ohms is provided on the Board for sensing the temperature

Excel Technologies Page 8


AVR DEVELOPMENT BOARD ( ATMEGA 8)

The circuit used here is shown below.


VCC

Thermister
1K Ohms
PC0 (ADC0)
4.7K

We know that the resistance of the Thermister varies linearly with the temperature.. If the Vcc is
+5V. The resistance of thermister is 1 K at 25 degrees, Measure the voltage Vo using ADC and
then calculate the resistance of thermister at room temperature

Rthermistor=(Vcc/Vmeasured−1)×4.7

Once the Resistance of thermister is calculated,Use


Steinhart-Hart equation. It uses three coefficients to characterize the NTC material with great
accuracy.

8) LDR AS LIGHT SENSOR

An On Board LDR of 1 K Ohms is provided on the Board for sensing the Light

The circuit used here is shown below.


VCC

LDR ( RL in K Ohms)

PC1 (ADC1)
Vo
4.7K

The resistance of the Light Dependent Resistor (LDR) varies according to the amount of light
that falls on it. The relationship between the resistance RL and light intensity Lux for a
typical LDR is

RL = 500 / Lux Kohm

Excel Technologies Page 9


AVR DEVELOPMENT BOARD ( ATMEGA 8)

With the LDR connected to 5V through a 4.7K resistor, the output voltage of the LDR is

Vo = 4.7 *5

4.7+ RL

Reworking the equation, we obtain the light intensity

500 = 23.3 – 4.7

Lux Vo

From the above equation, we can calculate the light.

For a low cost LDR, at the same light intensity, the part to part variation in resistance can be as
high as 50%. Therefore such a low cost LDR is seldom used for measuring light intensity but
more for light presence/absence detection.

9) EEPROM INTERFACE

An EEPROM is available on the Development Board for storing and retrieving the data serially.
The two Lines SCL and SDA of the AVR ATMEGA8 are connected to the EEPROM as shown
below
S6 Key
Gnd
A0 1 4
2
WP JP5
A1 2 4 7
C SCL
Pin 28 of
A2 3 6
0 SDA AVR ( SCL )
Vcc 8 5
2
S5 Key
P 2.1

Pin 27 of
4
AVR ( SDA )
5

JP6
P 2.1

The user can write in to the EEPROM for storing his data and can retrieve the same as and when
required.

Excel Technologies Page 10


AVR DEVELOPMENT BOARD ( ATMEGA 8)

10) IR SENSOR INTERFACE

An IR Transmitter LED is connected to Pin PB2 through jumper JP4 as shown here.

TO S4 KEY
PB2
Vcc

IR LED
JP4

An IR Receiver sensor is also connected to the Pin PB3 through a jumper named

S3 / IR SENSOR

IR REMOTE RECEIVER
PB3
TO S3 KEY

S3 / IR
RECEIVER
ENABLE

11) SAMPLE PROGRAMS:

The sample programs for the various Hardware are provided in the CD provided with the Kit

The CD also contains the AVR Studio and the Software ( Mega Load ) for downloading the
Hex file generated by the AVR Studio in the AVR ATMEGA8 chip. One just needs to use the
write the program in C language and compile the program using AVR Studio. This Hex file can
be down loaded in the on Board AVR chip using the Mega Load software.

Excel Technologies Page 11

You might also like