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

Pseudo Timer Interrupt with PIC16F506

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



Joined: 08 Jul 2009
Posts: 24

View user's profile Send private message

Pseudo Timer Interrupt with PIC16F506
PostPosted: Wed Aug 18, 2010 9:17 pm     Reply with quote

Hello all,

In the all mighty search for the least expensive PIC for the job, I've discovered the 16F506 which, unfortunately, does not have one single interrupt. I guess you get what you pay for. Anyway, all I really need is a way to spoof the little PIC into thinking there's a timer 0 interrupt. Not much of a chance for the real thing, but any clever ideas would be much appreciated.

Thanks in advance for your comments.
Dan
Ttelmah



Joined: 11 Mar 2010
Posts: 19359

View user's profile Send private message

PostPosted: Thu Aug 19, 2010 3:57 am     Reply with quote

It depends massively on what you actually 'want'...
If you look back to the earliiest Windows multi-tasking, if code sat doing something like polling the keyboard, other programs didn't get called. This is the same situation you would have with any 'pseudo' interrupt. The point about the 'real' interrupt, is that it can interrupt code that is running. Any 'simulation', is not going to do this. What you can do, is have a 'test' routine, that you call wherever you can in your main code loop. In this, you read the timer, and compare it with the last reading. If the new reading is _less_ than the last reading, then the timer has 'wrapped' since the last call, and you can then call the code you want to execute.
You would obviously need to code all your routines in the 'main' loop, to call this regularly.

Seriously, 'reconsider', and switch to the 16F616. Pricing is basically the same (in fact in bulk this seems to be cheaper now), and you gain multiple timers, interrupt support, etc. etc..

Best Wishes
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Aug 19, 2010 4:31 pm     Reply with quote

You asked this question back in 2009 and I answered you in this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=39725
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