AN803 ECLIPSE TUTORIAL
ECLIPSE TUTORIAL
Installing Eclipse, JRE
1. Locate Eclipse folder from CD and copy it to the appropriate location on your PC. The default location should be c:\Eclipse. 2. Download and install latest version of Java Runtime Environment (JRE) from Oracle/Sun website. 3. Open Eclipse from its installation folder.
Installing YAGARTO tool chain
1. Go to Yagarto folder in the CD and run [Link] to start installation of YAGARTO tool chain. Click Next to continue.
NEX Robotics Pvt. Ltd. [Link]
AN803 ECLIPSE TUTORIAL 2. Accept License Agreement and click next to continue.
3. Choose the highlighted components and click next to continue.
NEX Robotics Pvt. Ltd. [Link]
AN803 ECLIPSE TUTORIAL 4. Choose install location and click next to continue.
5. Click Install to begin installation process.
NEX Robotics Pvt. Ltd. [Link]
AN803 ECLIPSE TUTORIAL
6. Just follow the prompts to finish the installation process.
NEX Robotics Pvt. Ltd. [Link]
AN803 ECLIPSE TUTORIAL
Creating a project in Eclipse
1. Start Eclipse by simply running [Link] from Eclipse folder. Eclipse will prompt to select the workspace folder
2. Create a new C project from the file menu.
NEX Robotics Pvt. Ltd. [Link]
AN803 ECLIPSE TUTORIAL 3. Enter a suitable project name and select Project type and Toolchains as highlighted in fig. below. Click Next to continue.
NEX Robotics Pvt. Ltd. [Link]
AN803 ECLIPSE TUTORIAL 4. Click Finish to create the project.
NEX Robotics Pvt. Ltd. [Link]
AN803 ECLIPSE TUTORIAL 5. On clicking Finish the Project Explorer will show the project that was just created.
6. Right click on project and select Import.
NEX Robotics Pvt. Ltd. [Link]
AN803 ECLIPSE TUTORIAL 7. In the import window select File System from General Tree and click next.
8. Browse to Project Template directory in the CD and click OK.
NEX Robotics Pvt. Ltd. [Link]
AN803 ECLIPSE TUTORIAL
9. Check the project template check box and provide project folder info as shown in fig. below. The other settings should be kept as default. Click finish to import file.
NEX Robotics Pvt. Ltd. [Link]
10
AN803 ECLIPSE TUTORIAL 10. Expand the project from the Project Explorer window. It should contain the files as listed in the following figure. If any files are found missing, go back to step5.
11. Double click on main.c file to open it in the editor window. The main.c file contains a template C file which includes header file definitions and main function. 12. Copy the shaded part of below written program into the main.c file.
int main (void) { unsigned int i,j; PINSEL0 = 0x00000000; PINSEL1 = 0x00000000; PINSEL2&= 0xFFFFFFF7; IO1DIR=0x000F0000; while (1) { IO1SET = 0x000F0000; for(j=2;j>0;j--) { for(i=0; i<60000; i++); } IO1CLR = 0x000F0000; for(j=2;j>0;j--) { for(i=0; i<60000; i++); } } return(0); }
NEX Robotics Pvt. Ltd. [Link]
11
AN803 ECLIPSE TUTORIAL 13. Click Build All to build the project using makefile.
14. If build successfully the hex and elf files will be created as shown in fig. below.
NEX Robotics Pvt. Ltd. [Link]
12
AN803 ECLIPSE TUTORIAL
15. The next step is to load the hex file in to the microcontroller. You may use Flash Magic tool to load the hex file. The hex file named as application_rom.hex should be used for Flashing.
NEX Robotics Pvt. Ltd. [Link]
13