Tech Image of the Day

Tech Image of the Day
ROBONAUT 2

Thursday, December 22, 2011

PIC-2

The timer part of PIC is really confusing as compared to 8051. It has 3 timers-used for timing and counting operations.The pre-scaling & WDT are new concept compared to 8051. But the most confusing part is the timer control registers and the name of its various bits. TMR0 is is controlled by OPTION_REG while TMR1 & TMR2 are controlled by T1CON & T2CON. The names of
each bit in these registers are further more confusing and hard to remember. Pre-scaling operation adds to the chaos.
But definitely it has advantages over TR1 & TR2 of 8051. Here TMR0 and TMR2 are 8-bit timer counters, while TMR1 s 16-bit timer/counters. TMR1 can be used to count the pulses from
an external low-power oscillator(~32kHz). TMR2 has post-scaling other than pre-scaling operation/option, and can also be used for setting baud rate of serial communication.TMR1 is the simplest of all the timers. There's another register INTCON to control the interrupt. Also in sleep mode of PIC oscillator(~4MHz) is not working and so timer interrupt cannot be used to waken it up. But LP oscillator still works in this low-power state. And this is a cool thing!

No comments:

Post a Comment