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

18F258 Timers never overflow!

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



Joined: 23 Jan 2004
Posts: 1

View user's profile Send private message

18F258 Timers never overflow!
PostPosted: Mon Jun 06, 2005 8:35 pm     Reply with quote

Hi..

got a little problem.. I try to use the Timers (0 & 1) in 16 bits. Their interrupts are ON, and the Global interrupts to.. but they never overflow!

When I debug the program an look at the TMR0L/TMR0H & TMR1L/TMR1H, I see the LOW registers moving from 0 to FF and that's ALL.. the high registers don't move.. so the interrupts never come. :(

thanks!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Jun 06, 2005 11:41 pm     Reply with quote

It's possible that you could have a problem with Timer0, because it
can be configured in either 8-bit or 16-mode for that PIC.

But Timer1 is always 16 bits, so it's unlikely that it can't increment
the MSB.

It's my guess that something else is going on. I think the most likely
thing is this:

You may not be displaying the Timer MSB properly. You need to
use "%LX" in printf() to display a 16 or 32 bit value in CCS.
If you only use "%X", you won't see the MSB displayed.
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