How2Use DT-AVR ATMEGA128L BMS. Oleh: IE Team. Picture 1 The layout of DT-AVR ATMEGA128L BMS

Similar documents
How2Use DT-AVR ATMEGA168 BMS. By: IE Team. Picture 1 The layout of DT-AVR ATMEGA168 BMS

How2Use DT-51 AT89C51XXX BMS. By: IE Team. Picture1 The layout of DT-51 AT89C51XXX BMS

Getting Started With the Micro64

LAMPIRAN. 1. Program Alat

ET-BASE AVR ATmega64/128

// WRITE data to be written to EEPROM

AN703. Micro64/128. Accessing the 36k of SRAM 12/3/04

4. Application Programming

LAMPIRAN A PROGRAM UTAMA ROBOT NOMOR 2

LAMPIRAN A. Universitas Sumatera Utara

LAMPIRAN A. Listing Program. Program pada Borland Delphi 7.0 A-1 Program pada CodeVisionAVR C Compiler A-6

LAMPIRAN A FOTO Radio Control Helikopter dan Pengendalinya

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

DT-ROBOT Line Follower

LAMPIRAN A. Foto Alat

LAMPIRAN. Program Keseluruhan Sistem Pengontrolan Level Air

Getting Started with STK200 Dragon

Programmer. User Guide

ET-AVRProg mini. Technical Specifications of ET-AVRProg mini

Figure 1. JTAGAVRU1 application The JTAGAVRU1 is supported by AVR Studio. Updated versions of AVR Studio is found on

Project : Version : Date : 11/04/2016 Author : Freeware, for evaluation and non-commercial use only Company : Comments:

keyestudio Keyestudio MEGA 2560 R3 Board

AVRminiV3.1 Manual. 1. AVRminiV3.1 Overview. 2. AVRminiV3.1 Features and Specifications Standard Features: 2.2. Optional Features:

ATMega128 Rapid Robot Controller Board [RKI-1148]

LAMPIRAN A FOTO ALAT

M32 Development Board

P89V51RD2 Development Board May 2010

Software Design Considerations, Narrative and Documentation

ET-PIC 24 WEB-V1. o Central Processing Unit (CPU) o System. o nanowatt Power Managed Modes. o Analog Features

Note that FLIP is an Atmel program supplied by Crossware with Atmel s permission.

TekBots TM Oregon State University. mega User Guide

An FTDI connection: The ATtiny microcontrollers don t have a hardware UART External Crystal header pins for an optional crystal

Installation and Maintenance

BOOTLOADER for AVR-Development Modules

Rhino Robot Control Board [RKI-1550]

Programming Microcontroller Assembly and C

PX-4000 mini-avr In-System programmer

Lab Course Microcontroller Programming

Manual of Board ET-PIC STAMP 18F8722-K22 ET-PIC STAMP 18F8722-K22

Lampiran I. Rangkaian Lengkap Alat. Universitas Sumatera Utara

EET203 MICROCONTROLLER SYSTEMS DESIGN Serial Port Interfacing

RFlasher7. Getting Started and Overview. Document version

RANGKAIAN LENGKAP. Universitas Sumatera Utara

Microcomputer/Controller Featuring the ATmega64 or the ATmega128

Mega128-Net Mega128-Net Mega128 AVR Boot Loader Mega128-Net

CodeVisionAVR VERSION User Manual

LAMPIRAN A List Program CodeVision Generato Data...A-1 List Program CodeVision Multiplexer...A-11 List Program CodeVision Demultiplexer...

HEX File Update TCS Technical Bulletin

2. Tutorial ESC Programming myavr MK2 USB UFO Doctor, June 5 rd, 2010

Robosoft Systems in association with JNCE presents. Swarm Robotics

Serial Compact Flash Serial CF Card Module User Manual

8051 General Purpose Board

Figure 1-1 ISPAVRU1 application

Table Of Contents TABLE OF CONTENTS...1

ARM HOW-TO GUIDE Interfacing GPS with LPC2148 ARM


Getting acquainted with the development tools June 27, 2006 ELE492 Embedded System Design Exercise 1

Table of Contents TABLE OF CONTENTS...1

// Voltage Reference: AREF pin #define ADC_VREF_TYPE ((0<<REFS1) (0<<REFS0) (0<<ADLAR))

Mega128-DEVelopment Board Progressive Resources LLC 4105 Vincennes Road Indianapolis, IN (317) (317) FAX

8-bit Microcontroller. Application Note. AVR033: Getting Started with the CodeVisionAVR C Compiler

AVR Development Board

AVR 40 Pin Rapid Robot controller board

Using Arduino Boards in Atmel Studio 7

STK User Guide

