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

its possible physically 1 timer multiple timer (channel)??

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



Joined: 06 Nov 2010
Posts: 22
Location: montreal qc

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

its possible physically 1 timer multiple timer (channel)??
PostPosted: Mon Mar 07, 2011 5:17 am     Reply with quote

I try to explain: 1 chip 1 display but many timer (channel) I can scan channel by menu to put and read time elapse on each channel of course all channel time is not working at the same time. I built a timer with display work on 16f84a and i want to build many channel with only 1 display.

Thanks for suggestion
temtronic



Joined: 01 Jul 2010
Posts: 9240
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Mar 07, 2011 6:17 am     Reply with quote

Yes...easy if they all start at the same time. Google 'pinewood derby stopwatch' or similar. Basically a 4 lane 'slot car' race timer,'who's first,2nd,3rd and last. Several variations,most PIC16F84 based.

If channels start/stop different times, can be done.

Overall...
setup a free running timer..
have 4 switches,dbeounced, on RB7...4
In an ISR( int_rb) 'flag' which pin is hi/lo, that triggered the ISR(details in the help of the compiler) and save the timer value.

Next time ISR occours, again, figure out which one triggered, if that is the 'end', then subtract first saved timer value with the new one. Difference is elapsed time.


In your main, just display the times.

You'll have to figure out how fast the timer should run, useconds,milliseconds, etc.as well as max time interval.
Also if the new timer value is less than the first, some math is invloved.
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