C Language Tutorial for using the Silicon Labs University ...



C Language Tutorial for using the Silicon Labs University Daughter Card

Revised 3/19/09

First install the Silicon Labs software. Then follow the steps shown below.

1. Create a directory for containing your source code and copy the files from silabs_udc_ex1_asm.zip to this directory. I used “C:/silabs_udc” as my directory

2. You may also need to copy c8051f020.h to this directory.

3. Start the Silicon Laboratories IDE. You may use Start ( Programs ( Silicon Laborites ( Silicon Laborites IDE.

4. In the IDE menu select Options ( Connection Options. Be sure USB and JTAG are selected. Do not change the values in the Adapter Selection box.

[pic]

5. Create a directory for the

6. Select Project ( New Project.

7. Select and click on New_Project.

8. Select Save Project New_Project.

9. Save the project to your source directory as ex1_c.

10. Select and right click on ex1_c and add the files uni.c and uniex1.c to the project.

11. Select and right click on uni.c and add this file to the build. Select and right click on uniex1.c and add this file to the build.

12. Click on the Rebuild All, the Connect, and the Download icons.

[pic]

13. Click on the green GO icon to run the program.

14. The green LED’s should count up in a binary sequence. Pressing any button should cause the LED’s to count down.

15. The green GO icon should now be red, and can be used to stop the program.

16. With the program stopped press the 8051 and REGS icons. Notice that windows are opened showing the contents of the internal registes.

[pic]

17. Use View ( Debug Window ( SFR’s ( Ports to open a window showing the IO ports. The buttons and led’s are connected to port P5. By stepping through the program you can see how the registers and ports change.

[pic]

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download