![]() ![]() This is Mode 3 (8-bit auto reload-timer/counter) (8-bit timer/counter, with 5-bit pre-scaler) Timer0 or Timer1 will be in RunMode when TRX bit of TCON register is high and INT0 or INT1 is high. ![]() Timer0 or Timer1 will be in RunMode when TRX bit of TCON register is high. In the following table, we will see the bit details and their different operations for high or low value. Now, let us see the circuit that controls the running of the timers. So only Timer0 is available for timer or counter operations. Timer1 is used for generating the baud rate. The Serial port is used for serial communication in mode 1 and 3. This register can be programmed to configure these timers or counters. Mode 3 has a different meaning for each timer register. The Mode 0 to Mode 2 are for both of the Timer/Counter. There are four different modes of the Timer or Counter. So for event counting the time duration is 2 µs. When the frequency is12MHz, then the maximum count frequency will be 12MHz/24 = 500KHz. So in this mode, at least two machine cycles are needed. The external input pins are sampled once in each machine cycle, and to determine the 1or 0 transitions, another machine cycle will be needed. This type of transitions is treated as events. In this mode, the timer register is incremented for each 1 to 0 transition of the external input pin. In the counter mode, the external events are counted. In this mode it ignores the external timer input pin. ![]() So when the clock frequency is 12MHz, then the timer register is incremented in each millisecond. So this register is incremented in each machine cycle. In the timer mode, the internal machine cycles are counted. The only difference between these two modes is the source for incrementing the timer registers. These modes areTimer mode and the Counter mode. The timer registers can be used in two modes. These registers are known as Timer0 andTimer1. In Intel 8051, there are two 16-bit timer registers. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |