Libray usage guide
- Below example demonstrates the step by step procedure to include the libraries into any applications.
Step 1: Open the Keil software and select the New Microvision project from Project Menu as shown below.
Step 2: Browse to your project folder and provide the project name and click on save.
Step 3: Once the project is saved a new dialog box “Select Device for Target” opens, Select the controller(Atmel:At89s52/NXP:P89v51rd2) and click on OK.
Step 4: Once the project is created add a new header group to include the library header files.
Step 5: Add the library files to the project .c files to Source group and .h files to header group.<br\> Note:
- Copy the library files into the project folder before including them into the project.
Step 6: Add the .c files by selecting “C Source files” from “Files of type drop down”.
Step 7: Add the header( .h) files by selecting “Text file(.txt, .h, .inc)” from “Files of type” drop down.
Step 8: After including the library files, create a new .c file to write the main program.
Step 9: Write your program using the library functions and save it.<br\> Note:
- Include the respective header files before calling any library functions.
Step 10: Provide the suitable file name(main.c) and save it in the same project folder.
Step 11: Include your source file to the project.
Step 12: Configure the project to generate the hex file after compilation.
Step 13: Select the output menu and check the Create Hex File option to generate the hex file.
Step 14: Compile the project by clicking on Build target (or press F7). Project complies if there are no errors. If there are any errors fix them and re-compile.
Step 15: Once the project is built(compiled), hex file will be generated with the message as shown below. If the hex file is not generated then follow Step 12.
Step 16: Hex file will be generated with the project name in the selected project folder.