BIGdsPIC6. Development System. User manual

Breeze Board. Type A. User Manual.

CONTENTS BIGAVR2 KEY FEATURES 4 CONNECTING THE SYSTEM 5 INTRODUCTION 6

AVR XMEGA TM. A New Reference for 8/16-bit Microcontrollers. Ingar Fredriksen AVR Product Marketing Director

USB Dog Terminator. User's Manual.

8-bit Microcontroller. Application Note. AVR033: Getting Started with the CodeVisionAVR C Compiler

STK User Guide

AVR Peripheral Board. Campus Component Pvt. Ltd.

INTERFACING HARDWARE WITH MICROCONTROLLER

CN310 Microprocessor Systems Design

ET-BASE AVR (ATmega8535)

Embedded Systems and Software. Serial Communication

GRAVITECH GROUP

AVR Standalone ISP Programmer V2 Instructions

EasyAVR6 Development System

XC866 Getting Started on EasyKit & Toolkits

CMS-8GP32. A Motorola MC68HC908GP32 Microcontroller Board. xiom anufacturing

2 in 1. BigAVR User s Manual AVR. MikroElektronika. Software and Hardware solutions for Embedded World

Freeduino USB 1.0. Arduino Compatible Development Board Starter Guide. 1. Overview

LAMPIRAN - A. Instruksi Mikrokontroler

CoLinkEx_LPC11C14 EVB Kit User Guide

Debugging in AVR32 Studio

Hardware Manual. Crumb128. Rapid Prototyping Module with the Atmega128 AVR Microcontroller

8051 Intermidiate Development Board. Product Manual. Contents. 1) Overview 2) Features 3) Using the board 4) Troubleshooting and getting help

SH69P25/P23/P20B EVB. Application Note for SH69P25/P23/P20B EVB SH69P25/P23/P20B EVB SH69V25

Gambar A-1 Foto alat prototype infrared thermometer

ARDUINO LEONARDO ETH Code: A000022

MINI DEVELOPMENT BOARD AVR USERS GUIDE ATMEGA32. make your own intelligent embedded world...

4D Picaso Touchscreen Display board datasheet EB

First Step From Download to the Programming

EPM900 - Overview. Features. Technical Data

SBS Software. Signals By Spreadsheet. Figure 1, SBS System Configuration

AVR Intermediate Development Board. Product Manual. Contents. 1) Overview 2) Features 3) Using the board 4) Troubleshooting and getting help

BV511 Hardware Guide ByVac ByVac Revision 1.0

COMP2121 Experiment 4

Transcription:

DT-AVR ATMEGA128L BMS Application Note Oleh: IE Team This Application Note (AN) serves as a tutorial of how to use the DT-AVR ATMEGA128L Bootloader Micro System along with its supplementary software. The layout of DT-AVR ATMEGA128L BMS is as follows: Picture 1 The layout of DT-AVR ATMEGA128L BMS Hardware preparation for DT-AVR ATMEGA128L BMS is as follows: 1. Arrange jumper J20 and J21 on position 1-2 so that PE.0 and PE.1 function as a serial communication line. 2. Arrange jumper J6, J7, J8, and J9 so that it uses the USB line for bootloader or RS-232 line for bootloader. 3. Connect the USB cable to the module and PC if using USB as bootloader, or connect the serial cable to the PC COM port and the RJ45 connector to the module if using RS232 line for bootloader. 4. If there is another module that will be connected to the DT-AVR ATMEGA128L BMS, it is advised to connect the module to the DT-AVR ATMEGA128L BMS first. Pay attention to the connection, especially for the VCC and GND line, do not put it in reverse. Page 1 of 12

5. Arrange jumper J4 on position 1-2 (power source from VEXT) and release jumper J5 (5V). 6. Connect a 6-12 VDC Power Supply to the VEXT connector to give power to the module. The setup process for CodeVisionAVR evaluation version is as follows: 1. CodeVisionAVR evaluation version is included inside the CD/DVD that comes along with the module. The setupdemo.exe file is located in the CVAVR Evaluation folder. Run the setup.exe to start the installation process. 2. Select the setup language and click OK. Picture 2 Select Setup Language 3. The initial display of CodeVisionAVR. Click Next > to continue the installation process. Picture 3 CodeVisionAVR initial installation screen Page 2 of 12

4. Proceed to the License Agreement. Click I accept the agreement and then click Next > to agree with the terms and continue with the installation process. Picture 4 CodeVisionAVR License Agreement 5. Choose the Install Location of CodeVisionAVR, and click Next >. Picture 5 Choose Install Location screen Page 3 of 12

