












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Dr. Aabheer Desai delivered this lecture at Bengal Engineering and Science University for Computer Architecture course. It includes: PIC, Microcontroller, Peripherals, Input, Output, ADC, Comparator, Parallel, Port, Timers, Interrupts
Typology: Slides
1 / 20
This page cannot be seen from the preview
Don't miss anything!













counter clock)
determines the maximum count (256 or65536, respectively).
returns to zero, an overflow flag bit is set.
an overflow has occurred or an interruptgenerated, to trigger the required action.
To modify the count period, the timerregister can be preloaded with a givennumber.
preloaded with the value 156, a time-outoccurs after 256 – 156 = 100 clocks.
preloading each time it is restarted,
MHz with a prescale value of 4 counts upto 256 x 4 =
μ
s, at 4
μ
s per bit.
connected at the output of the counter.
bistable stages (flip-flops) connected incascade (8, 16, or 32 bits).
to its least significant bit (LSB) causes theoutput of that stage to toggle at half theinput frequency.
point in time; alternatively,
to notify the processor that the maximumcount has been exceeded.
value, the interrupt occurs after a knowncount.
timers, with the input derived from theMCU clock oscillator.
known, the count represents an accuratetimed period.
period or frequency of an input signal orinternal intervals or generate a regularinterrupt.
Binary Counter
Pre-scaler(clockdivide)
Post-scaler(outputdivide)
TimerOverflow/Timeout(Interrupt)Flag
ClockSourceSelect
InstructionClockExternal Pulse
Captureregister Compareregister
Capturesignal
Match flag
A binary counter is used as a timer when driven from the clock
register that can countpulses at RA4; for thispurpose, the input iscalled T0CKI (Timer0clock input).
prescaler that dividesby up to 128;
divide by up to 16.
and show it on an LED
by your friend.