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

RTCC aka Timer0 interrupts on 12F508 (and probably 12C508)

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



Joined: 17 Oct 2005
Posts: 28
Location: Hampshire, UK

View user's profile Send private message

RTCC aka Timer0 interrupts on 12F508 (and probably 12C508)
PostPosted: Mon Oct 17, 2005 2:31 am     Reply with quote

Hi All!

I have been trying to use the Timer0/RTCC interrupt on a 12F508, but with no success.
Unlike other PICs I have used (mainly 16F876A/16F877) there is no support in the devices ".h" file for interrupts eg. #int_rtcc, #int_rb and so on.
I wanted a regular 1-10ms 'tick' in some code (not critical timing, just regularity required).
In the end, I've had to use a for() loop and handcrafted counter to give me about 10ms. This works fine, but it would have been nice to use the RTCC...

Any ideas on how to use it?

Regards,

Nigel
_________________
No comment! (Can't think of anything interesting to say!)
Ttelmah
Guest







PostPosted: Mon Oct 17, 2005 2:41 am     Reply with quote

The reason it is not in the .h file, is because the chip does not have this feature. The nearest thing this chip has to an 'interrupt', is the ability to wake up from sleep on a pin changing. Try loking at the data sheet...
If you want interrupts, you need to go to a more upmarket chip. The 12C671, or really the prefered chip now in this size, the 12F629/675, offer interrupts.

Best Wishes
aopg64



Joined: 17 Oct 2005
Posts: 28
Location: Hampshire, UK

View user's profile Send private message

PostPosted: Wed Oct 19, 2005 5:05 am     Reply with quote

Hi Ttelmah,

Oops, yes! I had assumed RTCC = Timer0 => timer interrupt capability!

Embarassed

The counting solution I ended up programming works fine. And the 12F508 is cheaper than the suggested alternatives with interrupts.
It was just that I had _wanted_ to get some experience using timer interrupts as a precursor for using several timers (probably) on another project using a 16F876A (or similar)

Thanks!

But the main benefit of having this problem is that I've discovered this great forum!

Wahoo!
Very Happy

Regards,

Nigel
_________________
No comment! (Can't think of anything interesting to say!)
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