Digital Electronics, XMUT 2025
Lab 6: Assembler, counter – timers and interrupts

Due 25 May , 19 pm (Xiamen Time)
Note: You must present your projects to co-teachers or tutors in the lab.
Resources and links:
To Submit
-
Lab6Clock.asm
-
Lab6Clock.jpg
(a picture of your breadboard for the Lab6Clock)
Make sure your file has the name.
Digital Clock with 8051
During this lab session, the idea is to become familiar with implementing interrupts. The task is again to write some code to implement a digital clock, but this time a timer interrupt is used instead of polling.
Run the Silicon Laboratories IDE. Create a project. From the menu, click Project -> New Project.
IDE will then ask you to select your target Device.
- Select Device Family -> C8051F02x
- Project name –> Lab6Clock
- Location – "Set the Project location to a folder where you want to store the project."
- Project Type –> ASM Source Project
- Click OK.
To add more files to your project, right-click on the corresponding folder in the Project Area, and click “Add files to group” or “Add group”.
Add “
Clock6lab.asm” to the group and double click the file to open it for editing.

This code is to give you a head start in building your clock.

You will need to finish the setup code to enable the interrupt as well as write the Interrupt Service Routine (ISR).
Once you have made the necessary changes, you can compile and download your program.