CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Timer2 as counter??

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Petar



Joined: 30 Jan 2004
Posts: 7

View user's profile Send private message

Timer2 as counter??
PostPosted: Tue Sep 07, 2004 10:51 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Tue Sep 07, 2004 10:59 am     Reply with quote

Read the datasheet.
Petar



Joined: 30 Jan 2004
Posts: 7

View user's profile Send private message

PostPosted: Tue Sep 07, 2004 11:22 am     Reply with quote

Thanks, but I have read it and I can't find anything - sorry !!
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Tue Sep 07, 2004 11:23 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Sep 07, 2004 11:25 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Sep 07, 2004 12:26 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group