Sunteți pe pagina 1din 17

PROVOTECH

Sense. Innovate. Educate

AVR Development Board

Package Contents:

Development Board
16*2 LCD (as per order)
ATMEGA16 microcontroller (as per order)
Xbee Module (as per order)

For further enquiry please email us at info@allsensor.in

PROVOTECH
Sense. Innovate. Educate
Features:
Supply Voltage: 7V to 15V DC
Powerful Atmega16/32 microcontroller supports
On board features:
Motor Driver
Stepper Motor Driver
Four general purpose LEDs and Switches
16*2 LCD
Two seven-segment LED Display
5 Voltage Regulator
Sensor interface port (PORTA)
Programming interface(PROG)
POT for ADC
POT for LCD Contrast
Buzzer
Relay
MAX 232 with serial connector(DB9)
XBee interface provision
4*4 Keypad Matrix interface provision
Break-out of I2C, SPI, Display, Motor, Switch, LED, XBee

For further enquiry please email us at info@allsensor.in

PROVOTECH
Sense. Innovate. Educate
Pinout:

DC IN JACK: DC Input for Microcontroller.


Power enable switch: This is power enable switch to Turn ON or Turn OFF
board.
Power LED: Board power indicator LED.
Sensor Port: Provision to connect 8 sensors, also facilitates the extern
sensor to get +5V power from VCC and GND.(PORTA.0 to PORTA.7)
VOUT: Unregulated output.

For further enquiry please email us at info@allsensor.in

PROVOTECH
Sense. Innovate. Educate
General purpose switches: 4 general purpose switch which
can be used as input, (in active low configuration).
General purpose LED: 4 general purposes LED (in active low
configuration)
16*2 LCD interface: 16 pin male connector for connecting 16*2 LCD.
LCD Contrast potentiometer: To adjust the contrast of LCD.
Buzzer: onboard general purpose buzzer to generate audible tones.
Reset switch: to reset the microcontroller.
Programming interface: Programming pins of the microcontroller through
male FRC connector.
SPI and I2C break-out.
Microcontroller PINOUT:

Peripheral connected

Microcontroller
PORT

SENOR 1 TO SENSOR 5
SENSOR 6/RELAY
SENSOR 7/BUZZER

PORTA.0 TO PORTA.5
PORTA.6
PORTA.7

LED1 TO LED4(ACTIVE LOW)


SPI CONNECTOR PIN 6
SPI CONNECTOR PIN 3
SPI CONNECTOR PIN 4
SPI CONNECTOR PIN 5

PORTB.0 TO PORTB.3
PORTB.4
PORTB.5
PORTB.6
PORTB.7

LCD DATA PINS/


INPUT TO 7447
LCD ENABLE/
ENABLE OF 7 SEGMENT LED1
LCD RS/
ENABLE OF 7 SEGMENT LED2

PC.0 TO PC.3
PC.4
PC.5

For further enquiry please email us at info@allsensor.in

PROVOTECH
Sense. Innovate. Educate
SWITCH3(ACTIVE LOW)
SWITCH4(ACTIVE LOW)

PC.6
PC.7

RX/XBee DOUT
TX/XBee DIN
SWITCH1(ACTIVE LOW)
SWITCH2(ACTIVE LOW)
MOTOR 1 IN
MOTOR 2 IN
MOTOR 3 IN
MOTOR 4 IN

PD.0
PD.1
PD.2
PD.3
PD.4
PD.5
PD.6
PD.7

Active Low LED:


LEDs are connected in Active LOW configuration so to turn ON the LED user
has to apply logic low (0) signal at the LED PIN and to turn OFF the LED apply
logic high (1) signal at the LED pin.
Active Low Switches:
Switches are connected in Active LOW configuration when switch is pressed it
will read logic low (0) at the switch PIN and when not pressed will read logic
high (1).
Jumper setting:

JP1
JP2
JP3
JP4

Pin 2 and 1
Pin 2 and 3
Pin 2 and 1
Pin 2 and 3
Pin 2 and 1
Pin 2 and 3
Pin 2 and 1
Pin 2 and 3

7 segment LED VCC


LCD VCC
L293D power supply
ULN2003 power supply
Relay connection
ADC7
Buzzer
ADC6

For further enquiry please email us at info@allsensor.in

PROVOTECH
Sense. Innovate. Educate

Legent file:

Pin out Description:

SD Card Module

Pin 1
Pin 2
Pin 3
Pin 4
Pin 5
Pin 6

3.3V
GND
MOSI (Master out slave in)
MISO (master in slave out)
SCK (Serial clock)
SS (slave select)

For further enquiry please email us at info@allsensor.in

PROVOTECH
Sense. Innovate. Educate
I2C

UART

Pin 1 GND
Pin 2 SCL
Pin 3 SDA

Pin 1
Pin 2
Pin 3

GND
RX
TX

4*4 KEYPAD Matrix Pin 1


Pin 2
Pin 3,5,7,9
Pin 10,8,6,4

VCC
GND
PORTA.0 to PORTA.3
PORTA.7 to PORTA.4

For further enquiry please email us at info@allsensor.in

PROVOTECH
Sense. Innovate. Educate

Programming AVRoN16 development board:


