View previous topic :: View next topic |
Author |
Message |
rodrigo_cirilo
Joined: 31 Mar 2019 Posts: 43 Location: Sao paulo/Brazil
|
problem with T1_CLK_OUT |
Posted: Thu Aug 19, 2021 7:02 am |
|
|
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: 19590
|
|
Posted: Thu Aug 19, 2021 7:42 am |
|
|
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
|
|
Posted: Thu Aug 19, 2021 10:50 am |
|
|
Hello, I used the instruction you indicated and the code compiled without errors, I will analyze the file you indicated.
thanks |
|
|
|