Professional Documents
Culture Documents
LAB WORK - 06
Microprocessor Based System
Spring/Fall/Summer 20__
Student Name SID Marks
Marks Distribution:
CLO_1
Tasks Total Marks
Marks Obtained
Timer Assembly Code. 3
Task Proteus simulation. 2
Home Assignment. 2
Hardware Working. 3
Total Marks 10
DATE: ______________________
Remarks: ________________________________________________________________
Microprocessor Based System Instructor:
College of Engineering Ashar Ali Qureshi
PAF-Karachi Institute of Economics & Technology asharali.qureshi@pafkiet.edu.pk
Page 2 of 6
Timer0 Module
The Timer0 module has the following features:
• Software selectable as an 8-bit or 16-bit timer/counter.
• Readable and writable.
• Dedicated 8-bit software programmable prescaler.
• Clock source selectable to be external or internal.
• Interrupt-on-overflow from FFh to 00h in 8-bit mode and FFFFh to 0000h in 16-bit
mode.
• Edge selection for external clock.
Setting up T0:
OBJECTIVE #1
Make a program to toggle PORTB using the MAIN LOOP and toggle PORTC using the
Timer 0 Overflow Interrupt.
Example Code:
LIST P=PIC18F452, F=INHX32, N=0, ST=OFF, R=HEX ; INCLUDE CONTROLLER
TYPE
#include P18F452.INC ; INCLUDE CONTROLLER FILE
; FUSE BIT SETTINGS
MAIN