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

How to setup external secondary Low Power Osc?

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



Joined: 13 Apr 2011
Posts: 417

View user's profile Send private message

How to setup external secondary Low Power Osc?
PostPosted: Mon Sep 30, 2019 1:00 pm     Reply with quote

CCS v5.078
PIC24FJ1024GB606 (TQFP)

I need to run Timer 1, not the core, from an external 32KHz low power crystal so I have a crystal on pins 47 and 48 (RC13/RC14) with 27pF capacitors to ground.

On the code...

Code:

set_tris_c(0b0110000000000000);
setup_timer1(TMR_EXTERNAL_SOSC|TMR_DIV_BY_1|TMR_CONTINUE_IDLE|TMR_SYNC,8192);//Crystal 32.768KHz


Also the fuse
Code:
#fuses SOSC_LOW


But there's no oscillation.
Do I need to setup something more?

Edit:
Seems like there's a bit in OSCCON register that need to be set to 1 but I don't know how to.
_________________
Electric Blue
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Sep 30, 2019 5:10 pm     Reply with quote

This thread discusses the correct fuse to use:
http://www.ccsinfo.com/forum/viewtopic.php?t=57383
Ttelmah



Joined: 11 Mar 2010
Posts: 19255

View user's profile Send private message

PostPosted: Mon Sep 30, 2019 10:41 pm     Reply with quote

As a comment, you do not want SYNC, if this is going to be used when
the chip is in sleep mode. Since you have selected to run when IDLE,
it suggests you do. Understand that SYNC syncronises to the master
oscillator, which won't be available when 'IDLE'.....
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