Avr Dev BRD User Manual
Avr Dev BRD User Manual
Avr Dev BRD User Manual
Package Contents:
Development Board
16*2 LCD (as per order)
ATMEGA16 microcontroller (as per order)
Xbee Module (as per order)
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
PROVOTECH
Sense. Innovate. Educate
Pinout:
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
PORTB.0 TO PORTB.3
PORTB.4
PORTB.5
PORTB.6
PORTB.7
PC.0 TO PC.3
PC.4
PC.5
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
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
PROVOTECH
Sense. Innovate. Educate
Legent file:
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)
PROVOTECH
Sense. Innovate. Educate
I2C
UART
Pin 1 GND
Pin 2 SCL
Pin 3 SDA
Pin 1
Pin 2
Pin 3
GND
RX
TX
VCC
GND
PORTA.0 to PORTA.3
PORTA.7 to PORTA.4
PROVOTECH
Sense. Innovate. Educate
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)
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
PROVOTECH
Sense. Innovate. Educate
2. Select the clock frequency F_CPU, select the clock frequency applied to the
FORMAT = ihex
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
PROVOTECH
Sense. Innovate. Educate
the microcontroller.
AVRDUDE_PROGRAMMER = ponyser (when using serial ISP programmer
for
programming)
= usbasp (when using USBASP programmer for
programming)
PROVOTECH
Sense. Innovate. Educate
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
PROVOTECH
Sense. Innovate. Educate
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);
}
}
//end of while
//end of main