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

18F4520 and Timer1 troubles

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



Joined: 21 Nov 2003
Posts: 200

View user's profile Send private message

18F4520 and Timer1 troubles
PostPosted: Wed Jun 04, 2008 4:06 pm     Reply with quote

i am having some trouble getting timer1 to work with a 32,768 crystal on it. I have done this with other pics with success. Is there something weird with the pic and Timer1? Let me know if you have any thoughts.. TTY
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jun 04, 2008 4:32 pm     Reply with quote

Here's a test program for an 18F452 with the Timer1 oscillator running
with an external 32.768KHz crystal on pins C0 and C1.
http://www.ccsinfo.com/forum/viewtopic.php?t=25824&start=7

Do you have the capacitors connected to the external crystal ?
The data sheet recommends 27pf.
curt2go



Joined: 21 Nov 2003
Posts: 200

View user's profile Send private message

PostPosted: Wed Jun 04, 2008 5:38 pm     Reply with quote

the crystal is a 6pf. I even tried 15pf. I have used this crystal on other designs with 6 and it works fine. It is very weird. I am using the intrc_io for my main clock. Let me know if you have any other thoughts . Thanx
ckielstra



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

View user's profile Send private message

PostPosted: Wed Jun 04, 2008 6:13 pm     Reply with quote

You tried the program linked to by PCM Programmer?

What is your compiler version?
curt2go



Joined: 21 Nov 2003
Posts: 200

View user's profile Send private message

PostPosted: Wed Jun 04, 2008 8:32 pm     Reply with quote

I am running the same program. 3.249..
drh



Joined: 12 Jul 2004
Posts: 192
Location: Hemet, California USA

View user's profile Send private message

PostPosted: Thu Jun 05, 2008 8:02 am     Reply with quote

In section 12 on page 129 of the data sheet, DS39631A, there is information on using timer 1 as the system clock.
_________________
David
curt2go



Joined: 21 Nov 2003
Posts: 200

View user's profile Send private message

PostPosted: Thu Jun 05, 2008 9:06 am     Reply with quote

i have tried everything.. New crystals . Caps up to 33pf. New processor. I tried the exact program that was posted. I can see the crystal oscillating at 32.768Khz on pin OSC2. But the timer 1 output no matter what is about 6 seconds.. Any ideas?
curt2go



Joined: 21 Nov 2003
Posts: 200

View user's profile Send private message

PostPosted: Thu Jun 05, 2008 9:12 am     Reply with quote

i am totally retarded.. I have the crystal on the wrong pins.. I had them on the oscillator pins the the timer1 pins.. AHHHHHHHHHHHHHHHHHHH. TTY
mskala



Joined: 06 Mar 2007
Posts: 100
Location: Massachusetts, USA

View user's profile Send private message

PostPosted: Thu Jun 05, 2008 9:48 am     Reply with quote

Unrelated to your real problem, but also 4520 is in the list of pics that have an errata for timer1 usage, so check that file on microchips web site.
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