Start working with C New project Project New Vision Project Find somewhere to save you project choose nXF→LPC2131 with Startup.S Edit Startup.s comment the line 430 CES arm board v 14.7
Start working with C • New Project – Project → New μVision Project… – Find somewhere to save you project – choose NXP → LPC2131 – with Startup.s – Edit Startup.s • comment the line 430 CES arm board v.14.7 6
Start working with c Project> Options for target 1 At linker" tab select "Use Memory Layout from Target Dialog At"Output" tab select"Create HEX File ptions for Target Target 1 Device Target output Listing User I C/C++| Asm I Linker Debug Utilties I Select Adder for Objects Name of Executable:lab4_ex c Create Electable: Mlab4_ex 厂 Create Batch File v Create HEX File C Create Library: \ab4 ex LIB CES arm board v 14.7
Start working with C • Project → Options for target1 – At "Linker" tab • select “Use Memory Layout from Target Dialog” – At "Output" tab • select “Create HEX File” CES arm board v.14.7 7
Start working with c · Create a c file Fi|e→NeW. File→Save Find a good place to save your code e.g. same folder as the project file End the file name with c Some examples: main. C, test Cc Bad examples: a c, asd. c CES arm board v 14.7
Start working with C • Create a C file – File → New… – File → Save – Find a good place to save your code • e.g. same folder as the project file – End the file name with ".c" • Some examples : main.c, test_c.c • Bad examples: a.c, asd.c CES arm board v.14.7 8
Start working with c Add the code into your project Project Manage Components Environment and books Add files Locate the c file you just saved Your project should look like this E: Target 1 A Source Group 1 面$p nam. c CES arm board v 14.7
Start working with C • Add the code into your project – Project → Manage → Components, Environment and Books → Add files – Locate the C file you just saved – Your project should look like this: CES arm board v.14.7 9
Start working with c Paste the following template to your code #include <lpc213x.h> int main(t While (1) return 0 CES arm board v 14.7
Start working with C • Paste the following template to your code: 10 #include <lpc213x.h> int main(){ while(1); return 0; } CES arm board v.14.7