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 support@ccsinfo.com

TIMER1

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








TIMER1
PostPosted: Thu Mar 30, 2006 9:29 am     Reply with quote

Anyone know code for measuring a pulse from a 555 timer?
Any help would be much appreciated?
Below is the code i have at the minute. I am using PIC 16F874 and programming in C. I intend to use Port c bit 0 as my input and use timer 1 to count when it receives an high input

#include <16f874.h>
#use delay (clock = 4000000)
#byte PORTC = 7
#bit INPUT = PORTC.0
setup_timer_1(T1_INTERNAL , T1_DIV_BY_1);
long int PERIOD;
main()
{
set_tris_c (0x01); // setting up ports
PERIOD= 0;
while(INPUT==0)
set_timer1(0);
while(INPUT==1);

PERIOD = get_timer1();
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Mar 30, 2006 1:06 pm     Reply with quote

Quote:
Anyone know code for measuring a pulse from a 555 timer?

Look at the CCS example file: EX_CCPMP.C

The file is in this folder: c:\Program Files\Picc\Examples
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