|
|
View previous topic :: View next topic |
Author |
Message |
aopg64
Joined: 17 Oct 2005 Posts: 28 Location: Hampshire, UK
|
RTCC aka Timer0 interrupts on 12F508 (and probably 12C508) |
Posted: Mon Oct 17, 2005 2:31 am |
|
|
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
|
|
Posted: Mon Oct 17, 2005 2:41 am |
|
|
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
|
|
Posted: Wed Oct 19, 2005 5:05 am |
|
|
Hi Ttelmah,
Oops, yes! I had assumed RTCC = Timer0 => timer interrupt capability!
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!
Regards,
Nigel _________________ No comment! (Can't think of anything interesting to say!) |
|
|
|
|
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
|