6. Pick a Start menu folder, and click Next >. Picture 6 Select Start Menu Folder Screen 7. CodeVisionAVR install preparation screen. Click Install to start the installation. Picture 7 Install Preparation Screen Page 4 of 12

8. CodeVisionAVR Evaluation installation process. Picture 8 CodeVisionAVR Evaluation Installation Process Screen 9. At the information screen, click Next > to proceed with the installation. Picture 9 Information Screen Page 5 of 12

10. Installation process is completed, check Launch CodeVisionAVR C Compiler Evaluation if you want to launch CodeVisionAVR immediately, or uncheck if you don't. Click Finish to complete the installation process. Picture 10 Completing the CodeVisionAVR Setup Wizard Screen The steps to make a simple application using CodeVisionAVR Evaluation is as follows: 1. Basic interface of CodeVisionAVR Evaluation and the available menu. Main Menu Navigator Quick menu Error Log Picture 11 Basic interface of CodeVisionAVR Evaluation Page 6 of 12

2. Create a new file through the main menu, select File, and then New. It can also be done using the quick menu Create new file or project. Picture 12 Creating A New File 3. We will try the Create New File. In this interface we can create a file along with project or just create a source file with a *.c extension. Click OK to proceed. Creates *.c file Creates file along with Project Picture 13 Create New File Interface 4. To make the file generation process easier it is suggested to check the Project option. Because CodeVisionAVR Evaluation will help through CodeWizardAVR. CodeWizardAVR can select and activate the features of the Chip. When the confirmation screen pops up, click Yes, and CodeWizardAVR will appear. Device Feature Chip Type (ATmega128) XTAL Clock Crystal Oscillation Divider Program Type Picture 14 Confirmation Screen and CodeWizardAVR Page 7 of 12

5. As an example of an application program, we will discuss about testing128.c a program which is also included inside the CD/DVD. The device feature that will be used in this program is the USART serial communication, which is used to perform a serial communication with the computer. The following is an explanation of the testing128.c program. #include <mega128.h> #include <delay.h> // Standard Input/Output functions #include <stdio.h> The program above shows the library that will be used. The first line shows the type of Chip that will be used. The second line shows the library delay which will be used to create delay timing. The blue colored text shows the statement of the program. Every line that starts with // will not be executed when the program start. The fourth line shows the library Standard Input/Output, which will be used for serial communication. 6. The following is an explanation of the main() function of the testing 128.c Program: void main(void) { // Declare your local variables here unsigned char counter=0,serialcount = 0; // Input/Output Ports initialization // Port A initialization // Func7=Out Func6=Out Func5=Out Func4=Out Func3=Out Func2=Out Func1=Out Func0=Out // State7=0 State6=0 State5=0 State4=0 State3=0 State2=0 State1=0 State0=0 PORTA=0x00; DDRA=0xFF; // Port B initialization // Func7=Out Func6=Out Func5=Out Func4=Out Func3=Out Func2=Out Func1=Out Func0=Out // State7=0 State6=0 State5=0 State4=0 State3=0 State2=0 State1=0 State0=0 PORTB=0x00; DDRB=0xFF; // Port C initialization // Func7=Out Func6=Out Func5=Out Func4=Out Func3=Out Func2=Out Func1=Out Func0=Out // State7=0 State6=0 State5=0 State4=0 State3=0 State2=0 State1=0 State0=0 PORTC=0x00; DDRC=0xFF; // Port D initialization // Func7=Out Func6=Out Func5=Out Func4=Out Func3=Out Func2=Out Func1=Out Func0=Out // State7=0 State6=0 State5=0 State4=0 State3=0 State2=0 State1=0 State0=0 PORTD=0x00; DDRD=0xFF; // Port E initialization // Func7=Out Func6=Out Func5=Out Func4=Out Func3=Out Func2=Out Func1=Out Func0=Out // State7=0 State6=0 State5=0 State4=0 State3=0 State2=0 State1=0 State0=0 PORTE=0x00; DDRE=0xFF; // Port F initialization // Func7=Out Func6=Out Func5=Out Func4=Out Func3=Out Func2=Out Func1=Out Func0=Out // State7=0 State6=0 State5=0 State4=0 State3=0 State2=0 State1=0 State0=0 PORTF=0x00; DDRF=0xFF; // Port G initialization // Func4=Out Func3=Out Func2=Out Func1=Out Func0=Out // State4=0 State3=0 State2=0 State1=0 State0=0 PORTG=0x00; DDRG=0x1F; // USART0 initialization // Communication Parameters: 8 Data, 1 Stop, No Parity Page 8 of 12

