View previous topic :: View next topic |
Author |
Message |
Petar
Joined: 30 Jan 2004 Posts: 7
|
Timer2 as counter?? |
Posted: Tue Sep 07, 2004 10:51 am |
|
|
Hello,
I have to implement a second counter on my PIC 18F452.
Is it possible to use timer2 as a counter?
Which PIN I have to use?
Thanks a lot!!!
Greatings
Petar |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Tue Sep 07, 2004 10:59 am |
|
|
Read the datasheet. |
|
|
Petar
Joined: 30 Jan 2004 Posts: 7
|
|
Posted: Tue Sep 07, 2004 11:22 am |
|
|
Thanks, but I have read it and I can't find anything - sorry !! |
|
|
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Tue Sep 07, 2004 11:23 am |
|
|
IF the datasheet was considered and looked at, one would find out that Timer2 is only a timer and that no input exists that could be used to increment it. |
|
|
Petar
Joined: 30 Jan 2004 Posts: 7
|
|
Posted: Tue Sep 07, 2004 11:25 am |
|
|
OK, but here is the text from the datasheet
• Timer2 module: 8-bit timer/counter with 8-bit
period register (time-base for PWM) |
|
|
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Tue Sep 07, 2004 12:26 pm |
|
|
Sometimes the data sheet has a typographical error here and there. Take a look at section 12 which describes Timer2 in depth. Look at the block diagram also. You will notice that there is nothing that states how to configure Timer2 to be a counter. Also, compare the block diagrams for the other timers. You will notice that there are inputs that allow for counting of external pulses. Always study the entire datasheet, pertaining to what you're after, in order to get a complete picture.
Ronald |
|
|
|