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

RB Interrupt ?

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



Joined: 21 Oct 2003
Posts: 58

View user's profile Send private message

RB Interrupt ?
PostPosted: Thu Mar 30, 2006 3:19 am     Reply with quote

hi

I have a project to report the state of charge of a large battery pack, I can't use one of the commercially available gas guage type chips as there too many cells being used it will be out of there range.

Current Sensing will be done with a hall effect sensor and I had thought about feeding the output of that into a V to F convertor and then using a Pic to count the pulses.

The likely frequency is 1 - 100Khz will the RB interrupt be fast enough to count the pulses or would you recomend a different method?

The state of charge needs to be transmitted over a canbus (along with other info) so I immediately thought a pic would be the best solution.

I would appreciate your thoughts / comments

JFK
Ttelmah
Guest







PostPosted: Thu Mar 30, 2006 3:52 am     Reply with quote

Use a CTC instead.
Whether RB would potentially be fast enough, depends on the speed of the processor, and what you do inside the interrupt. However, even on the fastest chip versions, at the highest rates, the processor will be spending almost all it's time in the RB interrupt handler, and not be able to do anything much else. The CTC, will happily count pulses to many MHz rates (exact ceiling, depends on the processor). Add an overflow handler to give you perhaps a 32bit counter, and you have reliable counting to high rates.

Best Wishes
jfk1965



Joined: 21 Oct 2003
Posts: 58

View user's profile Send private message

PostPosted: Thu Mar 30, 2006 3:58 am     Reply with quote

Thanks Ttelmah, excuse my ignorance but what do yo mean by a CTC? Not familiar with the abbreviation,

Edit

Sorry i did a search and found the answer to my question, really must get used to using that search facility more

thanks again

JFK
Ttelmah
Guest







PostPosted: Thu Mar 30, 2006 6:33 am     Reply with quote

You have already found the answer, but just to explain further,'CTC' was the name given to counter/timer modules on some other chips. CCS, elected instead to use 'CCP' as a name for their's. The CTC abreviation was for 'counter/timer/compare' modules. CCS, call their units 'capture/compare/PWM' modules, though they can also be used as timers. I supose if you were to design the abreviation to cover all their uses, they would actually be CTCP modules!. Unfortunately, because I use other processors, where these modules are called CTC's, I tend sometimes to use this name...

Best Wishes
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