Home

Example of Using Keil

image

Contents

1. KKK KKK KK KKK KK KK KK KK KK KK KK KK KK KK KK KKK KK KK KKK KKK Examples Program For CP JR ARMY USB LPC2148 Target MCU Philips ARM7 LPC2148 ee ie A A HHR aie ES METAS ESAS OA EA E e Nine TET oe ny Ho E Clock CPU Clock 60 Mrz ay Pe Wek chico Vole o wel Ose e pe Comos Las 2 Sa AM Y 0 e IN Eon sols UED lacas sor CEPTON 4 a KKK KKK KK KKK KK KK KK KK KK KKK KK KK KKK KK KK KK KKK KK KKK KKK y Comas Pl ee TED toe Mes ON y 072 sult include LPC214x H LPC2148 MPU Register SX Oconee eta Vora Cela abs One ct Ong E Delay Time Function AN SO aa PODERI TOSE 0x01000000 See I H Oui br ECONO Set GPIO 1 24 Output Pin f SOCOM Les e OUOU CPTO 2A Wine do Lf Oooo Comeniane WO LR O ONO E tear suc our Bro 247 delay 1000000 EREE Dalen LOS DOLO OO i Ser Onesie GRC 24 delay 1000000 Display Delay KKK KKK KK KK KKK KK KK KK KKK Pee Dele Waals ENCE on 7 es TOS TS a XKX KKK KK XJ vord delay unsigned longs int I HIE male eo tia 0 eo ao l Loop Decrease Counter y It is an example program of 1 blinking light at GPIO1 24 ETT CO LTD WWW ETT CO TH Example of Using Keil uVision3 to Create Project File of Keil CARM YZ DEMO1 aVision3 Text1 B File Edit View Project Debug Flash Peripherals Tools SYCS Window Help ES E x AascH Ao A Cl oH a amp Q BIS o amp i EN rst Target d x P
2. After we configure Project File name in the blank of File Name successfully click Save to save new Project File as in the picture below ETT CO LTD 2 WWW ETT CO TH ETT Example of Using Keil uVision3 to Create Project File of Keil CARM Create New Project Save in 2 DEMO da 5 File name DEMO ave as type Project Files uv 2 Cancel After we configure new Project File name and save it completely Program will wait for user to configure MCU number that is used in the saved Project File If using with Board CP JR ARMY USB LPC2148 we must configure MCU number to be LPC2148 from Philips and then select OK as in the picture below Select Device for Target Target 1 CPU Vendor Philips Device LPE2148 Toolset ARAM Data base Descriptions LPC 36 ARMY TOMI S based high performance 32 bit RISC Microcontroller with TF LPC2139 a ZKD on chip Flash ROM with In System Programming ISP and In 4pplic LPC9141 Two 10bit ADCs with 14 channels USE 2 0 Full Speed Device Controller Twa UART one with full modern interface LPC 42 Two lC serial interfaces Two SPI serial interfaces Tivo 32 bit timers Watchdog Timer P M unit Real Time Clock with optional battery backup Brown out detect circuit General purpose lO pins CPU clock up to 60 MHz On chip crystal oscillator and On chip PLL LPE2410 LPC2212 LPC2214 LPC2220 LPC2290 ETT CO LTD 3 WWW ETT CO TH C Example of Using Keil uVision3 to
3. Create Project File of Keil CARM El After we configure MCU number successfully in this step program will wait for user to confirm copy File Startup of Keil and wants to use it with MCU of Philips in new Project File or not Startup File is the part to configure the default value of operation for MCU for example to configure Stack value and to configure value to run for Phase Lock Loop before start running follow by our written program Otherwise our written program must totally be added these commands into operation of MCU by self File Startup of Keil ARM is Assembly Language File that 1s configured operation values with development set of Keil so some configurations and default values are different and it makes Board CP JR ARM USB LPC2148 can not be used with File Startup instantly Therefore we must modify some default value before using with program Keil CARM For interpretation commands we must modify new File Startup and must set new format that 1S corresponding with the board s need In this case we will recommend selecting No to protect Keil uVision3 not copy File Startup of Keil CARM to use in Project Vision3 v A Copy Philips LPC2100 Startup Code to Project Folder and 4dd File to Project 4 Copy File named Startup s that ETT has already provided in CD ROM and is saved in Example named Startup s then to place it in the same position folder of new Project File that we created completely
4. File Startup s is a file that contains Assembly Language Commands of ARMY to configure the necessary default value for MCU for example to configure Stack value into MCU to configure Initial Phase Lock Loop to configure value into MAM Function and to configure position Vectors of MCU For using with Board CP JR ARM7 USB LPC2148 1f we Add File Startup s from Keil or Copy this File from other positions it will be effected on the operation of program in Startup because some operations are different 5 Configure Option value of Project File by using command Project Option for Target Target 1 and then select Tab of Target to configure value of MCU Target as follows ETT CO LTD 4 WWW ETT CO TH T ETT Example of Using Keil uVision3 to Create Project File of Keil CARM El 5 1 Configure X TAL to be 12 MHz and then configure Memory internal MCU to be condition of interpretation program of Keil CARM as in the picture below Options for Target Target 1 Device Target Output Listing E Asm LA Locate LA Misc Debug Utilities Philips LPC2148 Big Endian i Use On chip ROM 0x0 O27FFFF Operating system None a Use On chip RAM 040000000 0x40007FFF External Menor Start SIZE m IRAN SIT J s2 Pam J sa Pam J Cancel Defaults 5 2 Output we must click default values of Create HEX File configure format of Hex to be HEX 386 and then select OK as in the pict
5. command Project gt Components Environment Books select Tab Project Components and then select desired Add File to add into Project File In the first time we must select Files of type to be C Source files c and it will display Files name that is C Language Source Code Click icon of File named main c and then select Add File named Startup s into Project Files that we created Then we must configure new File of type to be ASM Source files s srce a it will display File name Startup s in the blank of File name so click icon of File Startup s and then select Add File named Startup s into Project Files that we created ETT CO LTD 9 WWW ETT CO TH ETT Example of Using Keil uVision3 to Create Project File of Keil CARM When we command ADD both File name main c and Startup s into Project File successfully we must select Close to end the command Add File and it will display result of operation as in the picture below Components Environment and Books Project Components Folders E xtensions Books Project Targets ae 2 Groups EL T Files Set as Current Target et as Current Set as Current Target l aane Files Cancel Add Files to Group Source Group 1 Look ir CO DEMO wl ie E S main Files of type C Source file c Close ETT CO LTD 10 WWW ETT CO TH ETT Example of Using Keil uVision3 to Create Project File of
6. ETT Example of Using Keil uVision3 to Create Project File of Keil CARM An Example of using Keil uVision3 to create Project File of Keil ARM In this case we will mention about the proceeding to write program by using C Language Program that is Keil CARM It is used to interpret command under Program Text Editor of Keil Keil uVision3 We only mention about the proceeding to configure Option value fOr connection commands of interpretation program together by using Keil CARM through Keil uVision3 For more detailed commands and functions usage for writing program by Keil CARM user can learn them by self from User s Manual command of Keil CARM We can summarize the proceeding to configure default values of Keil uVision3 for using with Keil CARM as follows 1 Open program Keil uVision3 that is a program Text Editor of Keil CARM it is used to write C Language Source Code program and the feature of this program is look like in the picture below y Vision3 File Edit Yiew Project Debug Flash Peripherals Tools SYCS Window Help Qe eat Bloc 5 4B wl aA Ale rs 118 d y q Y S S it B w se X A Project Workspace x e aa ay Build Command A Findin Files 7 IK gt Output Window NUM OR R IW ETT CO LTD WWW ETT CO TH C Example of Using Keil uVision3 to Create Project File of Keil CARM El 2 Configure default values to interpret commands OT uVis
7. Keil CARM Add Files to Group Source Group 1 Look I gt DEMO Ka E sn File name see Add Files of type 1 Asm Source file s src a ka Components Environment and Books Project Components Folders E xtensions Books Project Targets 9 x Groups dae AIF ies Startup s Set as Curent Target as Current Set as Curent Target Add Files ETT CO LTD 11 WWW ETT CO TH ETT T Example of Using Keil uVision3 to Create Project File of Keil CARM After command Add File both main c and Startup s into Project File successfully we can see both Files name are displayed in the blank of Tab of File 8 Command to interpret the written program click command Projects gt Rebuild all target files and program Keil uVision3 will command program Keil CARM to interpret commands instantly YZ DEMO1 aVision3 C Keil ARM Eakachai LPC2148_USB DEMO1 main c B File Edit View Project Debug Flash Peripherals Tools SYCS Window Help a E x asa 2 oh H d GIRI sah m B U g y Target 1 y E x Project Workspace T AAA AA ATA A AAA AAT AAA AAA AAA AAA AAA AA AAA TARA AAS 3 Target 1 02 Examples Program For CP JR ARM USB LPC2148 tr 2 69 Source Group 1 03 Target MCU Philips ARM LPC2148 main c 04 X TAL 12 00 MHz 2 Startup s Us Run Speed 60 00 MHz With PLL 06 PLL Setup M 5 P 2 G7 VPE C
8. es into MCU as follows Should configure PLL value to be Processor Clock cclk 60 MHz in case of using XTAL value to be 12 MHz must configure value of M Multiply 5 and P Divide 2 and FFCO 240 MHz Should configure VPB Clock pclk value to equal cclk or 60 MHz Should configure MAM Timing value to be 4 Cycle of cclk MAMTIM 0x04 Should configure MAM Mode value to be Full Enable MAMCR 0x02 There are 2 methods to configure default values above firstly writing all Code commands in written program by self and secondly copies file Startup that has already written in this case we can command to Add Startup File into our new created Project file Additionally there are 2 methods to check and modify file Startup value firstly can modify Code command in file as desired and secondly configure Startup value from window program of Keil uVision3 by self In this case we recommend modifying value from Keil uVision3 because it 1S quit convenient To check Startup File value Functions Of Startup Bile e Containing commands Gf program for starting operation of MCU before running follow by our written program Function of Program in Startup file is Tartttal Operation of MCU in the important port first and chen Jump to run follow by the command in our written C Language Program If we want to check the Startup value click Tab of File Startup and then select Expand All and we can see the default va
9. ion E MAM Setup L MAM Control Fully Enabled MAM Timing 4 Figure Show the method to configure Startup File for LPC2148 ETT CO LTD 14 WWW ETT CO TH ETT Example of Using Keil uVision3 to Create Project File of Keil CARM El An example of C Code of Keil CARM for Initial operation of LPC2148 If we want to write program Initial operation MCU by self we only add code command into the starting point of main Program as in the picture below R E UA PORO Gib SU ARM USSG E T or Wiieiell Pin ior ECsqereais Piocaesoe Cloek ECONO eee eal SiS eyo i UN 12 Mz A 5 E e H i iaa oia e UA IS OSO El Z ME Va 60 MHz EOS OS D axe E le i x 2 32 2 la 240 MHz A NPR SAS 60 Mrz IS ao Waa cael oe met eb T PLLCEG amp OXEO i Resse MSD LOS 4 EO j Ox05 5 of ONS Pi Miles ys Ss PLE Ober Jf Reser Palio 1 PELC CEG IS Or L P OEL PLE Devid 2 PLEC ON e E RSS WC E Pine CON e 0601 We Pini o T e EL EES 0 20 A Stare Update PLE Cong PLLERED 0x55 iS AS ss Os lt OOO OO mye Lo NEC EE cl E Pie CON T 1 Oh Ce E one pause ikae le EMLESED D Stand AU Gateee eign Onack ang PELEEE DY 0x55 VPBDIV amp OxFC Reset VPBDIV VEDIA o i SHES LS ek a O nk iaa a a Il sole eee ETI K EE jac E AMA EO KAM PENRO Jy Dee WAM Pie e Lo MAMA E ME Seagate A Cels cl eel MAMCR 0x02 I Enable MAM Full Funccron ae O e ea MAM la eO Jo Care out Main PUn Cion Here Figure Show the samp
10. ion3 and can be used with Program Keil uVision3 and Keil CARM Click Project gt Components Environment Books and then select default value for Compiler from the title Select ARM Development Tools that has 3 modes Use Keil CARM Tools Use GNU Tools and Use ARM Tools In this case we must select Use Keil ARM Tools and then we must configure position of folder to store default values of program Keil ARM Generally it is in YC Keil ARM but if we install Keil in other folder we must change the format of it suitably and corresponding with truly usage as in the picture below Components Environment and Books Project Components FoldersExtensians Books Development Tool Folders Default File Extensions Use Settings from TOOLS IMI G CA Tool Baze Folder CMKeiMAAM4 aoe C Source l Gpp Asm Source I S src a Object ab oo Library R o oo Regfile l E Document Potash Sine Select SAM Development Tools Use Realview EXE o y Compiler Realview Folder Use Kell CARM E Compiler Use GNU GNU T ool Pretis Compiler Cygnus Folder amet 1 3 Create new Project File by using command Project New Project and then configure or create position Folder that we want to save new Project File with preferred Project File name For example if we create new Project File named DEMO1 and wants to save it into Folder named DEMO1 we can configure position of Folder and Project File name by self
11. le Code for initial operation of LPC2148 ETT CO LTD 15 WWW ETT CO TH
12. lock CPU Clock 60 00 MHz 08 Keil Editor uVision3 V3 03a 09 Compiler S Keil CARM V2 50a 10 Function Example LED Blink on GPIO1 24 tr 11 AS 12 7 Connect P1 24 to LED For Test ON OFF Blink 13 14 include LPC214x H 77 LPC2148 MPU Register 15 16 pototype section 17 void delay unsigned long int f f Delay Time Function 18 19 int main voidi 20 4 21 IODIRi 0OxD1000000 f Set GPIO 1 24 Output 22 IOSET1 Ox01000000 Set GPIO 1 24 Output Pin OFF LED 23 24 77 Loop Test Output GPIO1 24 25 while 1 77 Loop Continue o g gt UZ 159 main compi ling MALO assembling Startup s KRE 1 Progran Size data 1168 const 16 code 444 gicreating hex file from DEMO1 DEMO 0 Erroris U Warning Ss a 4 HY Pa RS R TES PEE T T 4 gt Simulation Va ts NUM Riv After we command to interpret program successfully and everything 1S correct without any error 0 Error and 0 Warning we will get Hex File that has names to be the same as the created Project File name and we can use this Hex File to download into MCU instantly ETT CO LTD 12 WWW ETT CO TH ETT Example of Using Keil uVision3 to Create Project File of Keil CARM An advice to Initial MCU before operation of main program is started If we want operation of MCU is the most efficient both high speed to collect data of command and operations we should configure default valu
13. lues that are configured in Startup file as in the picture below ETT CO LTD 13 WWW ETT CO TH E File Edit View Project Debug Flash Peripherals Tools SYCS Window Help ES x asad a US a aa am e E 3 Target amp A x Project Workspace Target 1 21 69 Source Group 1 T main c Startup s Stack Configuration Stack Sizes in Bytes Undefined Mode 0x0000 0004 Supervisor Mode 0x0000 0004 Abort Mode 0x0000 0004 Fast Interrupt Mode 0x0000 0004 Interrupt Mode 0x0000 0080 User System Mode 0x0000 0400 YPBDIY Setup Y PBDI PB Clock PB Clock CPU Clock XCLKDIV XCLK Pin XCLK Pin CPU Clock 4 PLL Setup lv MSEL PLL Multiplier Selection 5 PSEL PLL Divider Selection 2 MAM Setup lv MAM Control Fully Enabled MAM Timing 4 0 V main Startup compiling main c assembling Startup s linking ss E Program Size data 1168 const 16 code 444 Sjcreating hex file from LED_BLINK LED_BLINK 0 Error s O Warning s 3 Build Command L Find in Files j 4 Simulation NUM Ri Stack Configuration Stack Sizes in Bytes Undefined Mode 00000 0004 Supervisor Mode 0x0000 0004 Abort Mode 00000 0004 Fast Interrupt Mode 00000 00014 Interrupt Mode Ox0000 0050 User System Mode 00000 0400 VPBDIV Setup iw VPBOIY WPB Clock PB Clock CPU Clock ACLEDTY SECLE Pin CLE Pin CPU Clock 4 PLL Setup we MSEL PLL Multiplier Selection 5 PSEL PLL Divider Select
14. r of characters in program are changed follow by the functions such as Comment Variable and Command It is an advantage of Keil uVision3 that can extract and display characters follow by their functions 1t makes user understand program and read program easily as in the picture below YZ DEMO1 aVision3 C Keil ARM Eakachai LPC2148_USB DEMO1 main c E File Edit View Project Debug Flash Peripherals Tools SYCS Window Help s a x asia 2 4 EN y dh q ea Wm m EJES 4 A Target 1 4 e Project Workspace x JETTA KKK KKK KEK KKK KK AA AA AAA AAA AAA AA AAA AAA Ae HAAS 3 Target 1 A Examples Program For CP JR ARM USB LPC2148 tr Target MCU Philips ARM LPC2148 qe X TAL 12 00 MHz qa Run Speed 60 00 MHz With PLL it PLL Setup M 5 P 2 qe VPB Clock CPU Clock 60 00 MHz Keil Editor uVision3 V3 03a 7 gt Compiler Keil CARM Y2 508 7 gt Function Example LED Blink on GPIO1 24 AS ff Connect P1 24 to LED For Test ON OFF Blink include LPC214x H LPC2148 MPU Register pototype section void delayfunsigned long int Delay Time Function int main void C IODIRi 0x01000000 Set GPIO 1 24 Output IOSET1 OxD1000000 Set GPIO 1 24 Output Pin OFF LED Loop Test Output GPIO1 24 while 1 Loop Continue J E S WN E main T K A 3 Build A Command A Find in Files j IK Simulation EOS NUM Ri 7 Add Files into Project File click
15. roject Workspace EAS 3 Target 1 Examples Program For CP JR ARM USB LPC2148 Target MCU Philips ARM 7 LPC2148 qe X TAL 12 00 MHz pe Run Speed 60 00 MHz With PLL 75 PLL Setup M 5 P 2 t pe VPB Clock CPU Clock 60 00 MHz f Keil Editor uVision3 V3 03a Compiler Keil CARM V2 50a tr Function Example LED Blink on GPIO1 24 AAA 77 Connect P1 24 to LED For Test ON OFF Blink include LPC214x H LPC2148 MPU Register f pototype section void delay unsigned long int 77 Delay Time Function int main void 77 XXXX XXX1 XXXX XXXX XXXX XXXX XXXX XXXX IODIRi 0x01000000 77 Set GPIO 1 24 Output IOSET1 OxD1000000 77 Set GPIO 1 24 Output Pin OFF LED 77 Loop Test Output GPIO1 24 while f11 7 Loon Continue y Text x 3 70 Z syr 3 Build Command 1 Find in Files j IK Simulation Lg CBR NUM RIN After typing C Language commands completely we must save this File and must configure File surname to be C In this case we recommend to save by using command File Save As and then configure File name and File surname as main c as in the picture below Save in DEMO de File name Save as type All Files ETT CO LTD 8 WWW ETT CO TH ETT T Example of Using Keil uVision3 to Create Project File of Keil CARM X After save File as main c completely we can see colo
16. ure below Options for Target Target 1 Device Target Output Listing E Asm LA Locate LA Misc Debug Utilities Select Folder for Objects Mame of Executable DEMO f Create Executable ADEMO1 W Debug Information W Browse Information W Create HE File HE Format HE x 386 Start End Offset Create Library ADEMO1 LIB Create Batch File After Make W Beep When Complete Start Debugging Run User Program 1 Browse Run User Program 2 Browse Cancel Defaults ETT CO LTD 5 WWW ETT CO TH ETT Example of Using Keil uVision3 to Create Project File of Keil CARM El 6 Start writing C Language Source Code click command File gt New and we will get the available are to write Text File In the first time we must configure File name to be Text follow by the Default as in the picture below YZ AVision3 Text1 E File Edit View Project Debug Flash Peripherals Tools SYCS Window Help acl lt hl a H amp de m qm le x Project Workspace Xx BIS WN S le Textl x Output Window 21 14 Build Command A Find in Files j Ki Li C 1 NUM RW In this step it is typing C Language Source Code in the available area under configurations of Keil CARM and we can write program preferably as in the picture below ETT CO LTD 6 WWW ETT CO TH ETT Example of Using Keil uVision3 to Create Project File of Keil CARM

Download Pdf Manuals

image

Related Search

Related Contents

Spin & Discover Globe Manual  WARNING CAUTION  PSP-N340 U - PlayStation  Acronis Backup & Recovery 10 Advanced Workstation  Waves SoundGrid Driver User Guide  COX MR50 Use and Care Manual  1/3” Tag/Nacht-Farbkamera, VKC-1360, VKC-1360/12  Manuel d`installation et d`utilisation Trendline1+2+3 Troja 1+  

Copyright © All rights reserved.
Failed to retrieve file