// USART0 Receiver: On // USART0 Transmitter: On // USART0 Mode: Asynchronous // USART0 Baud rate: 115200 UCSR0A=0x00; UCSR0B=0x18; UCSR0C=0x06; UBRR0H=0x00; UBRR0L=0x03; while (1) { // Place your code here if(ucsr0a>>7 & 1) { if (getchar()=='a') { printf("%d -> DT-AVR Boot, Innovative Electronics\r",serialCount); serialcount++; } } PORTA = ~(0x01 << counter); PORTB = ~(0x01 << counter); PORTC = ~(0x01 << counter); PORTD = ~(0x01 << counter); PORTE = ~(0x01 << counter); PORTF = ~(0x01 << counter); PORTG = ~(0x01 << counter); counter++; if (counter>7) counter = 0; } delay_ms(200); }; On the main() function, the first thing to do is counter and serialcount variable declaration. Followed by I/O and UART initialization. The program will then start to loop continuously. In that loop, the first thing to do is to check the contents of UCSR0A registry to find out if there's a serial data input or not. If there is an input, then that serial data will be retrieved using the getchar() fuction. If the received serial data is character 'A', then the module will generate the text: DT-AVR Boot, Innovative Electronics. At Port A, Port B, Port C, Port D, Port E, Port F, and Port G will always generate low logic at 1 pin on every port consecutively, except for pin PE.0 and PE.1 which is functioned as serial communication. 9. The next step is to compile the program that we have just created. This process is done to see if there is an error in the program. This process is located in the Project Compile tab and can also be accessed by pressing F9 on the keyboard. Picture 15 Compile Menu Page 9 of 12

10. If the created listing program does not contain any kind of mistakes (including syntax or writing) and doesn't encounter any errors during the compiling process, then the form below will appear. Picture 16 Compile Process Result 11. After the Compiling process is done, the next step is to generate a HEX file (*.hex). This process is possible to do if the compiling process is succeed. This process is started through the Project Build menu. Another way to initiate the process is by pressing Shift + F9 at the keyboard. Picture 17 HEX File Creation Process 12. If the steps above succeeded then a HEX file (*.hex) will be generated. This file is placed at the same folder as project (or placed inside the EXE folder) with the same name as the project. In this example, the file is named testing128.hex. Page 10 of 12

AVR Bootloader v1.0 is a software from Innovative Electronics that supports microcontroller programming through the bootloader at the DT-AVR ATMEGA128L BMS. This software is included inside the CD/DVD that comes along with the module. 1. The interface of AVR Botloader v1.0 and the explanation of its functions. COM PORT Chip Used Auto Detect Device Button Reset Chip Button Type of Execution Flash File EEPROM File Process Flow Lock Bits Configuration Process Button Picture 18 AVR Bootloader v.1.0 Interface 2. Before running the AVR Bootloader v1.0, DT-AVR ATMEGA128L BMS must be connected to a USB port or serial computer and powered on. On the DT-AVR ATMEGA128L BMS, the programmer device is the ATMEGA128 microcontroller itself. Run the AVR Bootloader v1.0, and press the Auto Detect Device button. This Program will detect the modules that is connected to the computer. If AVR Bootloader shows that there is no detected module, press the reset in the module and run the AVR Bootloader or manually pick an IC to use. 3. Hex File is used to select files that will be programmed into the microcontroller. Its important to know that AVR Bootloader v1.0 specifies the files that will be programmed to the Flash memory and EEPROM. Press the... (Browse) button to choose the desired file. Select the HEX file to program the Flash Memory. HEX (testing128.hex) file can also be opened through the File > Load FLASH menu. 4. At the Programmed Section, pick Flash to program, check program results and read the microcontroller Flash Memory. 5. The Operations Flow is used to choose a few process options that will be run, it can also be done from the Program menu and then choose the process that will be run. To program the testing128.hex file in this example, check all Operation Flow (Check Signature, Erase, Blank Check, Program Verify) and Programmed Section in the Flash menu. Finally, press Run to program the microcontroller. 6. To test the programming results of the testing128.hex file, run the TESTER128.exe program included inside the CD/DVD that comes along with the module. 7. Choose the COMPort that will by used through the combobox menu and click Connect. Page 11 of 12

8. If the serial communication is successfully connected it will display DT-AVR Boot, Innovative Electronics continuously with 1 second interval. Picture 19 TESTER128.exe Program Interface 9. The output generated on Port A, Port B, Port C, Port D, Port E (except for PE.0 and PE.1), Port F, and Port G can be seen using oscilloscope, voltmeter, or connected directly with a series of LEDs or DT-I/O LED LOGIC TESTER which will blink one after another. Happy Innovating! AVR Bootloader is copyright by Innovative Electronics. CodeVisionAVR is copyright by Pevel Haiduc, HP Info Tech s.r.l. Page 12 of 12