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

Problem with 18F67K22's timers

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



Joined: 20 Jul 2011
Posts: 375

View user's profile Send private message

Problem with 18F67K22's timers
PostPosted: Wed Jul 09, 2014 12:23 am     Reply with quote

Greetings! I'm using MPLab X v2.1, MPlab v8.91 and CCS v4.134. First I setup T0:
Code:

#INT_TIMER0
void TimerInt0()
{
    while(1);
}
void main()
{
setup_timer_0(T0_INTERNAL|T0_DIV_256);
set_timer0(0);
    enable_interrupts(GLOBAL);
    enable_interrupts(INT_TIMER0);
while(1);
}

In this case the timer is counting and it triggers the interrupt.
So I decided to setup another timer:
Code:

#INT_TIMER1
void TimerInt1()
{
    while(1);
}
void main()
{
setup_timer_1(T1_INTERNAL|T1_DIV_BY_8);
set_timer1(0);
    enable_interrupts(GLOBAL);
    enable_interrupts(INT_TIMER1);
while(1);


Now this is not working. Neither the debugger increments the timer, neither it works on a controller. I tried with timers 2 and 3 - no change.
On simulation in MPLab X it's working, but when I load the program to a controller - nothing.
What am I doing wrong?!
Thanks!
stoyanoff



Joined: 20 Jul 2011
Posts: 375

View user's profile Send private message

PostPosted: Wed Jul 09, 2014 5:52 am     Reply with quote

It seems the defined parameter
Code:

#define T1_INTERNAL         0x07

is not correct. I loaded manually T1CON register and everything works fine now. In my case the correct value was 69, but it depends on the situation.
I suppose the developer of CCS can fix this bug. I'm not sure how to open a ticket.
Best regards!
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Wed Jul 09, 2014 6:33 am     Reply with quote

support@ccsinfo.com
Ttelmah



Joined: 11 Mar 2010
Posts: 19518

View user's profile Send private message

PostPosted: Wed Jul 09, 2014 9:27 am     Reply with quote

But, it was fixed years ago. Version 4.134.....
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