View previous topic :: View next topic |
Author |
Message |
curt2go
Joined: 21 Nov 2003 Posts: 200
|
18F4520 and Timer1 troubles |
Posted: Wed Jun 04, 2008 4:06 pm |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Jun 04, 2008 4:32 pm |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
curt2go
Joined: 21 Nov 2003 Posts: 200
|
|
Posted: Wed Jun 04, 2008 5:38 pm |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Wed Jun 04, 2008 6:13 pm |
|
|
You tried the program linked to by PCM Programmer?
What is your compiler version? |
|
![](templates/subSilver/images/spacer.gif) |
curt2go
Joined: 21 Nov 2003 Posts: 200
|
|
Posted: Wed Jun 04, 2008 8:32 pm |
|
|
I am running the same program. 3.249.. |
|
![](templates/subSilver/images/spacer.gif) |
drh
Joined: 12 Jul 2004 Posts: 192 Location: Hemet, California USA
|
|
Posted: Thu Jun 05, 2008 8:02 am |
|
|
In section 12 on page 129 of the data sheet, DS39631A, there is information on using timer 1 as the system clock. _________________ David |
|
![](templates/subSilver/images/spacer.gif) |
curt2go
Joined: 21 Nov 2003 Posts: 200
|
|
Posted: Thu Jun 05, 2008 9:06 am |
|
|
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? |
|
![](templates/subSilver/images/spacer.gif) |
curt2go
Joined: 21 Nov 2003 Posts: 200
|
|
Posted: Thu Jun 05, 2008 9:12 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
mskala
Joined: 06 Mar 2007 Posts: 100 Location: Massachusetts, USA
|
|
Posted: Thu Jun 05, 2008 9:48 am |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
|