Part Number Hot Search : 
C3153M CT357VT2 NJU6572A 2SC2238A GFCG50 4032K14 CLL968A TED1222
Product Description
Full Text Search
 

To Download AVR-BAS-8K Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  getting st ar ted guide a vr basic for a vr basic 1.00.206 or later (manual v ersion 1.21)
a vr basic getting star ted guide v1.21 i copyright infor mation ? 1999 copyright equinox t echnologies uk limited. all rights r eser ved. atmel tm and a vr tm ar e trademarks of the atmel corporation micr osoft, ms-dos, w indows tm and w indows 95 tm w indows nt? ar e r egister ed trademarks of the micr osoft corporation ibm, pc and ps/2 ar e r egister ed trademarks of inter national business machines corporation ever y ef for t was made to ensur e accuracy in this manual and to give appr opriate cr edit to persons, companies and trademarks r efer enced her ein. infor mation in this document is subject to change without notice and does not r epr esent a commitment on the par t of the manufactur er . the softwar e described in this document is fur nished under license agr eement or nondisclosur e agr eement and may be used or copied only in accor dance with the ter ms of the agr eement. it is against the law to copy the softwar e on any medium except as specifically allowed in the license or non-disclosur e agr eement. the pur chaser may make one copy of the softwar e for backup purposes. no par t of this manual may be r epr oduced or transmitted in any for m or by any means, electr onic, mechanical, including photocopying, r ecor ding, or infor mation r etrieval systems, for any purpose other than for the pur chaser s personal use, without written per mission.
a vr basic getting star ted guide v1.21 ii contact infor mation equinox t echnologies uk limited 3 atlas house, st geor ge's squar e, bolton, england bl1 2hb t elephone sales ....................... : +44 (0) 1204 529000 fax .............................................. : +44 (0) 1204 535555 t echnical suppor t .................. : avrbasic@equinox-tech.com e-mail ......................................... : sales@equinox-tech.com w eb site .................................... : www .equinox-tech.com a vr basic is a silicon studio pr oduct
a vr basic getting star ted guide v1.21 iii t echnical suppor t registration please fill out the customer registration for m pr ovided with your system and submit this to equinox dir ectly . equinox will issue you a customer r egistration number which must be quoted when making any technical suppor t enquir y to equinox. equinox can not pr ovide technical suppor t to unr egister ed users of our pr oducts. levels of technical suppor t equinox pr ovide a range of technical suppor t ser vices for the a vr basic t oolset. the level of suppor t depends on the package you have pur chased and also on whether you have pur chased a t echnical suppor t contract fr om equinox. the level of technical suppor t of fer ed for each package is detailed below . a separate suppor t contract may be pur chased for a vr-basic-lite and a vr-basic-full if mor e in-depth technical suppor t is r equir ed. a vr-basic-demo : no suppor t a vr-basic-lite : installation suppor t only a vr-basic-full : installation suppor t only installation suppor t after or dering either a vr-basic-lite or a vr-basic-full, equinox of fer you 30 days of suppor t fr om date of r egistration with a r eaction time of 5 working days. this suppor t is only to solve installation pr oblems. please note that this suppor t can only be given by e-mail. please send your enquiries to: e-mail: avrbasic@equinox-tech.com fax: +44 (0) 1204 535555 standar d suppor t (char geable) standar d technical suppor t is of fer ed only via e-mail and fax with a r esponse time of 48 hours. equinox will attempt to answer any question r elating to the general use of the a vr-basic envir onment. w e can not, however , answer questions on how to write basic or a vr assembler sour ce code or r elating to user -specific har dwar e. an automated e-mail ser vice is available which will send you news of new update r eleases and device suppor t enhancements. standar d suppor t ................ 200 please send your enquiries to: e-mail: avrbasic_suppor t@equinox-tech.com fax: +44 (0) 1204 535555
a vr basic getting star ted guide v1.21 iv section 1 introduction ........ 1/1 a vr basic over view ........ 1/ 2 a vr basic softw are over view ........ 1/4 ide over view ........ 1/5 (i ntegrated development envir onment ) a vr basic system summar y ........ 1/6 a vr basic p ackage summar y ........ 1/7 typical project over view ........ 1/8 inst alla tion over view ...... 1/10 softw are inst alla tion ...... 1/11 directories over view ...... 1/12 interf acing to device programmers ...... 1/13 a vr basic examples ...... 1/14 section 2 a vr basic language - quick refer ence guide
a vr basic getting star ted guide v1.21 1/1 intr oduction t he a vr basic t oolset contains a compr ehensive suite of code development tools for the atmel a vr risc micr ocontr oller family . the package includes a power ful integrated development envir onment (ide) which encompasses a basic compiler , macr o assembler , editor and hex cr eator all within one easy-to-use w indows envir onment. the a vr basic language allows you to write code in a high level language, while still r etaining the fast execution speed of assembler . the code is compiled fr om a basic sour ce pr ogram into optimised a vr assembly instr uctions r eady to be pr ogrammed into an a vr micr ocontr oller device. it is entir ely possible to write your complete pr oject using a vr basic without ever r esor ting to assembler as the compiler pr oduces ver y optimised code. even time- critical code such as inter r upt ser vice r outines can be optimised at compilation stage so as to generate the most ef ficient code. it is also possible to generate almost all a vr instr uctions either dir ectly or indir ectly within a vr basic. a vr basic is now available in thr ee dif fer ent packages fr om an evaluation version to the fully unr estricted version. the choice of package depends on the amount of code to be generated and the tar get a vr device which is to be used. the a vr basic t ool set highlights: ? compiled basic generates highly optimised a vr machine code ? hybrid language including basic commands plus suppor t for many pascal and c-type str uctur es ? t ar get speeds comparable with assembler ? not a run-t ime interpr eter; no code over head ? suppor ts a t90s1200 r educed instr uction set devices ? dir ect suppor t for all a vr-specific machine code instr uctions within basic sour ce file ? suppor t for 16-bit integer and ieee 32 bit floating point maths ? compr ehensive suite of code examples available ? br eaks the cost bar rier for small pr ojects ? ideal for educational, hobbyist and pr ofessional use
a vr basic getting star ted guide v1.21 1/2 a vr b asic why choose basic as the language for pr ogramming a micr ocontr oller? basic has been supplied as a standar d accessor y with almost all micr ocomputers. its accessibility and ease of use have made it one of the most widely used pr ogramming languages. originally devised in 1963, by john 18 and thomas kur tz of dar tmouth college (new hampshir e, u.s.a.), it was intended to pr ovide students with an easy intr oduction to pr ogramming language, hence the name b eginners a ll-purpose s ymbolic i nstr uction c ode. many scientists and engineers found basic attractive for developing solutions to technical pr oblems, and the language soon became established as a tool in its own right. high and low level pr ogramming languages a low level language describes pr ecisely which actions ar e done and specifies exactly the par ts of the tar get system to be operated on. at the lowest pr ogramming level (closest to the object code) is assembly code, consisting of a shor t mnemonic code for each instr uction, to identify the operation to be per for med, and the par t of the memor y , central pr ocessor (cpu), or input/output (i/o) device on which to operate. the list of mnemonics, called the sour ce file, is then pr ocessed by a computer pr ogram called an assembler which translates the sour ce into object code. pr ogramming in assembly code r equir es detailed knowledge of the instr uction set and inter nal cir cuit ar chitectur e of the cpu, and the i/o devices. ever y individual instr uction appears as a mnemonic, and it is dif ficult to see str uctur e or r elationship between par ts of the pr ogram. t o per for m the same task on dif fer ent tar get systems r equir es a separate pr ogram for each. however , car eful assembly pr ogramming can deliver the shor test or fastest pr ogram possible on a given system. in a high level language the sour ce code is translated to machine code by a compiler pr ogram, or by a r un-time interpr eter pr ogram, either of which will link cpu and i/o r esour ces of the tar get system to the pr ogram. the compiler pr oduces an executable object code file, which is loaded into the tar get system and r un. the interpr eter is itself a pr ogram which r uns on the tar get system, and translates the sour ce file line-by-line as r equir ed, on the tar get machine itself. interpr eted language pr ograms r un much mor e slowly than compiled pr ograms because of the translation and file access over heads.
a vr basic getting star ted guide v1.21 1/3 a vr b asic c ontinued a high-level language: ? allows quite complex operations to be expr essed as shor t command wor ds or phrases, (or graphical symbols) ? hides unnecessar y system details fr om the pr ogrammer ? allows the str uctur e of the pr ogram to be expr essed mor e clearly , ? enables a faster pr ogramming and testing cycle ? in principle one high-level-language pr ogram is capable of being r un on many dif fer ent systems, if a suitable compiler is available for each system i.e. it is por table. basic basic is a high-level-language, easier to lear n than assembler or c. it has a for mat and syntax alr eady familiar to most pr ogrammers and engineers. for contr ol applications a tr ue compiled basic is desirable, to obtain maximum execution speed. additional low - level commands may be pr ovided, to allow the pr ogrammer to specify cpu, i/o, and memor y r esour ces, and inser t assembler - level instr uctions for optimisation. intr oducing a vr basic a vr basic is a hybrid language consisting of most of the familiar basic commands but has been significantly extended to encorporate many desirable featur es fr om the pascal and c languages. it is a compiled language and so is capable of generating highly-optimised code which r uns at the full speed of a vr machine code. the compiler featur es the ability to fr eely mix many a vr specific assembly language instr uctions with basic instr uctions in the same sour ce file. a vr basic has been specially written so as to be able to fully suppor t all atmel a vr micr ocontr oller derivatives on the market today . the compiler is capable of generating code for the a vr a t90s1200(a) devices which ar e not cur r ently suppor ted by any commer cially available c compiler as these devices do not have any on-chip sram. the r ecently intr oduced atmel a tmega family of a vr micr ocontr ollers is also suppor ted.
a vr basic getting star ted guide v1.21 1/4 figur e 1 editor a vr basic compiler a vr macr o assembler linker device pr ogrammer a vr bas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@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ side *.rom *.eep *.obj a vr code a vr b asic softwar e over view the diagram below shows the interaction between the a vr basic integrated development envir onment (side) and the device pr ogrammer supplied with this system. file types *.obj object file containing symbolic and debug infor mation *.r om file containing data to be pr ogrammed into the code ar ea *.eep file containing data to be pr ogrammed into the eeprom ar ea
a vr basic getting star ted guide v1.21 1/5 ide over view side - silicon studios integrated development envir onment ? power ful integrated development envir onment ? operates under w indows 95 and w indows nt ( w indows 3.11 is not suppor ted ) ? power ful pr oject manager ? integrated editor allows multiple files to be open at the same time ? interactive sour ce code er r or cor r ection ? dir ect suppor t for exter nal tools e.g. device pr ogrammers a vr basic compiler ? t ranslates a vr basic sour ce code into a vr machine code ? generates highly optimised a vr machine code ? t ar get execution speeds of compiled code is comparable with a vr assembler ? suppor ts low-level a vr instr uctions dir ectly ? featur es function calling with parameter passing ? dir ect code suppor t for inter r upt ser vice routines (isr s) ? includes power ful c-like switch constr uct a vr macr o assembler ? public domain a vr macr o assembler ? no dir ect suppor t cur r ently of fer ed for this utility linker ? generates an intel hex file suitable for downloading the code to a device pr ogrammer ? generate an object file containing symbolic infor mation suitable for downloading to a simulator or emulator
a vr basic getting star ted guide v1.21 1/6 which package? a vr basic is now available in thr ee dif fer ent packages fr om an evaluation version to the fully unr estricted version. the choice of package depends on the amount of code to be generated and the tar get a vr device which is to be used. a vr basic demo this is an evaluation version of the a vr basic t oolset which is capable of compiling up to 64 bytes of a vr code for any a vr derivative. this version is ideal for evaluating the package as many of the examples pr ovided in the \sour ce dir ector y will compile using this version. this softwar e can be downloaded fr om the a vr basic section on the equinox w eb site. a vr basic lite this is a fully functional version of the a vr basic t oolset which is capable of compiling up to 1k bytes of a vr code. this version is ideal for evaluating the package as many of the examples pr ovided in the \sour ce dir ector y will compile using this version. floating-point libraries ar e not included in this version. a vr basic full v ersion this is a fully functional version of the a vr basic t oolset which is capable of compiling up to 128k bytes of code for any a vr derivative. this version suppor ts all the a vr instr uctions of the classic a vr family and will also suppor t the atmel a tmega derivatives. floating-point libraries ar e included in this version. please note: the code/eeprom sizes of atmel micr ocontr ollers ar e quoted in bytes even though the pr ocessor instr uction is 16-bits (2 bytes) long. for this r eason, the code sizes for the dif fer ent versions of a vr basic ar e also quoted in bytes. a vr basic system summar y
a vr basic getting star ted guide v1.21 1/7 a vr b asic package summar y figur e 2 or der code a vr-bas-lite a vr-bas-full price free $39.95 $249.95 download fr om our w eb site a vr basic package demo lite full code size limit (bytes) 64 1k 128k integrated development yes yes yes envir onment (ide) a vr basic compiler yes yes yes a vr macr o assembler yes yes yes linker yes yes yes hex t ranslator yes yes yes floating point libraries no no yes device suppor t a vr device suppor t all a t90s1200(a) all a t90s1200 instr uction set yes yes yes a t90s8515 instr uction set yes no yes a tmega suppor t no no yes document a tion a vr basic getting star ted guide pdf only yes yes a vr basic refer ence guide no no yes on-line help yes yes yes miscellaneous w indows operating system 95/nt 95/nt 95/nt
a vr basic getting star ted guide v1.21 1/8 t ypical pr oject over view pr oject based development back in the old days of dos development tools, it was necessar y to r un separate command line driven pr ograms to compile, link and then pr oduce a hex file. this was not only time consuming, but could also lead to a lot of compilation and linking er r ors due to typing er r ors. the a vr basic integrated development envir onment (side) takes car e of all file management for you, so all you have to wor r y about is actually writing code that works! the table below shows the dif fer ent files contained within a typical pr oject. extension example description .bas test.bas basic sour ce file: this file is an ascii text file containing a pr ogram written in basic. the basic compiler takes .bas files as its input and outputs a .lst and a .hex file. .ini 1200.ini device initialisation file: this file contains all the device-specific infor mation per taining to a par ticular a vr micr ocontr oller derivative. all r egister declarations, code size, eeprom size, ram size and por t assignments can be found in this file. .rom test.r om micr ocontr oller code ar ea file: when a basic or assembler language sour ce file is compiled, the output of the compiler is both a .r om and a .eep file. the .r om file contains the actual data image which is to be pr ogrammed into the code ar ea of the tar get device. this is cur r ently in generic intel hex for mat. .eep test.eep micr ocontr oller eeprom ar ea file: when a basic or assembler language sour ce file is compiled, the output of the compiler is both a .rom and a .eep file. the .eep file contains the actual data image which is to be pr ogrammed into the eeprom ar ea of the tar get device. this is cur r ently in generic intel hex for mat. if the compiler generated no data for the eeprom ar ea, a .eep file is cr eated containing all bytes set to f fh. .lst test.lst compiler list file: when a basic or assembler language sour ce file is compiled, the compiler cr eates a .lst file which is an ascii file which logs the compilation pr ocess and any er r ors found during compilation. .obj test.obj object file: when a basic or assembler language sour ce file is compiled, the compiler cr eates an .obj file which contains the actual code generated by the compiler and symbolic infor mation for debugging. this code is not in a useable for m for pr ogramming into a device and so is conver ted by side into a hex file. .err test.er r er r or file: when a basic or assembler language sour ce file is compiled, an er r or file is pr oduced if any compilation er r ors wer e encounter ed. these er r ors ar e also displayed in the er r or window within side. figur e 3
a vr basic getting star ted guide v1.21 1/9 t ypical pr oject over view continued figur e 4 evalu8r .inc symbol & por t assignments for the equinox evalu8r module 1200.ini a t90s1200 initialisation file test.obj object file test.lst list file (log of compilation) test.er r er r or message infor mation test.r om device code ar ea image test.eep device eeprom ar ea image device programmer basic compiler test.bas # family a vr # device 1200 # include evalu8r a vr core eeprom code basic sour ce file atmel a vr micr ocontr oller
a vr basic getting star ted guide v1.21 1/10 intr oduction this section explains how to set up an operating envir onment and how to install the softwar e on your har d disk. befor e star ting the installation pr ogram, please verify that your computer system meets the minimum r equir ements and make a copy of the installation diskettes for backup purposes. system requir ements ther e ar e minimum har dwar e and softwar e r equir ements that must be satisfied to ensur e that the compiler and utilities function pr operly . these ar e as follows: ? 100% ibm compatible 386 or higher pc ? w indows 95 or w indows nt (w indows 3.11 and dos ar e not suppor ted) ? 16mb ram minimum ? har d disk with minimum 6mb fr ee space default install dir ector y the installation pr ogram copies the development tools into the sub-dir ectories show in fig. 5. installation over view package default install dir ector y a vr basic-demo pr ogram files\avrbasic a vr basic-lite pr ogram files\avrbasic a vr basic -full pr ogram files\avrbasic figur e 5
a vr basic getting star ted guide v1.21 1/11 softwar e installation a vr basic featur es a straightfor war d installation pr ogram which, once launched, gives full on-scr een pr ompts at ever y stage. as with any softwar e package, actually getting up and r unning can be the most fr ustrating exer cise. please consult the list of installation hints below for help. a vr basic 1 is compatible with w indows 95 & w indows nt only . 2 is not compatible with w indows 3.11 or dos. 3 can be installed on a network drive and launched fr om a r emote client machine installation pr ocedur e the following installation instr uctions below cover all versions of a vr basic: fr om w indows 95 or w indows nt envir onment: 1 inser t a vr basic disk into floppy drive e.g. a: 2 fr om the star t menu, select run.. 3 t ype a:\setup.exe or br owse to the r equir ed drive and select setup.exe 4 the installation pr ogram should now commence 5 follow instr uctions and pr ompts given on scr een t o install fr om the equinox w eb site: 1 go to http://www .equinox-tech.com and br owse to the softwar e section 2 download 'sidexxx.exe' wher e 'xxx' is the version number 3 double-click on 'sidexxx.exe' 4 follow instr uctions and pr ompts given on scr een please note: unless you alr eady have a licence file the web version is 'a vr basic demo' only . please see the upgrading section for infor mation on obtaining a licence file. the a vr basic t oolset is automatically added to the w indows 95 pr ogram menu and can be found as follows: C> C> wher e side is the a vr basic integrated development envir onment. upgrading a vr basic to lite or full v ersions 1 install 'a vr basic demo' version on your computer 2 obtain a 'licence file (*.lic)' for either 'a vr basic lite' or 'a vr basic full' fr om equinox or your local equinox distributor 3 w ith the 'side.exe' not launched (ie. do not r un side.exe), copy the 'licence file' into the following dir ector y: ..\side\bin ie. into the \bin dir ector y .
a vr basic getting star ted guide v1.21 1/12 dir ectories over view the a vr basic installation r outine cr eates the following dir ectories within the \avrbasic dir ector y: dir ector y description \bin executables and license files \config ide and device-specific config/initialisation files \help w indows help files \html html documents and help infor mation \inc include files \install installed files \plugins side plugins e.g. as assembler \sour ce example sour ce files and applications \temp for ide use only \update for downloaded application updates softwar e installation continued 4 launch 'side.exe' 5 y our copy of a vr basic will now be automatically updated to become either 'a vr basic lite' or 'a vr basic full' depending on the licence file enter ed. y our w indows registr y will be automatically updated and the 'licence file' will be deleted fr om the \bin dir ector y . please note: if you wish to move a vr basic to another pc, it will be necessar y to r etain a copy of your licence file separately , as the installation pr ocedur e automatically deletes it once the softwar e is installed. upgrading fr om a pr evious v ersion of a vr basic 1 install the new version of a vr basic on a machine with a copy of a vr basic lite, 8k or full alr eady installed. the installation dir ector y does not have to be the same as the pr evious installation. 2 launch 'side.exe' 3 check the licence file is cor r ect by choosing in the ide.
a vr basic getting star ted guide v1.21 1/13 the a vr basic envir onment has been specially designed to suppor t exter nal device pr ogrammers. the compiler pr oduces two output files which can be pr ogrammed into the tar get a vr micr ocontr oller . the *.rom should be pr ogrammed into the code ar ea and the *.eep should be pr ogrammed into the eeprom ar ea of the micr ocontr oller . the default file type is intel hex which is compatible with most device pr ogrammers. example using the equinox meridian for w indows pr ogrammer inter face softwar e: 1 compile the sample a vr basic pr oject called eepr om.spr found in avrbasic\sour ce\avr\equinox\evalu8r\eepr om.spr 2 check that the two files: 'eepr om.r om' and 'eepr om.eep' ar e cr eated by the compiler . please note that not all examples will cr eate an '.eep' file. 3 launch the meridian softwar e 4 select -> file load dialogue box should appear 5 in the code ar ea section of the w indow , select
and then select the file for the code ar ea i.e. 'eepr om.r om' 6 in the eeprom ar ea section of the w indow , select
and then select the file for the eeprom ar ea i.e. 'eepr om.eep' 7 click the button at the bottom of the w indow -> the two files 'eepr om.r om' and 'eepr om.eep' ar e now loaded into the code and eeprom buf fers r espectively . 8 click the button at the bottom of the w indow 9 t o pr ogram the device, select -> the device is pr ogrammed with the contents of the code and eeprom buf fers. inter facing to device pr ogrammers
a vr basic getting star ted guide v1.21 1/14 the a vr basic t oolset is supplied with a suite of softwar e examples to help you get up and r unning quickly . all of the examples have been written for the equinox evalu8r micr ocontr oller evaluation module fitted with an atmel a t90s1200 micr ocontr oller , but can easily be adapted for other similar tar gets. the following softwar e examples ar e supplied with a vr basic: example 1 : led1 t ur ns on an led example 2 : led2 flashes an led example 3 : buzz1 outputs an audible tone on a piezo sounder example 4 : button1 reads and debounces a push-button switch example 5 : eeprom demonstrates use of a vr on-chip eeprom example 6 : i2cee exter nal 24c16 eeprom driver utility example 7 : anacompi a/d utility using on-chip comparator example 8 : timer flashes an led using an inter r upt driven timer sour ce file location: \a vrbasic\sour ce\a vr\equinox\evalu8r most of the above examples use the evalu8r .inc include file to pr e-define all the har dwar e on this module. this include file can be found as follows: \a vrbasic\sour ce\a vr\equinox\inc. t r ying out the example pr ograms 1. launch the a vr basic t oolset by selecting or by double clicking the side.exe icon. a vr basic examples
a vr basic getting star ted guide v1.21 1/15 example 1: led1 sour ce file : led1.bas include file : evalu8r .inc default pr ocessor : atmel a t90s1200 code size : 2 wor ds eeprom size : 0 bytes this example simply tur ns on an led connected to por t b bit 0 of an a vr device and then waits in an endless loop. the led por t is first initialised to all of f (all pins set to 1) by calling the init_leds function which can be found in the evalu8r .inc file. a vr basic examples continued #include begin led7 := 1; // turn led 7 on end. 2. fr om the menu bar , select and then br owse to your selected example e.g. \a vrbasic\sour ce\a vr\equinox\ evalu8r\led1.spr -> the sour ce file for led1.bas should now be displayed. 3. select or simply pr ess the hot key . -> the sour ce file is compiled and a message in the bottom line of the main window should say: compiled ok, xx w or ds of code. 4. t o view the symbols defined during this compilation, select . 5. t o view the list file containing all compilation infor mation, select . 6. t o pr ogram the two files (*.r om and *.eep) into a tar get a vr micr ocontr oller , please r efer to the instr uctions supplied with your pr ogrammer . (for equinox pr ogrammers please r efer to section inter facing to device pr ogrammers)
example 2: led2 sour ce file : led2.bas include file : evalu8r .inc default pr ocessor : atmel a t90s1200 code size : 56 wor ds eeprom size : 0 bytes this example flashes an led connected to por t b bit 0 of any a vr device at a pr e-deter mined rate. the led por t is first initialised to all of f (all pins set to 1) by calling the init_leds function which can be found in the evalu8r .inc file. the flash rate can be alter ed by changing the parameter value in the delay() function and/or by changing the pr ocessor oscillator fr equency . when using the equinox evalu8r module, the piezo will also buzz as this is connected to the same por t as the led. a vr basic getting star ted guide v1.21 1/16 a vr basic examples continued example 3: buzz1 sour ce file : buzz.bas include file : evalu8r .inc default pr ocessor : atmel a t90s1200 code size : 53 wor ds eeprom size : 0 bytes this example pr oduces a tone on a piezo sounder device connected to por t b bit 7 of an a vr device. the fr equency of the tone can be alter ed by changing the parameter value in the delay() functions and/or by changing the pr ocessor oscillator fr equency . #include ..\inc\evalu8r // begin init_leds; // init led port repeat led0 := not led0; // invert led delay(20); until false; // loop forever end.
a vr basic getting star ted guide v1.21 1/17 example 3 continued example 4: button1 sour ce file : button1.bas include file : evalu8r .inc default pr ocessor : atmel a t90s1200 code size : 57 wor ds eeprom size : 0 bytes this example demonstrates a softwar e method of r eading and debouncing a push-button switch. a beep sound is made when the push button is r eleased. #include ..\inc\evalu8r // begin init_buzzer; // init buzzer port repeat beep; // make a beep.. delay(100); // same delay until false; // loop.. do it again! end. #include ../inc/evalu8r // begin init_buzzer; // init buzzer port repeat wait !s1; // wait until pushbutton s1 pressed delay(1); // debounce delay wait s1; // wait until button released beep; // make a beep.. until false; // loop for forever end. a vr basic examples continued
a vr basic getting star ted guide v1.21 1/18 a vr basic examples continued example 5: eeprom sour ce file : eepr om.bas include file : evalu8r .inc default pr ocessor : atmel a t90s1200 code size : 58 wor ds eeprom size : 16 bytes this example demonstrates the use of the a vr on-chip eeprom. a series of 16 data bytes ar e placed in the eeprom ar ea at compile time. when the pr ogram r uns, the data bytes ar e r ead sequentially fr om the eeprom and displayed one at a time on the led por t. the speed of the led por t update can be changed by altering the parameter in the delay() function. the eepr om.eep file must also be pr ogrammed into the tar get device in or der for this pr ogram to work. #include ..\inc\evalu8r var index: byte; // sequence to display on leds const xx eeprom = $55,$aa,$55,$aa, $33,$cc,$33,$cc, $66,$99,$66,$99, $f0,$0f,$f0,$0f begin init_leds; // init led port repeat leds := eeprom[index]; // read eeprom and display delay(5); // short delay index := index + 1 and $0f // make sure index stays in range [0..15] until false; // loop forever end.
a vr basic getting star ted guide v1.21 section 2 a vr basic language-quick refer ence guide a vr device-specific initialisa tion files ........ 2/1 commands ........ 2/2 program la yout ........ 2/3 const ants ........ 2/6 labels ........ 2/8 v ariables ........ 2/9 reser ved words ...... 2/11 expressions ...... 2/12 logic opera tors ...... 2/13 st a tements ...... 2/14 functions & procedures ...... 2/15 labels & identifiers ...... 2/17 optimisa tion techniques ...... 2/18 a vr suppor t products ...... 2/19 a vr product selection guide ...... 2/20
a vr basic getting star ted guide v1.21 2/1 most a vr micr ocontr ollers featur e the same generic cor e, but have dif fer ent on-chip har dwar e r esour ces and also dif fer ent pinouts. they can also dif fer in code, eeprom and ram sizes. a vr basic allows you to write, as far as possible, in non device-specific code. all the device- specific infor mation can be automatically loaded into a basic sour ce file by including the r elevant .ini file (device initialisation file ) fr om the list below . when new devices within the a vr family ar e r eleased, a new .ini will usually be made available. 11.ini atmel a ttiny11 initialisation file 103.ini atmel a tmega103 initialisation file 603.ini atmel a tmega603 initialisation file 1200.ini atmel a t90s1200(a) initialisation file 2313.ini atmel a t90s2313 initialisation file 2323.ini atmel a t90s2323 initialisation file 2333.ini atmel a t90s2333 initialisation file 2343.ini atmel a t90s2343 initialisation file 4414.ini atmel a t90s4414 initialisation file 8515.ini atmel a t90s8515 initialisation file 4433.ini atmel a t90s4433 initialisation file 4434.ini atmel a t90s4434 initialisation file 8535.ini atmel a t90s8535 initialisation file the .ini files can be found in the \avrbasic\config\device\avr dir ector y . the following example sour ce file shows how to declar e that the atmel a t90s8515 is the tar get device. example: please note: if the tar get device is not specified, the a t90s1200 is used as default. a vr device-specific initialisation files example.bas # family a vr # device 8515
a vr basic getting star ted guide v1.21 2/2 commands adc add with car r y add addition and logic and asr arithmetic shift right cp compar e cpc compar e with car r y com complement dec decr ement eor exclusive or for..next loop gosub subr outine call goto unconditional jump if ..then conditional branch inc incr ement lsl logic shift left lsr logic shift right neg negate nop no operation or logic or repea t ..until loop reti retur n fr om inter r upt return retur n fr om subr outine rol rotate left thr ough car r y ror rotate right thr ough car r y sbc subtract with car r y sub subtract sw ap swap nibbles or bytes switch c-multiple branch selection w ait inser t time delay xor exclusive or a vr basic pr ovides a set of basic command wor ds which allow pr ograms to be written in a conventional for mat. the following commands can cur r ently be used in a vr basic: repea t ...until, and the w ait command each allow a loop to r un until a test condition is satisfied - usually r equir ed for i/o operations. the c style switch command allows multiple conditional decisions to be implemented ef ficiently . in addition, a set of assembly code style instr uctions, for logical and arithmetic operations, per mits ef ficient use of the micr ocontr oller - usually one command generates one assembler instr uction. any a vr instr uction can be generated fr om basic.
a vr basic getting star ted guide v1.21 2/3 a vr basic suppor ts two dif fer ent layout styles. the first r esembles other micr ocomputer basic language variants, appearing as a list of statements, typically one per line, suppor ting conditional and unconditional jumps to labels (if -then, goto,). sour ce file line numbers ar e not explicitly used, but ar e generated by the compiler for code debugging, in the *.lst file (see section 1.4, ide over view). v ariant #1 (basic style) #family avr // [0] #device 1200 #include ..\inc\evalu8r // the rem comment is not supported. use // for comments // // variable and constant definitions // var i,j: byte //declare two byte variables [5] var n[5]: byte // and a subscripted variable[6] // //** the first executable instruction will be **[8] //** compiled at location 0x0000 ** i = 0 // let i = 0 - assignment.[11] j = pinb // get port b input [12] if j > 3 then labela // [13] i = j + 1 labela: repeat until false //loop forever [16] // ** end of program ** notes: [ 0 ] pr e - pr ocessor dir ectives, beginning with # in column 1, allow the compiler to load pr ocessor specific parameters, identifiers and common definitions. the default family is a vr and default device is a t90s1200. [ 5 ] all variables must be declar ed, and type specified, (compar e with dim in other basic dialects). v ar : [ 11 ] as in other dialects, let may be omitted fr om the assignment statement. [ 12 ] input of data fr om por t b is handled by assigning to a variable the value of pr e-defined i/o variable pinb i/o variables can also be used dir ectly in conditional statements. [ 13 ] labels can be used in if-then, goto, gosub [ 16 ] the loop for ever statement might be used this way during debugging, to fr eeze th e pr ogram after a single pass. pr ograms do not automatically ter minate. the pr ogrammer must pr ovide a final statement which ensur es that some par t of pr ogram r epeats endlessly - other wise execution will continue in the unpr ogrammed rom following the last valid instr uction, with unpr edictable consequences. pr ogram layout
a vr basic getting star ted guide v1.21 2/4 v ariant #2 (pascal / c style) the second style r esembles the layout of pr ocedural languages commonly used for micr ocontr oller pr ogramming. such as pascal, and the c language. pr ocedur es and functions to be called fr om main pr ogram body ar e defined at the head of the pr ogram body . #family avr #device 1200 #include ..\inc\evalu8r // // variable and constant definitions // var i,j: byte; //declare two byte variables [4] var n[5]: byte ; // and a subscripted variable // //** the first executable instruction will be ** //** a jump to address of main program body ** procedure myproc; // declare a procedure begin // [11] i := j+1; end; //of procedure begin i:= 0; // let i = 0 - assignment. j:= pinb; // get port b input if j <= 3 then // myproc; end; // repeat until false; // loop forever [21] end. // ** end of program ** [ 4 ] each pr ogram statement may be ter minated with a semicolon, and the end of main pr ogram body with end. (if used to ter minate pr ogram, the period . is r equir ed). [ 11 ] each pr ocedur e or function is enclosed by begin and end. [ 21 ] end is also r equir ed to ter minate a list of executable clauses within if - then - else statements. the above layout is pr efer r ed in all cases wher e pr ocedur es and inter r upts ar e used. pr ogram layout continued
a vr basic getting star ted guide v1.21 2/5 pr ogram layout continued comments comments ar e used to add a mor e descriptive meaning to a line of code. this helps somebody who does not understand the basic language to follow the functionality of the pr ogram. comments in a vr basic must be pr eceded by two for war d slashes (//) and continue to the end of the line. the use of comments can be seen in the examples in this section. example: i:= 0; //initialise i to zero
a vr basic getting star ted guide v1.21 2/6 constants constants fall in to four categories: hexadecimal, binar y , decimal and ascii. the default is decimal thus anything star ting with a 0..9 is interpr eted as a decimal constant. pr efixes % and $ ar e used for binar y and hexadecimal constants r espectively . t o declar e an ascii constant enclose it in quotes (). declaration examples: 50 decimal $50 hexadecimal %01101110 binary z ascii z from ascii lookup tables = 122 world ascii w, o, r, l, d eeprom constants a vr b asic suppor ts placing of data into the eeprom ar ea of an a vr micr ocontr oller . this data can either be a constant which is placed in the eeprom at compile time or a dynamic write which occurs when the code is actually executed. i) eeprom constants v arious data types can be placed in inter nal eeprom at compile time. this data will be inser ted into the .eep file r eady for pr ogramming into the tar get a vr device. example: const message eeprom = avr basic, 0 const msg2 eeprom = hello, 0 eeprom space is allocated fr om the bottom (low addr ess) by default. constants and v ariables cr eated at absolute addr esses do not change the eeprom allocation pointer and may over write existing data. ii) eeprom as ar ray it is easy to read/w rite the inter nal data eeprom, by simply accessing elements of a pr e- defined ar ray in eeprom.
a vr basic getting star ted guide v1.21 2/7 constants continued example: r0 := eeprom[0] // read eeprom[r0] := a // write notes: eeprom w riting is automatically enabled and disabled as r equir ed. iii) eeprom as object pr oper ties: ? eeprom.addr - eear eeprom addr ess register ? eeprom.data - eedr eeprom data register iv) methods: ? eeprom.read - reads fr om eeprom ? eeprom.w rite - w rites to eeprom examples: eeprom.addr := 5 // address to 5 eeprom.data := a // set data to a eeprom.write // write to eeprom eeprom.addr := 0 // address to 0 eeprom.read // read eeprom r0 := eeprom.data // r0 := data read notes: it is ok to use a vr i/o register v ariables eear, eedr, dir ectly to per for m eeprom low level read/w rite functions. using eeprom object makes the code compatible for non- a vr t ar gets.
a vr basic getting star ted guide v1.21 2/8 labels labels fall in to two categories, addr ess labels and v alue labels. addr ess labels ar e used to mark sections of pr ogram within your pr ogram and end in a colon (:). these can be up to 32 characters long. labels can not star t with a number or be the same as a r eser ved wor d or variable. labels make it possible to jump or go to ar eas of code without specifying an actual addr ess. v alue labels ar e declar ed using the const dir ective and ar e used to make your pr ogram mor e r eadable and allow for good pr ogramming practice by defining numbers as constants. v alue labels can also be used to r efer ence variables that have alr eady been declar ed. example: #include . const min = 1; // define constant value label const max = 5; // define constant value label var tally:byte; // define tally as byte variable begin jump: for tally = min to max led0 := not led0; //toggle led pin 5 times next goto jump // move the program pointer to the for loop statement end.
a vr basic getting star ted guide v1.21 2/9 the compiler suppor ts bit, byte and w or d variables. a bit is a single bit (1 or 0) boolean, byte is 8 bits and a wor d is 16 bits. all a vr resour ces (registers, i/o por ts, inter nal eeprom and sram) can be accessed as variables. v ariables ar e declar ed using the v ar dir ective. below is a summar y table of dif fer ent variable types. v ariable type t ype possible values syntax examples bit boolean 0 or 1 var t : bit; byte 8-bit byte 0 to 255 decimal var s : byte; w or d 16-bit wor d 0 to 65535 decimal var x : wor d; eeprom 8-bit byte 0 to 255 decimal var e1 : eeprom; pr e-defined v ariables v ariables that ar e pr e-defined for system use can not be r edefined for any other use or used as a label. e.g. a t90s1200 v ariables mapped to register space ? r0..r15 low bank register v ariables ? r16..r31 high bank register v ariables ? w0,w2..w30 - w or d v ariables (low , high bank aligned at w or d boundaries) ? wreg compiler w orking register (r31 by default) ? wbit compiler w orking bit storage (sreg.6) v ariables figur e 6
a vr basic getting star ted guide v1.21 2/10 v ariables mapped to i/o por ts ? acsr - analog comparator contr ol and status ? ddrb - por t b data dir ection register ? ddrd - por t d data dir ection register ? eear - eeprom addr ess register ? eecr - eeprom contr ol register ? eedr - eeprom data register ? gimsk - global inter r upt mask register ? mcucr - cpu contr ol register ? pinb - por t b input pins (read only) ? pind - por t d input pins (read only) ? por tb - por t b output latches (read/w rite) ? por td - por t d output latches (read/w rite) ? sreg - pr ocessor status register ? tcnt0 - t imer/counter 0 ? tccr0 - t imer/counter contr ol register ? tifr - t imer/counter inter r upt flag register ? timsk - t imer/counter inter r upt mask register ? wdtcr - w atchdog contr ol register ? sreg - status register all i/o v ariables have the name as in the r elevant atmel a vr datasheet. please r efer to a vr documentation for a complete description of all i/o r egisters. v ariables continued
a vr basic getting star ted guide v1.21 2/11 reser ved w or ds the following wor ds ar e also r eser ved for compiler use only: notes: not all of these reser ved w or ds ar e cur r ently suppor ted or r ecognised. reser ved w or ds can not be used as identifiers. add addr adc and asm arra y assembler begin bit boolean break byte case com const def aul t do downto eeprom else end exit f alse for function gosub goto high if interrupt in low next nop not or pop procedure program pointer push ram register repea t return rom shl shr skip sub sbc step symbol switch then true to unit until use uses v ar v ariable w ait while word xor
a vr basic getting star ted guide v1.21 2/12 expr essions ar e evaluated fr om the left to right. brackets can be used in constant expr essions. v alid operators expr ession syntax examples 1 + (9 - 5) myconst and %00001111 1 + 9 * 5 = 50 9 * 5 + 1 = 46 note that ther e is no operator pr ecedence. dif fer ent or ders of operations may yield dif fer ent r esults. ? + add ? - subtract ? * multiply ? / divide ? and logic and ? or logic or ? xor exclusive or ? << shift left ? >> shift right
a vr basic getting star ted guide v1.21 2/13 logic operators ar e used with decision based commands. the following operators for example can be used with the if then expr ession: ? bit v ariables ar e used as booleans ? not or ! can be used for inverse test of bit v ariables ? = equal ? <> not equal ? > gr eater ? < less ? >= gr eater or equal ? <= less or equal >, <, <=, >= ar e not available for bit v ariables. logic operators
a vr basic getting star ted guide v1.21 2/14 statements simple statements may be separated by the car riage retur n character - i.e. one statement per line, or by the semicolon ; if multiple statements appear on a single line then they each must be separated fr om the next by a semicolon. examples portb := $ff single statement on a line, no semicolon r equir ed. (semicolon is optional ) portd := $ff ; portb := 00 ; t wo statements on a line ; the first semicolon is r equir ed, the last is optional. compound statements i.e. those which can include one or mor e simple statements these r equir e a separator between each par t of the command str uctur e and between each enclosed simple statement. examples if j < 3 then portb := $fe ; j := 0 ; else j := j+1 ; end; if !pinb.1 then portd.2 :=1 end each clause of the statement should be on a separate line. a semicolon at the end of each simple statement is optional.
a vr basic getting star ted guide v1.21 2/15 pr ocedur es and functions ar e used like subr outines (gosub), but ar e called fr om any par t of the pr ogram by using the pr ocedur e name as a command. they r etur n when completed to the addr ess following the call instr uction. as they ar e declar ed at the head of the pr ogram body they ar e easily located and if given meaningful identifiers their r elation to the pr ogram is obvious. use of pr ocedur es and functions encourages str uctur ed pr ogramming, and is r ecommended in place of goto


▲Up To Search▲   

 
Price & Availability of AVR-BAS-8K

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X