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

Timer 1 Problem

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



Joined: 22 Sep 2008
Posts: 6

View user's profile Send private message

Timer 1 Problem
PostPosted: Mon Sep 22, 2008 9:53 am     Reply with quote

We created a temperature datalogger with a PIC 18LF2550.

My problem is that they don't work with cold temperatures.

Now I put a external rectangular clock (0 to 3.6V / 32.768kHz) into the RC0/T1OSO/T13CKI Pin (T1OSO is not connected) with the T1CON configuration 10110111b.
When I make that, then the Voltage of the clock goes down to 200mV and there is no timer 1 interrupt to wake up the PIC from sleep. I think it must be connected with the T1OSCEN, because when I enable the T1OSCEN and change the clock input to T1OSO then it works, but not with cold temperatures.

Can anyone help me to find the right configuration?

Here's my Timer 1 configuration routine:
Code:

   setup_oscillator(OSC_2MHZ);
   set_tris_c(0x9C);
   #ASM
   
   MOVLW 0b10110111  // Load configuration byte into
   MOVWF 0xFCD          // T1CON
   
   #ENDASM
 
   set_timer1(24576);

   enable_interrupts(INT_TIMER1);
   enable_interrupts(GLOBAL);

ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Mon Sep 22, 2008 4:12 pm     Reply with quote

Have a look at figure 12-1 of the PIC18F2550 datasheet for an explanation of the timer1 internal circuitry. Especially read Note 1 at the bottom of this figure.
You have to connect the external clock to the T1OSO pin and by clearing the T1OSCEN bit you can save a little energy.

What is the version number of the compiler you are using? You can find this at the top of the list file (*.lst).

What is the brand and type number of you external oscillator?

You say it doesn't work at cold temperatures. How cold?
The Large Hadron Colider had some problems last week. This is working at temperatures around 2 Kelvin. Is this the project you are working on? Smile
SLF



Joined: 22 Sep 2008
Posts: 6

View user's profile Send private message

PostPosted: Thu Sep 25, 2008 3:46 am     Reply with quote

No this is not the project I'm working on. It's for a Miniature Scientific Temperature Datalogger.

But it works now, also with cold temperatures (up to -40°C). I had a really stupid error.

When I initialised my pins for sleep mode I set pin T1OSO low.
This was in a subroutine at the end. So I didn't find it promptly.
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