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

Timer 0 with external clock

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



Joined: 17 Nov 2008
Posts: 1

View user's profile Send private message

Timer 0 with external clock
PostPosted: Mon Nov 17, 2008 4:15 pm     Reply with quote

Hello everyone, I'm new to PIC programming, and I'm trying to build a robotic arm currently. The problem I'm running into is that I need to make my robotic arm to repeat movements it is trained to do, and for that I need to have a real time clock. I'm trying to use set timer and get timer functions on Timer0 at a 10Hz frequency, so I need a external clock. So my question is, where do I need to connect the clock? And how do I setup the timer in code? The PIC I'm using is PIC16F877A.

Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Nov 18, 2008 12:36 pm     Reply with quote

Download the CCS manual and look in the section on setup_timer_0().
http://www.ccsinfo.com/downloads/ccs_c_manual.pdf
Look at the code example at the end of that section. It shows how to
setup an external clock.

Also look in the section on Timer0 (also called RTCC) in the 16F877A.h
file. You will see the constant value that you need to use for an external
clock. Here's the file location:
Quote:
c:\Program Files\PICC\Devices\16F877a.h
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