P PRO VOT Tech H: AV Vron N16
P PRO VOT Tech H: AV Vron N16
P PRO VOT Tech H: AV Vron N16
PRO H
AV
VRoN
N16
Low coost versatile ATMEGA16 developm
ment board for beginneers and reseearchers
Packagee contents:
¾ AVRoN16 Bo oard.
¾ ATMEGA16 microcontro oller.
¾ 16X2 LCD (O
Optional).
¾ CD containin
ng documenttation, softw ware and sammple code.
Featurees:
¾ Supply powe er:7V to 15VV DC
¾ Powerful Atmega16 microcontroller.
¾ Onboard Feaatures
1. Tw wo L293D mmotor driver
2. Fo our general purpose swittches and LEED
3. LC CD Connectoor
4. 5 volt regulator
5. Seensor interfaace
6. Programing in nterface
7. Power & motor enable sw witches with visual indicaators
8. Potentiometeer for ADC te esting
9. Buzzer
10. LEED indicatorss for motor o
output tracking
11. 16MHz crystaal
12. Supply voltage O/P througgh PTR connector
www
w.provottech.in
P VOTTECH
PRO H
PINOU
UT:
1. DC IN jack: DDC Input PIN
N for microcoontroller.
2. Power enab ble switch: Thhis is Power enable switcch to Turn ON or turn OFFF power to tthe
board. When pressed tu urns ON the bboard and when released d turns OFF tthe board
3. Power enab ble indicator: Board power indicator LED.
4. Motor enab ble switch: Too enable or d
disable the oonboard mottor drivers.
5. Motor enab ble indicator:: Motor enabble status inddicator LED.
6. Motor output indicator LEDS: Displaays the moto or output pin
n status.
7. Motor output connecto or: Connectorrs for interfaacing motors to the board d.
8. L293D Moto or driver: Tw
wo L293D mo otor drivers w with driving ccapability of 600mA per cchannel.
9. LCD contrasst Potentiom meter: To adjust the contrast of LCD
10. 16x2 LCD intterface: 16 P
PIN male con nnector for connecting 16 6x2 LCD.
11. Motor output indicator LED jumperr: To enable o or disable the motor outtput status.
12. Buzzer: Onbboard generaal purpose bu uzzer to geneerate audiblee tones (Actiive low).
13. P89V51RD2 Microcontroller: Phillips 40 PIN DIP package miccrocontroller with 64K flaash.
14. 5V voltage rregulator: 78
805 voltage rregulator to supply consttant 5V supp ply to microcontroller
and peripheerals.
15. RESET Switcch: To RESET the microco ontroller.
16. General purrpose LED: 4 general purpose LEDs(A Active low)
www
w.provottech.in
P VOTTECH
PRO H
17. General purrpose switchhes: 4 Generaal purpose sw witches(Activve low)
18. ADC potentiometer: forr testing ADC C feature.
19. Supply voltaage output: Provides thee supply voltaage output.
20. Sensor Port: Provision too connect 8 ssensors, also
o facilitate th
he external sensor to get +5 V
power from the board th hrough (+) &
& (‐) PINS
21. Switch pins:: These pins can be used as sensor PINS when sw witches are noot in use.
22. SPI and I2C PINs: These pins are available througgh male bergg header.
23. Programmin ng interface:: Programming pins of th he microconttroller througgh male FRC
connector.
PROGRA
AMMING INTTRFACE PINO
OUT:
Jumper Setting:
www
w.provottech.in
P VOTTECH
PRO H
Microcoontroller PINNOUT:
Periphheral Conne ected M
Microcontrol ler PORT
LCDD AND BUZZEER PORT T
LC
CD DATA PINS PC.0 TO P
PC.3
LLCD ENABLE PC.4
LCD RS PC.5
Buzze er (Active HIIGH) PC.7
Active HIGH H Buzzer: Bu
uzzer is connected in
Active HIGH H configurattion so to turrn ON
MOTORS PORT T the Buzzer user has to aapply logic HHIGH (1)
M1 (MOTOR‐1 1) PB.0,PBB.1 signal at the Buzzer pin
n and to turn OFF
M2 (MOTOR‐2 2) PB.2,PBB.3 the Buzzer apply logic LLOW (0) signal at the
M3 (MOTOR‐3 3) PD.4,PDD.5 Buzzer pin.
M4 4 (MOTOR‐4 4) PD.6,PDD.7
SENSORS PORT T
SENSOR 1 PA.0
SENSOR 2 PA.1
SENSOR 3 PA.2
SENSOR 4 PA.3
SENSOR 5 PA.4
SENSOR 6 PA.5
SENSOR 7 PA.6
SENSOR 8 PA.7
Active Loww LED: LEDS aare connecteed in
Active LOWW configuration so to turn n ON the
SWITCCH AND LED P PORT PORT
T LED user haas to apply lo ogic low (0) ssignal at
LED11 (ACTIVE LO OW) PB.4 the LED PINN and to turn n OFF the LED D apply
LED22 (ACTIVE LO OW) PC.6 logic high (1) signal at tthe LED pin.
LED33 (ACTIVE LO OW) PD.0
LED44 (ACTIVE LO OW) PD.1
SWITCH1 (ACTIVE LOW) PB.5
Active Loww switches: sw witches are
SWITCH2 (ACTIVE LOW) PB.6
connected in Active LO OW configuraation
SWITCH3 (ACTIVE LOW) PD.2
when switcch is pressed it will read llogic low
(IN
NTERRUPT 0 0)
(0) at the sw
witch PIN annd when not pressed
SWITCH4 (ACTIVE LOW) PD.3 will read lo
ogic high (1).
(IN
NTERRUPT 1 1)
Program
m to Blink LLEDs:
www
w.provottech.in
P VOTTECH
PRO H
Below is the sample program to blink LED
Ds.
// PROG GRAM TO BLINK LEDs ///
#include<avr/io.h> > // IO head der file
#include<util/delayy.h> // inbu uilt delay heeader file
// Micro o definition
ns
#definee bit(p) (1<<<(p))
#definee clear_bit(pp,b) p&=~b
#definee set_bit(p,bb) p|=b
#definee flip_bit(p,b
b) p^=b
#definee check_bit((p,b) p&b
int mainn(void)
{
set_bit((DDRB,bit(4 4)); //Initialise LED 1 ass output
set_bit((DDRC,bit(6 6)); // Initialise LED 2 aas output
set_bit((DDRD,bit(0 0)); // Initiaalise LED 3 aas output
set_bit((DDRD,bit(1 1)); // Initiaalise LED 4 aas output
while(1) // infinite
e loop to exxecute proggram repeattedly
{
clear_bit(DDRB,bitt(4)); // Turrn ON the LEDs
clear_bit(DDRC,bitt(6));
clear_bit(DDRD,bitt(0));
clear_bit(DDRD,bitt(1));
_delay__ms(1000); // Wait 1 second
set_bit((DDRB,bit(4 4)); //Turn O OFF the LEDDS
set_bit((DDRC,bit(6 6));
set_bit((DDRD,bit(0 0));
set_bit((DDRD,bit(1 1));
_delay__ms(1000); //Wait 1 second
d of while loop
} // end
return 00;
} // endd of main function
For morre programss and expla anations refefer the samp ple codes prrovided in C
CD.
www
w.provottech.in
P VOTTECH
PRO H
Programming AVRoN16
A 6 develop
pment boaard:
To startt programmming the AV VRoN16 Booard first wee will need the t compileer which willl
translate the higherr level c codde to the hexx code whicch can be reecognize byy the
microcoontroller (m
microcontrolller only undderstands heex code) annd a burner which will transfer
the hex code generrated from thhe computeer to the miccrocontrolleer program memory.
m
There are
a ample off free softwaare’s availaable for AVR
R microcon
ntroller proggramming liike
AVRStuudio (comppiler), PonyP
Prog (burneer) ,Win-Avvr (compilerr + burner) etc.
e
For programming the t AVRoN N16 board wew are goingg to use Win nAvr software, winAV VR
contains all the too
ols for develloping on thhe AVR. Thhis includes avr-gcc (coompiler), avvrdude
(program
mmer), avr--gdb (debuggger), and more.
m
Software installerrs:
Free version of thee software package
p is provided in the
t CD.
Install the
t softwaree before prooceeding.
www
w.provottech.in
P VOTTECH
PRO H
Now wrrite the proggram in the file and savve the file with
w .c (filen
name.c) exttension in thhe
folder. ((For differeent program
ms use different folders))
www
w.provottech.in
P VOTTECH
PRO H
User haas to configuure the “Maakefile” for the target microcontro
m oller. Follow
wing are thee
configuuration settinngs:
1. #MMCU name : Here writte the name of target microcontroll
m ler , in AVR
RoN16 we area
usiing ATMEG GA16 so thee name willl be MCU=aatmega16
www
w.provottech.in
P VOTTECH
PRO H
3. FO
ORMAT: Seelect the ouutput formatt as ihex (inntel hex)
FO
ORMAT = ihex
i
4. TA
ARGET: Heere write thee filename without
w anyy .c extensioon.
www
w.provottech.in
P VOTTECH
PRO H
5. Fuuse Setting: user can peerform different settings, fuse bit determines
d the
t behaviorr of the
chip, whetherr it has a booot loader, watchdog
w tim
mer conditioons, clock sppeed definittions
etcc. so that user can confi hip in accorddance with their requirrement.
figure the ch
NO OTE: Read the microcoontroller dattasheet befoore changin ng the fuse bits
b as playinng with
fusse bits may damage thee microconttroller perm manently.
6. Proogrammingg options: Thhis section defines
d the programming interfacee for the
miicrocontroller.
AVVRDUDE_P PROGRAM MMER = poonyser (wheen using serial ISP prog grammer for
proogramming)
= usbbasp (when using USBA ASP prograammer for
proogramming)
www
w.provottech.in
P
PROVOT
TECH
H
www
w.provottech.in
P VOTTECH
PRO H
Once thhe Makefile is configurred with aboove setting, user can noow compile the c code and
load thee hex file onn microconttroller. Folloow the steps below to compile
c and
d load the coode on
microcoontroller.
Step 1 : Select “Toools” tab froom the winAAVR windoow, in “Tools” click onn “[winAVR R]
Make Clean”
C and check out thhe output window
w for aany issues. If
I output wiindow is dissplaying
>processs Exit Codde: 0 then make
m clean is
i successfuul.
www
w.provottech.in
P VOTTECH
PRO H
Step 2: Now we wiill compile the C-code to generatee the hex filee.
After suuccessful co
ompilation we
w are ready
y to load the hex code from compu
uter to the
microcoontroller proogram memmory.
1. Poweer On the bo
oard.
2. Connnect the proggrammer innterface to thhe board (Serial ISP prrogrammer or USBASP
P
program
mmer. Etc) ini case of ISSP serial programmers go throughh the program mmer’s
documeentation for details)
www
w.provottech.in
P VOTTECH
PRO H
4. Now click on “T Tools” and select
s “[winnAVR] Proggram” to traansfer the coode from coomputer
to microocontroller, after succeessful loadin
ng of the coode on microocontroller the output window
w
will display the folllowing messsage.
www
w.provottech.in
P VOTTECH
PRO H
Configu
uring Hypeer Terminaal of compu
uter:
Start>A ms>Accessories>Comm
All Program munication>
>Hyper term
minal.
www
w.provottech.in
P VOTTECH
PRO H
Select tthe COM POORT if you are using computer
c serrial PORT then
t generaally the COM
M
PORT w will be COM
M1 else if you
y are using USB to seerial converrtor then finnd the COM
M port
name inn the compuuters Devicee manager.
To findd the COM Port
P name go g to My CoomputerÆProperties
P ÆDevice maanagerÆ Poorts
(COM & LPT)
Now coonfigure thee Port for baaud rate, herre click on “Restore
“ Deefault” buttton which will
w
restore different paarameters too its default values as below
b then click
c “OK”..
Bits perr seconds: 9600.
9
Data biits: 8.
Parity: None.
Stop bitts: 1.
Flow coontrol: Non ne.
Note: M
Make sure that
t the baaud rate and other setttings are saame for thee microcontroller
and hyp
per termin
nal.
www
w.provottech.in
P VOTTECH
PRO H
LCD Liibrary funcctions:
e.g. LCD
CD_CMD (0
0x02) will move
m the currsor to the home
h position.
LC
CD_CMD (08)
(0 will turnn OFF the LCD
L displayy and cursoor.
LCD_C
CHAR ( ): This o the LCD.eg.
T functionn is designeed to displayy the single character on
LCD_C
CHAR (‘X’)) will displaay ‘X’ on LC
CD.
LCD_S STRING ( ):: This functtion will Dissplay the chharacter string on the LCD.
L
e.g. LCD
CD_STRINGG (“AVRoN N16”); will display AVR VRoN16 on the t LCD
www
w.provottech.in
P VOTTECH
PRO H
Prograammer conn
nections to AVRoN16
6:
www
w.provottech.in
P VOTTECH
PRO H
ADC P
POT:
By varyying the onbboard potenntiometer thee voltage att ADCO pinn will vary which
w can be
b used
to test thhe ADC feaature of the microcontrroller by connnecting thee ADCO pinn with the desired
d
ADC PIIN (PA0…...PA7) usinng a conneccting wire provided
p witth the kit.
www
w.provottech.in
P VOTTECH
PRO H
Con
ntact Us:
www
w.provottech.in