AVR Development Board (107010) : User's Manual
AVR Development Board (107010) : User's Manual
AVR Development Board (107010) : User's Manual
Users Manual
Users Manual
PROPRIETARY NOTICE This document contains proprietary information furnished for evaluation purposes only; except with the express written permission of Technophilia, such information may not be published, disclosed, or used for any other purpose. You acknowledge and agree that this document and all portions thereof, including, but not limited to, any copyright, trade secret and other intellectual property rights relating thereto, are and at all times shall remain the sole property Technophilia and that title and full ownership rights in the information contained herein and all portions thereof are reserved to and at all times shall remain with Technophilia. You acknowledge and agree that the information contained herein constitutes a valuable trade secret of Technophilia. You agree to use utmost care in protecting the proprietary and confidential nature of the information contained herein.
Users Manual
Contents 1. Product Description: ............................................................... 4 1.1. AVR Development Board 107010: .......................................... 4 2. Parts Identification ................................................................. 5 2.1. Microcontroller .................................................................... 5 2.2. 1117 VOLTAGE REGULATOR ................................................. 5 2.3. MAX232 ............................................................................. 6 2.4. L293NE MOTOR DRIVER....................................................... 6 2.5. 16 X 2/16 X 1 LCD INTERFACE .............................................. 6 2.6. SWITCHES ........................................................................... 6 2.7. POWER SUPPLY .................................................................... 7 2.8. LEDs.................................................................................. 8 2.9. BZ (BUZZER) ........................................................................ 8 2.10. ISP (IN-SYSTEM PROGRAMMING) INTERFACE ......................... 8 2.11. RS 232 INTERFACE........................................................... 8 2.12. PA (PORTA) ....................................................................... 8 2.13. PB (PORTB) ........................................................................ 8 2.14. MOTOR DRIVER CONNECTIONS ........................................... 9 3. The AVR Microcontrollers: ....................................................... 10 3.1. Description ......................................................................... 10 3.2. Programming ...................................................................... 10 3.3. Sample codes ...................................................................... 10
Users Manual
1. Product Description:
1.1. AVR Development Board 107010:
Includes Atmels ATmega16 Microcontroller with 16kb flash memory working at 16MIPS or ATmega8535 Microcontroller with 8kb flash memory working at 16MIPS. Compatible with all AVR 40 pin micro controllers. On-board LCD interface (it can also be used for any other general purpose application). On-board Motor Driver for connecting 4 DC motors or 2 Stepper motors. On-board regulated power supply. PC interface through UART. On-board Buzzer. 16 MHz external crystal. Exposed all 32 I/O pins. Exposed 8 channel I/O pins for ADC and sensors with 5V/1A power supply. Exposed 8 channel I/O pins for servo and sensors with dual power supply. Five tact switches for external input and reset. Four test surface mounted LEDs for status and debugging purpose. Two supply indicator LEDs. Dual power supply through DC source (6V to 16V) or USB powered. On board USB programmer. Dual or single power supply option. Exposed ISP pins for programming.
Users Manual
2. Parts Identification
Motor Enable Switch
Buzzer
RST
S4
S3
S2
S1 Microcontroller
L293NE Drivers
2.1. Microcontroller
It is a micro computer chip which stores our programs executes them and takes necessary action. The chip used hear is Atmels popular AVR micro controller.
Users Manual
2.3. MAX232
This IC takes care of voltage conversion needed for the communication between the PC's RS-232 (Serial/COM) port and AVR Development board.
2.6. SWITCHES
Four tact switches along with a Reset switch are present on the board in order to provide an external input to the board. The switches are connected in the following manner: S1 S2 S3 S4 PortA4 PortA5 PortA6 PortA7
RST (Reset switch): The Reset switch is basically used to reset a running program right to the beginning it is same as the reset switch of a PC. MOTEN (Motor Enable Switch): It is basically a toggle switch which toggles the enables or disables of the motor drivers by setting the switch in either ON or OFF mode. POWER (Power On Switch): It is basically a toggle switch used to provide power supply to the main board. The power can be supplied either by a battery power supply (through LS) or 6
Users Manual
can be USB powered. Thus, the POWER switch can be made to toggle between MP (Main Power) or UP (USB Power). PTOG (Power Toggle Switch): It is basically a toggle switch which toggles the power for the devices connected to PORTB either to use the internal power supply (5V) of the main board (by setting the switch in 5V mode) or to use any other external power source connected in DS for the high power applications like servo motors (by setting the switch in EXT mode). PROG (Programming Switch): It is also a toggle switch for programming the microcontroller using on board USB programmer. For programming mode it should be ON then RESET button should be pressed. For normal operation it should be off.
Users Manual
2.8. LEDs
Active high: RED LED1 RED LED2 RED LED3 RED LED4 GREEN LS GREEN DS PORTC4 PORTC5 PORTC6 PORTC7 Logic Power ON indicator Driver Power ON indicator
2.9. BZ (BUZZER)
It can be easily used to get an audible feedback from the controller. It is connected in an active high mode, i.e., the buzzer beeps when the data given to it is 1. The Buzzer is connected to the pin PORTC3 of the microcontroller.
2.12. PA (PORTA)
It is a general purpose I/O port. This port contains eight pins that can be used as digital input, ADC in and digital out put. These pins are in the form, DATA-VCCGROUND (denoted as D + - respectively on the board). The Data pins are towards the microcontroller. The VCC and Ground pins are provided with a 5V/1A power supply.
2.13. PB (PORTB)
It is a general purpose I/O port. This port contains eight pins that can be used as digital input and digital out put. These pins are in the form, DATA-VCC-GROUND (denoted as D + - respectively on the board). The VCC and Ground pins are provided 8
Users Manual
with a 5V/1A power supply or the suply to this pins can also be switched to external supply connected in DS pin through EXT switch.
Users Manual
3.2. Programming
WinAVR is a suite of executable, open source software development tools for the Atmels AVR series of RISC microcontrollers hosted on the Windows platform. It includes the GNU GCC compiler for C and C++. Steps for writing a code using WinAVR 1. Open the Programmers Notepad and write your code. 2. Create a new folder and save your code in that folder with extension name .c 3. Now open the make file and edit it as mentioned bellow: 4. Make file main filename (give your file name here without extension) 5. Make file MCU type ATmega (chose your UC) 6. Make file Debug format AVR-ext-COFF 7. Make file Programmer select your programmer (if your programmer is not in the list then follow the step3.d) 8. Make file port (select the port where you have connected your programmer) 9. Make file enable editing make file then in your make file edit the following things 10. F_CPU = 16000000 (change it as for your crystal frequency) AVRDUDE_PROGRAMMER = stk500 (here write down you programmers name) 11. Save the make file in your folder without changing its name. 12. Now open the programmers notepad. 13. To compile your code and to generate hex file (Tools make all). 14. To upload your code into your UC (Tools program).
10
Users Manual
// initialization of port C as all bits low. // data direction declaration of port C lower bits as o/p port.
Code2. Program to blink all the LEDS connected in PortC #include<avr/io.h> #include delay.h int main(void) { PORTC=0x00; DDRC=0xFF; while(1) { PORTC=0xF0; delayms(1000); PORTC=0x00; delayms(1000); } return 0; } //This is the header for AVR Microcontroller. //header file to generate time delay.
// Port C initiallization as allbits low. // Port C data direction declaration as out put. //This is for the the infinity loop.
// Port C initialization as all bits low // Port C data direction configuration as output port // configuring the PORTA in pull-up mode. // Port A data direction configuration as input port. if((PINA &
11
Users Manual
PORTC=0x02; } else if((PINA & 0x40)==0x00) { PORTC=0x04; } else if((PINA & 0x80)==0x00) { PORTC=0x00; } } return 0; } Code 4.Generating frequency #include<avr/io.h> #include delay.h int main(void) { PORTC=0x00; DDRC=0xFF; while(1) { PORTC=0xFF; delayus(1000); PORTC=0x00; delayus(19000); } } //This is the header for AVR Microcontroller. //header file to generate time delay.
// Port C initialization as all bits low. // Port C data direction configuration as output port.
Code 4.Interfacing 16x2 LCD #include<avr/io.h> #includedelay.h //header file to generate time delay. #includelcd.h //header file for interfacing LCD int main() { lcd_init(); lcd_string("TECHNOPHILIA"); // function to print a string while(1) { } return 0; }
12