View previous topic :: View next topic |
Author |
Message |
deepakomanna
Joined: 06 Mar 2007 Posts: 92 Location: Pune,India
|
Help About T1_CLK_OUT |
Posted: Thu Jan 03, 2008 12:16 am |
|
|
Dear Sir,
here i am using 16f913, MPLAB 7.5 Ver. & CCS PCM C Compiler, Version 3.249, 34534.
In my application i defined timer1 as,
Code: | setup_timer_1(T1_EXTERNAL | T1_DIV_BY_1 | T1_CLK_OUT); |
with this i am not getting correct time if my i/p frequency< 295 Hz.
but i defined like this
Code: | setup_timer_1(T1_EXTERNAL | T1_DIV_BY_1); |
I am getting correct time.
Here i am connected external crystal (32.768 kHz) to pin no 9.
can anybody know about T1_CLK_OUT ? _________________ Thank You,
With Best Regards,
Deepak. |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Thu Jan 03, 2008 8:41 am |
|
|
Quote: |
Here i am connected external crystal (32.768 kHz) to pin no 9.
can anybody know about T1_CLK_OUT ?
|
1) This device already has a built in 32.768 kHz crystal oscillator in the Timer1 module,
you only need to enable it. Set the control bit (3) T1OSCEN of the T1CON register (0x10).
2) If an external clock source is selected, you should use the T1CK1 input clock RC5
3) It is not a good practice to refer any I/O with its pin number because this is package
dependant. Instead you could use the pin name (RA6, RB5, RC7, etc) which are
device dependants.
Humberto |
|
|
deepakomanna
Joined: 06 Mar 2007 Posts: 92 Location: Pune,India
|
Help About T1_CLK_OUT |
Posted: Thu Jan 03, 2008 11:16 pm |
|
|
to the RC5 i have connected frequency i/p and calculating frequency by using CCP1 interrupt.So if the frequency is < 297 Hz i have to increment number every 1 sec.i.e.it should work as RTC & above >=297 it is frequency dependent.i.e. if freq. rises the time for 1 sec counter rise & if freq is 594 Hz number should increment every 0.5 sec.
But i am not getting correct time. _________________ Thank You,
With Best Regards,
Deepak. |
|
|
|