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

problem with T1_CLK_OUT

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



Joined: 31 Mar 2019
Posts: 43
Location: Sao paulo/Brazil

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

problem with T1_CLK_OUT
PostPosted: Thu Aug 19, 2021 7:02 am     Reply with quote

I currently use the 16F688 uC with a 32.768 khz crystal for timer1 interrupt to keep a relatively accurate clock.
The statement I use in CCS is:
setup_timer_1(T1_EXTERNAL|T1_DIV_BY_1|T1_CLK_OUT);


It just so happens that now I need to change the uC it will be 12F1840 or 16F1825, but when I try to make a basic code for testing, it already shows the error:
*** Error 12 "main.c" Line 8(42,52): Undefined identifier T1_CLK_OUT

test code:
Code:

#include <12F1840.h>
#device ADC=10
#use delay(internal=4000000)


void main()
{
   setup_timer_1(T1_EXTERNAL|T1_DIV_BY_1|T1_CLK_OUT);      //65,5 ms overflow


   while(TRUE)
   {


     
   }

}


Why does CCS give me this option, and when compiling it reports an error?


CCS 5.049 version

Thanks
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Thu Aug 19, 2021 7:42 am     Reply with quote

Seriously, you always need to read the processor include file.
The 12F1840.h contains all the setup options in it.
Now in fact if you look at the data sheet, you will see 'why' this is
different. The 1840, actually offers four different sources for it's clock,
together with a separate enable for the actual oscillator part. It doesn't have
the external input, just with an enable for the output, instead it has a
separate 'oscillator enable'.

setup_timer_1(T1_EXTERNAL|T1_DIV_BY_1|T1_ENABLE_T1OSC);
rodrigo_cirilo



Joined: 31 Mar 2019
Posts: 43
Location: Sao paulo/Brazil

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

PostPosted: Thu Aug 19, 2021 10:50 am     Reply with quote

Hello, I used the instruction you indicated and the code compiled without errors, I will analyze the file you indicated.
thanks
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