Tutorial 9:  Timer 0 External Counter with variable Prescalor

An external clock pulse increments Timer0 in counter mode. The current Timer0 prescalor is shown on PortB and the current Timer value is displayed on PORTA.

Download FEATURE7X_Tutorial9.zip and unzip into folder <your path>\Tutorial 9

Filename Version Description
tut9.pjt 1.0 Project
tut9.asm 1.0 Assembler code
tut9.hex 1.0 Precompiled HEX
tut9.lst 1.0 Precompiled LST
tut9.vbb 1.0 Virtual Breadboard simulation

Running the Simulation

Open tut4.vbb and press RUN. The counter will immediately begin incrementing with the current prescalor displayed on PORTB and the Timer0 displayed on PORTA.

Code Walk Through

Features Demonstrated

TRISA/PORTA

TRISB/PORTB

A4/T0CKI

Timer0 Counter Mode

Timer0 Interrupt

Timer0 Prescalor