To start programming the AVRoN16 Board first we will need the compiler
which will translate the higher level c code to the hex code which can be
recognize by the microcontroller (microcontroller only understands hex code)
and a burner which will transfer the hex code generated from the computer to
the microcontroller program memory.
There are ample of free softwares available for AVR microcontroller
programming like AVRStudio (compiler), PonyProg (burner) ,Win-Avr (compiler
+ burner) etc.
For programming the AVRoN16 board we are going to use WinAvr software
Software installers:
Free version of the software package is provided in the CD.
Install the software before proceeding.
To start writing a c code, first launch programmers notepad application of
WinAvr from computers start menu.
StartAll ProgramsWinAvrProgrammer Notepad [WinAvr]
Create new file by selecting
FileNewDefault or by simply using the keyboard shortcut keys Ctrl+N

For further enquiry please email us at info@allsensor.in

PROVOTECH
Sense. Innovate. Educate

Now write the program in the file and save the file with .c (filename.c)
extension in the folder. (For different programs use different folders)

For further enquiry please email us at info@allsensor.in

PROVOTECH
Sense. Innovate. Educate
Now to compile the code we will be need the Makefile, you can
find the Makefile in the sample code folder from the CD provided.

Copy the Makefile to the Project folder where we saved the .c file. (User has
to keep both the .c file and Makefile in same folder)
NOTE: Do not rename the Makefile and dont give any extension to file.
Now open the Makefile in programmers notepad.

User has
to

configure the Makefile for the target microcontroller. Following are the
configuration settings:
1. #MCU name : Here write the name of target microcontroller , in AVRoN16
we are using ATMEGA16 so the name will be MCU=atmega16

For further enquiry please email us at info@allsensor.in

PROVOTECH
Sense. Innovate. Educate
2. Select the clock frequency F_CPU, select the clock frequency applied to the

microcontroller, in our case the microcontroller is supplied with onboard


16MHz crystal so the F_CPU will be
F_CPU=16000000

3. FORMAT: Select the output format as ihex (intel hex)

FORMAT = ihex

For further enquiry please email us at info@allsensor.in

PROVOTECH
Sense. Innovate. Educate
4. TARGET: Here write the filename without any .c extension.

5. Fuse Setting: user can perform different settings, fuse bit determines the

behavior of the chip, whether it has a boot loader, watchdog timer


conditions, clock speed definitions etc. so that user can configure the chip
in accordance with their requirement.
NOTE: Read the microcontroller datasheet before changing the fuse bits as
playing with fuse bits may damage the microcontroller permanently.

Following is the recommended fuse setting for atmega16.

For further enquiry please email us at info@allsensor.in

PROVOTECH
Sense. Innovate. Educate

6. Programming options: This section defines the programming interface for

the microcontroller.
AVRDUDE_PROGRAMMER = ponyser (when using serial ISP programmer
for
programming)
= usbasp (when using USBASP programmer for
programming)

AVRDUDE_PORT = com1 (when using serial ISP programmer for


programming)
= usb (when using USBASP programmer for
programming)

For further enquiry please email us at info@allsensor.in

PROVOTECH
Sense. Innovate. Educate

Once the Makefile is configured with above setting, user


can now compile the c code and load the hex file on
microcontroller. Follow the steps below to compile and
load the code on microcontroller.
Step 1 : Select Tools tab from the winAVR window, in
Tools click on [winAVR] Make Clean and check out
the output window for any issues. If output window is
displaying
>process Exit Code: 0 then make clean is successful.
Step 2: Now we will compile the C-code to generate the
hex file.

For further enquiry please email us at info@allsensor.in

PROVOTECH
Sense. Innovate. Educate
Select Tools tab from the winAVR window, in Tools click on [winAVR]
Make All and check out the output window for any errors in code. If output
window is displaying
>process Exit Code: 0 then make All is successful.

After successful compilation we are ready to load the hex code from computer
to the microcontroller program memory.
Follow following steps to load the code on microcontroller.
1. Power On the board.
2. Connect the programmer interface to the board (Serial ISP programmer or
USBASP programmer. Etc) in case of ISP serial programmers make sure that the
switch is not pressed on the programmer board.)
3. Make sure that hyper terminal program is closed. (In case of serial ISP
programmer if hyper terminal is open while programming you will get error as:
avrdude: ser_open(): can't open device "com1": Access is denied.)
4. Now click on Tools and select [winAVR] Program to transfer the code
from computer to microcontroller, after successful loading of the code on
microcontroller the output window will display the following message.
> process Exit Code: 0

For further enquiry please email us at info@allsensor.in

PROVOTECH
Sense. Innovate. Educate

For further enquiry please email us at info@allsensor.in

PROVOTECH
Sense. Innovate. Educate
Sample code:
Program to Blink LED:
/* Program to blink LED*/
#include<avr/io.h> // Header file for IO operations
#include<util/delay.h> //HEader file for using inbuilt delay function
////////MICRO DEFINITIONS///////////
#define bit(p) (1<<(p))
#define clear_bit(p,b) p&=~b
/// sends 0 to the selected bit
#define set_bit(p,b) p|=b
/// sends 1 to the selected bit
#define flip_bit(p,b) p^=b
/// toiggles selected bit
#define check_bit(p,b) p&b
//// checks the status of selected bit
/// LEDS are connected in active LOW configiuration
////LED Connections
////LED1 == PB0
////LED2 == PB1
////LED3 == PB2
////LED4 == PB3
int main(void)
{
DDRB=0xFF;
PORTB=0xFF;
while(1)
{
PORTB=0xF0;
_delay_ms(1000);
PORTB=0xFF;
_delay_ms(1000);
}
}

// Infinite loop to execute program repeatedly

//end of while
//end of main

For further enquiry please email us at info@allsensor.in

S-ar putea să vă placă și