Appendix c Outils

download Appendix c Outils

of 6

Transcript of Appendix c Outils

  • 8/15/2019 Appendix c Outils

    1/6

    • Home 

    • Development Tools 

    • Compilers 

    • Special Offer  

    • Easy Buy 

    • Projects 

    • Download 

    • Books 

    • Distributors 

    • Contact s 

    • Support 

    • TOC • !ntroduction 

    • C"# $ 

    • C"# % 

    • C"# & 

    • C"# ' 

    • C"# ( 

    • C"# ) 

    • C"# * 

    • C"# + 

    • C"# , 

    • -pp# - 

    • -pp# B 

    • -pp# C

    Appendix C: Development Systems

    How to start working? 

    - microcontroller is a .ood/natured 0.enie in t"e bottle0 and no e1tra knowled.e is re2uired

    to use it#

    !n order to create a device controlled by t"e microcontroller3 it is necessary to provide t"e

    simplest PC3 pro.ram for compilin. and simple device to transfer t"at code from PC to c"ip

    itself#

    Even t"ou." t"is process is 2uite lo.ical3 t"ere are often some 2ueries3 not because it is

    complicated3 but for numerous variations# 4et5s take a look###

    WRITIN !R"RA# IN ASS$#%&' &AN(A$

    !n order to write a pro.ram for t"e microcontroller3 a speciali6ed pro.ram in t"e 7indowsenvironment may be used# -ny pro.ram for te1t processin. can be used for t"is purpose# T"e

    http://www.mikroe.com/en/http://www.mikroe.com/en/http://www.mikroe.com/en/tools/http://www.mikroe.com/en/compilers/http://www.mikroe.com/en/offer/http://www.mikroe.com/en/tools/easybuy/http://www.mikroe.com/en/tools/easybuy/http://www.mikroe.com/en/projects/http://www.mikroe.com/en/download/http://www.mikroe.com/en/books/http://www.mikroe.com/en/distributors/http://www.mikroe.com/en/distributors/http://www.mikroe.com/en/contact/http://www.mikroe.com/en/support/http://www.mikroe.com/en/books/picmcubook/http://www.mikroe.com/en/books/picmcubook/ch0/http://www.mikroe.com/en/books/picmcubook/ch0/http://www.mikroe.com/en/books/picmcubook/ch1/http://www.mikroe.com/en/books/picmcubook/ch2/http://www.mikroe.com/en/books/picmcubook/ch3/http://www.mikroe.com/en/books/picmcubook/ch4/http://www.mikroe.com/en/books/picmcubook/ch5/http://www.mikroe.com/en/books/picmcubook/ch6/http://www.mikroe.com/en/books/picmcubook/ch7/http://www.mikroe.com/en/books/picmcubook/ch8/http://www.mikroe.com/en/books/picmcubook/ch9/http://www.mikroe.com/en/books/picmcubook/appa/http://www.mikroe.com/en/books/picmcubook/appb/http://www.mikroe.com/http://www.mikroe.com/en/http://www.mikroe.com/en/tools/http://www.mikroe.com/en/compilers/http://www.mikroe.com/en/offer/http://www.mikroe.com/en/tools/easybuy/http://www.mikroe.com/en/projects/http://www.mikroe.com/en/download/http://www.mikroe.com/en/books/http://www.mikroe.com/en/distributors/http://www.mikroe.com/en/contact/http://www.mikroe.com/en/support/http://www.mikroe.com/en/books/picmcubook/http://www.mikroe.com/en/books/picmcubook/ch0/http://www.mikroe.com/en/books/picmcubook/ch1/http://www.mikroe.com/en/books/picmcubook/ch2/http://www.mikroe.com/en/books/picmcubook/ch3/http://www.mikroe.com/en/books/picmcubook/ch4/http://www.mikroe.com/en/books/picmcubook/ch5/http://www.mikroe.com/en/books/picmcubook/ch6/http://www.mikroe.com/en/books/picmcubook/ch7/http://www.mikroe.com/en/books/picmcubook/ch8/http://www.mikroe.com/en/books/picmcubook/ch9/http://www.mikroe.com/en/books/picmcubook/appa/http://www.mikroe.com/en/books/picmcubook/appb/

  • 8/15/2019 Appendix c Outils

    2/6

     point is to write all instructions in suc" an order t"ey s"ould be e1ecuted by t"e

    microcontroller3 observe t"e rules of assembly lan.ua.e and write instructions e1actly as t"ey

    are defined# !n ot"er words3 you just "ave to follow t"e pro.ram idea8 T"at5s all8 7"en usin.

    custom software3 t"ere are numerous tools w"ic" are also installed to aid in t"e development

     process# One suc" tool is t"e Simulator# T"is enables t"e user to test t"e code prior to burnin.

    it to t"e 9C#

    Loop button PORTA,0,0,Increment

      button PORTA,1,0,Decrement

      goto Loop

    Increment incf cnt,f

      movf cnt,w

      movwf PORTB

      goto Loop

    Decrement decf cnt,f

      movf cnt,w

      movwf PORTB

    To enable t"e compiler to perform its task successfully3 it is necessary t"at a document

    containin. t"is pro.ram "as t"e e1tension3 #asm in its name3 for e1ample: Pro.ram#asm

    7"en a speciali6ed pro.ram ;9P4-B< is used3 t"is e1tension will be automatically added# !f

    any ot"er pro.ram for te1t processin. ;=otepad< is used t"en t"e document s"ould be saved

    and renamed# >or e1ample: Pro.ram#t1t /? Pro.ram#asm#

     =ote for la6y ones: skip t"is procedure3 open a new #asm document in 9P4-B and simply

    copy@paste t"e te1t of t"e pro.ram written in assembly lan.ua.e#

    C"#!I&IN !R"RA#

    T"e microcontroller does not understand assembly lan.ua.e as suc"# T"is is w"y it is

    necessary to compile t"e pro.ram into mac"ine lan.ua.e# !t is more t"an simple w"en usin. a

    speciali6ed pro.ram ;9P4-B< because a compiler is part of t"e software8 Aust one click on

    t"e appropriate icon solves t"e problem and a new document wit" #"e1 e1tension pops out# !t

    is actually t"e same pro.ram3 but compiled into computer lan.ua.e w"ic" t"e microcontroller 

     perfectly understands# Suc" documentation is commonly named 0"e1 code0 and seemin.ly

    represents a meanin.less se2uence of numbers in "e1adecimal numerical system#

    :0300000000100!A10010000"#$13!

    "#%0!!B%01010D$0!%"A1&"%D&0

    %0110003"$#$%'A!3(%$'$'B#B

    A#$#!'A#(%AD%('(D$!'D%!AD

    A!(DD00000001!!##A!'D#$%'A

    !3(%$'$'B#BA#$#!'A#(%AD%(

    DA)#%"00D00000"$'(D$!'D%!A

    DA!(DD00000001!!##A!'D$!'D

    %!ADA!(DD000!"#%0!!B%013"$

    '(D$!'D%!ADA!(DD00000001!!

    ##A!'D#$%'A!3(%$'$'B#BA#$#

    !'A#(%AD%(DA)#%D%!ADA!(D

    D00000001!!##A!'D$!'D%!ADA!(DD000!"#%0!!B%013"$'(D$

    "$'(D$!'D%!A#$%'A!3(%$'$'B

  • 8/15/2019 Appendix c Outils

    3/6

    #BA#$#!'A#(%AD%(DA!(DD000

    00001!!DA!(DD00000001!!##A

    ADA!(DD00000001!!##A!'D$!'

    D%!A

    !n case ot"er software for pro.ram writin. in assembly lan.ua.e is used3 special software for

    compilin. t"e pro.ram must be installed and used as follows: set up t"e compiler3 open t"edocument wit" #asm e1tension and compile# T"e result is t"e same/ a new document wit" #"e1

    e1tension# T"e only problem you "ave now is t"at it is stored in your PC#

    !R"RA##IN A #ICR"C"NTR"&&$R 

    To enable 0"e1 code0 transmission to t"e microcontroller it is necessary to provide a cable for

    serial communication and a special device called pro.rammer wit" appropriate software#

    T"ere are several ways to do it#

    - lot of pro.rams and electronic circuits "avin. t"is purpose can be found on t"e !nternet# Doas follows: open "e1 code document3 set a few parameters and click t"e icon for compilin.#

    -fter a w"ile3 a se2uence of 6eros and ones is to be pro.rammed into t"e microcontroller

    t"rou." t"e serial connection cable and pro.rammer "ardware# T"ere is not"in. else to be

    done e1cept for placin. t"e pro.rammed c"ip into t"e tar.et device# !n case it is necessary to

    make some c"an.es in t"e pro.ram3 t"e previous procedure may be repeated an unlimited

    number of times#

    Is t)is a )appy ending? 

    T"is section briefly describes t"e use of 9P4-B and pro.rammer software developed by

    9ikroelektronika# Everyt"in. is very simple###

    ou "ave already installed 9P4-B3 "avent youF Open a new project and a new

    document wit" e1tension#asm#

  • 8/15/2019 Appendix c Outils

    4/6

    OG# ou "ave written a pro.ram and tested it wit" t"e simulator# T"e pro.ram did not reports

    any error durin. t"e compilin. processF !t seems t"at everyt"in. is under control###

    T"e pro.ram is written and successfully compiled# -ll t"ats left is to dump t"e pro.ram to t"e

    microcontroller# >or t"is purpose it is necessary to "ave software t"at takes t"e written and

    compiled pro.ram and passes it into t"e microcontroller ; P!C >las" for e1ample

  • 8/15/2019 Appendix c Outils

    5/6

    • Connect t"e PC and pro.rammer via a SB cableI

    • 4oad t"e HEJ code usin. command: >ile /? 4oad HEJI and

    • Click t"e 07rite0 pus"/button and wait###

    T"at5s it8 T"e microcontroller is pro.rammed and everyt"in. is ready for operation# !f you are

    not satisfied3 make some c"an.es in t"e pro.ram and repeat t"e procedure# ntil w"enF ntil

    you feel satisfied###

    Development systems

    - device3 w"ic" in testin. pro.ram p"ase3 can simulate any environment is called a

    development system# -part from t"e pro.rammer3 t"e power supply unit and t"e

    microcontrollers socket3 t"e development system contains elements for input pin

    activation and output pin monitorin.# T"e simplest version "as every pin connected to one

     pus"/button and one 4ED as well# - "i." 2uality version "as 4ED displays3 4CD displays3temperature sensors and all ot"er elements w"ic" t"e tar.et device can be supplied wit"#

    T"ese perip"erals could be connected to t"e 9C via miniature jumpers# !n t"is way3 t"e

    w"ole pro.ram may be tested in practice3 durin. its development sta.e3 because t"e

    microcontroller does not know3 or care3 w"et"er its input is activated by a pus"/button or a

    sensor built in a real mac"ine#

  • 8/15/2019 Appendix c Outils

    6/6

    Development system $asy!IC*

    Previous C"apter  K Table of Contents

    • Support forums 

    •  =ews 

    • Site map 

    • Contact 

    • 4e.al info 

    Copyri."t L $,,+M%N$N# mikroElektronika# -ll ri."ts reserved# -ll trade and@or services

    marks mentioned are t"e property of t"eir respective owners#

    http://www.mikroe.com/en/books/picmcubook/appb/http://www.mikroe.com/en/books/picmcubook/http://www.mikroe.com/forum/http://www.mikroe.com/en/news/http://www.mikroe.com/en/news/http://www.mikroe.com/en/sitemap/http://www.mikroe.com/en/sitemap/http://www.mikroe.com/en/contact/http://www.mikroe.com/en/contact/http://www.mikroe.com/en/legal/http://www.mikroe.com/en/tools/easypic5/http://www.mikroe.com/en/books/picmcubook/appb/http://www.mikroe.com/en/books/picmcubook/http://www.mikroe.com/forum/http://www.mikroe.com/en/news/http://www.mikroe.com/en/sitemap/http://www.mikroe.com/en/contact/http://www.mikroe.com/en/legal/