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

Timer0 - PIC16F505

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



Joined: 04 Mar 2008
Posts: 7

View user's profile Send private message MSN Messenger

Timer0 - PIC16F505
PostPosted: Tue Mar 04, 2008 11:07 am     Reply with quote

Hi people,


We have a problem using timer0 of this PIC, how can i use this timer?
For example, use to control port_b2 to send level hi and low ( led blink).

I think this PIC16F505 not have interrupt.


Thanks all.
_________________
Flavio R. Caruso
www.stareletronics.com.br
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Mar 04, 2008 12:09 pm     Reply with quote

Quote:
I think this PIC16F505 not have interrupt.

You have to poll it. You can read the value of the Timer register and
test it against some other value, with an if() statement. However, the
Timer clock runs from the instruction clock (if you don't use a prescaler).
Because your polling loop will take several instructions, the timer could
easily increment past the value that you are checking, while the PIC
is executing the loop code. Therefore, you should use a prescaler
of at least 16, and it's safer to use 32. Then the ASM code in your
polling loop can take up to 32 instructions, and you will still be able
to read and test the timer register every time it increments. You won't
miss any of the timer count values. You can look at the .LST file and
count the number of instruction cycles in your polling loop, to be certain
that it will work.
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