Uploaded by Akhmad Hendriawan

Getting started assembler VmLab 3.12

advertisement
Embedded Research Group Electronic Department EEPIS-ITS
hendri@eepis-its.edu
Getting Started
Assembler with VMLAB
3.12
Copyright © by Akhmad hendriawan
hendri@eepis-its.edu
Seluruh dokumen ini dapat digunakan, dimodifikasi dan disebarkan
secara bebas untuk tujuan bukan komersial (nonprofit), dengan syarat
tidak menghapus atau merubah atribut penulis dan pernyataan
copyright
yang
disertakan
dalam
setiap
dokumen.
Tidak
diperbolehkan melakukan penulisan ulang, kecuali mendapatkan ijin
terlebih dahulu dari penulis
Embedded Research Group Electronic Department EEPIS-ITS
hendri@eepis-its.edu
A. Install VMLAB
1. Run install
2. select next
3. accept the licency agreement
4. fill name and company form and select next
Embedded Research Group Electronic Department EEPIS-ITS
hendri@eepis-its.edu
5. If you want to change default directory select browse otherwise Select next
Embedded Research Group Electronic Department EEPIS-ITS
hendri@eepis-its.edu
6. Change default program folder otherwise select next
7. Select next
Embedded Research Group Electronic Department EEPIS-ITS
hendri@eepis-its.edu
8. Select finish
Embedded Research Group Electronic Department EEPIS-ITS
hendri@eepis-its.edu
C. Running VMLAB
1. Run vmlab
2. select project from main menu then select new project.
3. Give name of project, Select atmega8 select GNU C compiler. Make sure GCC path is
correct
Embedded Research Group Electronic Department EEPIS-ITS
hendri@eepis-its.edu
4. Replace default program with this following code.
.include "C:\VMLAB\include\m8def.inc"
.def Temp=r16
.org 0
rjmp start
start:
ser temp
out DDRD,temp
ldi temp,0xAA
out PORTD,temp
rjmp start
5. Add LED to the project by editing the.prj file
; Micro nodes: RESET, PB0-PB7, PD0-PD7, PE0-PE2, ACO, TIM1OVF
; Define here the hardware around the micro
; -----------------------------------------------------------D1
D2
D3
D4
D5
D6
D7
D8
VDD
VDD
VDD
VDD
VDD
VDD
VDD
VDD
PD0
PD1
PD2
PD3
PD4
PD5
PD6
PD7
; x: Panel LEDs 1 - 8
6. In project file Change the frequency simulation to 4Mhz (Marked in red )
; Following lines are optional; if not included
; exactly these values are taken by default
; -----------------------------------------------------------.POWER VDD=5 VSS=0 ; Power nodes
.CLOCK 4meg
; Micro clock
.STORE 250m
; Trace (micro+signals) storage time
7. From Main menu project  build (F9)
Embedded Research Group Electronic Department EEPIS-ITS
hendri@eepis-its.edu
8. the following picture will be display if no error
9. From the main menu  View 
10. Select go toolbar icon
control panel (Alt+shift+C)
Embedded Research Group Electronic Department EEPIS-ITS
hendri@eepis-its.edu
11. See the result in control panel.
Last revised on November 8, 2007
email: hendri@eepis-its.edu
reference:
1. Atmel AVR datasheet
2. www.avrfreaks.net
3. www.avrtutor.com
4. www.xdesignlabs.com
5. Atmel AvrStudio
Download