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

Measuring pulse width using TImer 1

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



Joined: 30 Mar 2006
Posts: 1

View user's profile Send private message

Measuring pulse width using TImer 1
PostPosted: Thu Mar 30, 2006 4:40 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

#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();
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