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

using timer pic18f4550

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



Joined: 26 Mar 2012
Posts: 16

View user's profile Send private message

using timer pic18f4550
PostPosted: Mon Jun 25, 2012 12:28 pm     Reply with quote

Hello Smile
The timer0, timer1, timer2 and timer3 in pic 18f4550 are defined by 16bit(8bit timer0L and 8 bit timer0H) and the same for others timers.
The question is when I use ccs the interrupt caused by a timer will be when the timer0L is overflowed or when the timer0H is overflowed ?
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Mon Jun 25, 2012 1:27 pm     Reply with quote

I find it's easiest to sometimes read the microchip data sheet.

For instance, timer0 can operate in both 8 and 16 bit modes.

Quote:

11.4 Timer0 Interrupt
The TMR0 interrupt is generated when the TMR0
register overflows from FFh to 00h in 8-bit mode, or
from FFFFh to 0000h in 16-bit mode. This overflow sets
the TMR0IF flag bit.


Mike
Louati



Joined: 26 Mar 2012
Posts: 16

View user's profile Send private message

PostPosted: Mon Jun 25, 2012 1:57 pm     Reply with quote

Mike Walne wrote:
I find it's easiest to sometimes read the microchip data sheet.

For instance, timer0 can operate in both 8 and 16 bit modes.

Quote:

11.4 Timer0 Interrupt
The TMR0 interrupt is generated when the TMR0
register overflows from FFh to 00h in 8-bit mode, or
from FFFFh to 0000h in 16-bit mode. This overflow sets
the TMR0IF flag bit.


Mike


yes it's so clear from the datasheet but the problem that I use the CCS compiler and I don't know if it work with 8 bit configuration or 16 bit and how to update it ?
Ttelmah



Joined: 11 Mar 2010
Posts: 19515

View user's profile Send private message

PostPosted: Mon Jun 25, 2012 2:32 pm     Reply with quote

Look at the processor include file. Little entries like:

T0_8_BIT

......

Default is always 16bit operation.

Best Wishes
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Tue Jun 26, 2012 2:03 am     Reply with quote

Quote:
The question is when I use ccs the interrupt caused by a timer will be when the timer0L is overflowed or when the timer0H is overflowed ?
Sorry, had not understood original question. What you meant was that you wanted to know which mode you were in with CCS.


Quote:
Look at the processor include file. Little entries like:

T0_8_BIT

......

Default is always 16bit operation.

That's confusing for me when microchip defaults the other way.

Quote:
9.8 TMR0 Interrupt
In 8-bit mode (which is the default), an overflow in the
TMR0 register (FFh → 00h) will set flag bit, TMR0IF. In
16-bit mode, an overflow in the TMR0H:TMR0L register


Mike
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