how to use timer1 of 8051 as counter
Thu, 04/09/2009 - 14:24
i wish to use timer1 of 8051 as a counter
i am using AT89S52 & i use assembly language

bOtskOOl website by bOtskOOl is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 2.5 India License.
Permissions beyond the scope of this license may be available at http://www.botskool.com/contact.
bOtskOOl.com Privacy Policy - bOt-Xchange Product Listing Policy - Intellectual Property Rights (IPR) Protection Policy

- P3.5 (pin15) is used to count pulses for timer1
- C/T=1 for using timer1 as a counter
Consider the example below. Here we are using the timer1 in mode 2 and it is acting like a counter.MOV TMOD,#01100000B ;this sets the timer1 in mode2 & as counter
Instructions for starting or stopping the counter are same as that in case of timer.

but i wish to use it as a counter in interrupt mode
plz tell me the program...
There is a magical thing called datasheet, try reading that as well. When i started off with assembly the syntax looked like weird names, TMOD,TCON,SMOD ,you do not encounter them daily, but a little enthusiasm to learn , and i was through. Though i do not use 8051 series microcontrollers , and have started using 'C' compilers , i still peek into the datasheet to know the different register configuration because that is the basic stuff we need to know