Вы находитесь на странице: 1из 20

P VOTTECH

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.

To startt writing a c code, first launch prog


grammers notepad
n app
plication of WinAvr
W froom
computters start meenu.
StartÆAllA Program msÆWinAvvrÆPrograammer Noteepad [WinA Avr]

Create nnew file by selecting


FileÆNNewÆDefault or by sim mply using the keyboaard shortcut keys “Ctrll+N”

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))

Now to compile thhe code we will


w be needd the “Makeefile”, you can
c find thee “Makefile” in the
sample code folderr from the CD
C providedd.

Copy thhe “Makefile” from CD D to the Prooject folder where we saved


s the .c file. (User has to
keep booth the .c fille and Makeefile in samee folder)

NOTE:: Do not rename the Makefile


M an
nd don’t givve any exteension to fille.

Now oppen the “Ma


akefile” in pprogrammer’s notepad.

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

2. Seelect the clocck frequenccy F_CPU, select the clock


c frequeency appliedd to the
miicrocontroller, in our caase the micrrocontrollerr is suppliedd with onboard 16MHzz crystal
so the F_CPU U will be
F_CPU=16 6000000

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.  

Followiing is the reecommended fuse settinng for atmega16. 

 
 
 
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)

AV PORT = coom1 (whenn using seriaal ISP progrrammer for programminng)


VRDUDE_P
= usbb (when using
u USBA ASP program mmer for prrogrammingg)

www
w.provottech.in  
P
PROVOT
TECH

 
 

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.

Select ““Tools” tab from the winAVR


w winndow, in “TTools” clickk on “[winA AVR] Make All”
and cheeck out the output
o winddow for anyy errors in coode. If outpuut window is displayinng

>processs Exit Codde: 0 then make


m All is successful.
s

 
After suuccessful co
ompilation we
w are ready
y to load the hex code from compu
uter to the
microcoontroller proogram memmory.

Follow following steps


s to loadd the code on
o microconntroller.

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)

3. Makee sure that hyper


h terminnal program
m is closed. (In case of serial ISP programmer
p r if
hyper teerminal is open
o while programmin
p ng you will get error ass: avrdude: ser_open(): can't
open deevice "com1 1": Access is denied.)

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.

>processs Exit Codde: 0

www
w.provottech.in  
P VOTTECH
PRO H 
 
 
Configu
uring Hypeer Terminaal of compu
uter:

To launnch the hypeer terminal application


a goto;

Start>A ms>Accessories>Comm
All Program munication>
>Hyper term
minal.

Give naame to conn


nection and click “OK””

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.

User caan configuree these param


meters accoording to theeir settings.

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:

LCD_ININIT (): Thiis is the funcction to inittialize the LCD


L modulee, always write this funnction
before uusing other LCD functiions.

LCD_CCMD ( ): Th his function is used to give


g commaands to the LCD.
L wing is the list of
Follow
commannds for the LCD
0x01; /* COMMAND TO CLEAR C DISSPLAY SCRREEN */
0x02; /* COMM MAND TO MOVE M CUR RSOR TO HOME
H POSSITION */
0x0F; /* COMM MAND TO TURN ON THE DISP PALY */
0x10; /* COMMA AND TO SH HIFT CURS SOR TO LE
EFT */
0x14; /* COMMA AND TO SH HIFT CURS SOR TO RIIGHT */
0x18; /* COMMA AND TO SH HIFT ENTIIRE DISPLA AY TO LEF FT */
0x1C; /* COMMA AND TO SH HIFT ENTIIRE DISPLA AY TO RIGGHT */
0x80; /* ADRES SS FOR LIN NE1 */
0xC0; /* ADRESS S FOR LIN NE2 */
0x0C; /* COMMA AND TO TU URN ON DISPLAY
D A
AND TURN N OFF CUR RSOR */
0x08; /* COMMA AND TO TU URN OFF DISPLAY
D A
AND CURS SOR */

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

LCD_G GOTOLINE E1 ( ): this function


f willl set the currsor of the LCD
L on the desired collumn
(1-16) oon first line of the LCDD.eg. LCD_GOTOLINE NE1 (6) will set the curssor at 6th coolumn
of first line.

LCD_G GOTOLINE E2 ( ): this function


f willl set the currsor of the LCD
L on the desired possition
(1-16) oon second liine of the LCD.eg. LCD D_GOTOLIINE2 (4) will w set the cursor
c at 4thh
columnn of second line.
l

LCD_N NUMBER ( ): This funnction will display


d 4 diggit decimal value of a number
n on the
t
LCD.egg LCD_NUM UMBER (10224) will display 1024 on o the LCD also LCD_ _NUMBER((0xEE)
o the LCD.
will display 0238 on

www
w.provottech.in  
P VOTTECH
PRO H 
 
 
Prograammer conn
nections to AVRoN16
6:

1. Serial ISP Programmeer Connection:

2. USB progrrammer Connnections:

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:

For techniccal assistancee please mail your queries


q s at
tech@
@provootech.inn

For purchaasing differen


d nt prod
ducts, sensors
s s and
acceessoriess onlinee log on to:
www
w.allsen
nsor.in 
 

www
w.provottech.in  

Вам также может понравиться