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

TIMER3 issues

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



Joined: 05 Jul 2010
Posts: 4

View user's profile Send private message

TIMER3 issues
PostPosted: Fri Jul 23, 2010 10:14 am     Reply with quote

Hi,
I need to configure TMR3L and TMR3H with 0xCF2C but it seems like this piece of code is not doing it. I also tried to use Assembly for the same reason but I can get this configured it always shows that TMR3L and TMR3H have a zero value.
The purpose of this code is to have TMR3 overflow every approx. 10ms.
CODE 1:
Code:

setup_timer_3(0xCF2C);        // 0xCF2C = 53036
setup_timer_3(T3_INTERNAL | T3_DIV_BY_1);
enable_interrupts(INT_TIMER3);
enable_interrupts(GLOBAL);

CODE 2:
Code:

#asm
 MOVLW  0xCF
 MOVWF  TMR3H
 MOVLW  0x2C
 MOVWF  TMR3L
 MOVLW  0x85
 MOVWF  T3CON
 BSF    PIE2,1
#endasm

What is the problem?

Thank you
mkuang



Joined: 14 Dec 2007
Posts: 257

View user's profile Send private message Send e-mail

Re: TIMER3 issues
PostPosted: Fri Jul 23, 2010 11:54 am     Reply with quote

bennisx wrote:
Hi,
setup_timer_3(0xCF2C); // 0xCF2C = 53036


That line should be:

set_timer3(0xCF2C);
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jul 23, 2010 12:07 pm     Reply with quote

If you have problems with CCS functions, always post your PIC and
your compiler version.
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