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

Timer1 and 67k22

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



Joined: 21 Nov 2003
Posts: 200

View user's profile Send private message

Timer1 and 67k22
PostPosted: Fri Jan 13, 2017 11:21 am     Reply with quote

I am either missing something in the documentation or just having an off day. I am using the SOSC to run the timer1 for a real time clock. I need the clock to keep running when in sleep(); I thought this was possible but it is not triggering the interrupt in sleep(); This is what I am using to initialise the Timer1. Any help would be great. Thanx guys.

Compiler verison is 5.056.
Code:
setup_timer_1(T1_EXTERNAL_SYNC|T1_DIV_BY_1 | T1_ENABLE_SOSC );
temtronic



Joined: 01 Jul 2010
Posts: 9232
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Jan 13, 2017 11:35 am     Reply with quote

You NEED to post your program, not just one line ! We have NO idea if you've enabled the timer interrupt. That one line does NOT enable the timer1 interrupt capability of the PIC.

Jay
curt2go



Joined: 21 Nov 2003
Posts: 200

View user's profile Send private message

PostPosted: Fri Jan 13, 2017 11:35 am     Reply with quote

Well this happens to me all the time. I post a question and then i look at what I posted, try a couple things and then i figure it out.

Problem solved. should not have had T1_EXTERNAL_SYNC just T1_EXTERNAL.
curt2go



Joined: 21 Nov 2003
Posts: 200

View user's profile Send private message

PostPosted: Fri Jan 13, 2017 11:38 am     Reply with quote

Sorry I should have stated that the interrupt was working fine. Just not when i put the PIC to sleep. But I have it now.
Ttelmah



Joined: 11 Mar 2010
Posts: 19529

View user's profile Send private message

PostPosted: Fri Jan 13, 2017 11:56 am     Reply with quote

Well done.
Makes sense if you think about it. Using 'sync', the clock is synchronised to transitions of the master oscillator. Asleep, this is off....
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