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

[SOLVED]Problem with 18F97J60

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



Joined: 23 Sep 2010
Posts: 10

View user's profile Send private message

[SOLVED]Problem with 18F97J60
PostPosted: Thu Sep 23, 2010 1:45 am     Reply with quote

Hello everybody!
I got a problem with this chip. It can't run at any other oscillator frequency except its own internal! I have been searching many topics about this problem - and all look like the same! I have tried 3 compilators, the result is more than disappointed!
I tried with other chip - the same. I want to drive it with 25MHz oscillator.
I put 100nf caps at every Vdd-Vss pair. Vcap - 10uF (internal regulator).
Maybe the problem is somewhere in my PCB. I have tried very different FUSES - and nothing happened.
The program that I want to try is very simple - just blinking LED.
Thank You in advance!


Last edited by loggin on Wed Oct 20, 2010 6:08 am; edited 1 time in total
Ttelmah



Joined: 11 Mar 2010
Posts: 19364

View user's profile Send private message

PostPosted: Thu Sep 23, 2010 2:07 am     Reply with quote

Describe your PCB, round the oscillator pins?.
What crystal have you got?. Frequency, and _type_ (preferably a part number and supplier (you say '25MHz')).
What load capacitors are you using?.
How long are the tracks to the crystal?.
How is the ground plane run near these legs and tracks?.
Are you using a crystal, or an oscillator?.

Best Wiishes
loggin



Joined: 23 Sep 2010
Posts: 10

View user's profile Send private message

PostPosted: Thu Sep 23, 2010 2:17 am     Reply with quote

Thank you for the fast reply.
I use crystal SJK 25.000. Load capacitors are 33pf. The length of tracks to the crystal is about 8-10mm. The ground track runs between the pins of the crystal. I've tried other placements but nothing different.
Regards!
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Sep 23, 2010 2:41 am     Reply with quote

You have not given specific enough information to be able to identify the specific crystal you are using. I have implemented a few designs with this PIC with capacitors in the range of 18 to 22pF - naturally it depends predominantly on the crystal.

I suggest you look at the fuse settings and your programmer to make sure you have not inadvertently told the programmer to ignore the fuse settings in the code.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
loggin



Joined: 23 Sep 2010
Posts: 10

View user's profile Send private message

PostPosted: Thu Sep 23, 2010 5:31 am     Reply with quote

I've changed fuses on program and programmer but nothing. Got tried with variable values of capacitors - the same! Even though thank you for the advice!
ckielstra



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

View user's profile Send private message

PostPosted: Thu Sep 23, 2010 10:55 am     Reply with quote

We want to help you, but you have to provide more info. "crystal SJK 25.000" is not enough. When I go to the SJK website I see many different crystal types and each can have 16pF, 20pF, 30pF, 32pF or other value series capacitance.

- Post a schematic.
- Post your small but complete test program
- Post your compiler version number.
loggin



Joined: 23 Sep 2010
Posts: 10

View user's profile Send private message

PostPosted: Fri Sep 24, 2010 3:14 am     Reply with quote

The crystal is this one - http://www.q-crystal.com/upload/4/2009436173132156.pdf

Here is the scheme: http://www.picvalley.net/v.php?p=u/2614/51461038614276210071285319267juxFUSmKZ006MvGxBLU9.PNG


Programme:
main.c
Code:

#include "main.h"

void main()
{
   setup_adc_ports(NO_ANALOGS|VSS_VDD);
   setup_adc(ADC_CLOCK_DIV_2|ADC_TAD_MUL_0);
   setup_psp(PSP_DISABLED);
   setup_spi(SPI_SS_DISABLED);
   setup_spi2(SPI_SS_DISABLED);
   setup_wdt(WDT_OFF);
   setup_timer_0(RTCC_INTERNAL);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   setup_timer_4(T4_DISABLED,0,1);
   setup_ccp1(CCP_OFF);
   setup_comparator(NC_NC_NC_NC);
   setup_vref(FALSE);
   set_tris_g(0x00);

   
   while(true)
   {
   output_high(pin_g6);
   delay_ms(500);
   output_low(pin_g6);
   delay_ms(500);
   
   }

}

main.h:
Code:

#include <18F97J60.h>

#device adc=8

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES WDT128                   //Watch Dog Timer uses 1:128 Postscale
#FUSES HS                     //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
#FUSES NODEBUG                    //Debug mode for use with ICD
#FUSES NOXINST                  //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
#FUSES STVREN                   //Stack full/underflow will cause reset
#FUSES NOPROTECT                //Code not protected from reading
#FUSES FCMEN                    //Fail-safe clock monitor enabled
#FUSES IESO                     //Internal External Switch Over mode enabled
#FUSES PRIMARY                  //Primary clock is system clock when scs=00
#FUSES ECCPE                    //Enhanced CCP PWM outpts multiplexed with RE6 thorugh RE3
#FUSES NOETHLED                 //Ethernet LED disabled
#FUSES NOWAIT                   //Wait selections unavailable for Table Reads or Table Writes
#FUSES BW16                     //16-bit external bus mode
#FUSES MCU                      //Microcontroller Mode
#FUSES EASHFT                   //Address shifting enabled

#use delay(clock=25000000)

Thank You!
I've tried with variable load caps' values - 16pf, 20pf, 22pf, 33pf.
Ttelmah



Joined: 11 Mar 2010
Posts: 19364

View user's profile Send private message

PostPosted: Fri Sep 24, 2010 7:37 am     Reply with quote

The crystal will be something like SJK-6B 25.00 xx yy zz F q nn
It is these later figures we are interested in.
Now the xx figure is critical (load capacitance). yy (tolerance) will only matter if you are worried about the accuracy. Similarly the later figures (temperature range, height etc.., shouldn't affect things too much. So you need to look at the invoice, and find what you actually have, for that first number.
Similarly, for the 'F'. At this frequency, these crystals are available as fundamental, or third overtone devices (F or 3). You should have 'F'.

Pull the application note from Microchip, about PIC crystals. You talk about the ground plane 'running round the crystal pins'. If so, this may be your problem. Though ground planes are great for reducing noise, they introduce significant capacitance problems at high frequencies. Depending on the gap you have selected, which side of the board the tracks to the crystal are on, and the specified load capacitance of the crystal, you may have more capacitance already present from the ground plane, that the crystal is designed to operate with... The 'normal' way to work round the crystal, is to have a hole in the plane, with a 'ring' of track outside the crystal/PIC legs, which is then coupled to the ground plane.

Identify the crystal properly, and post a picture of the PCB section round the crystal (and PCB material).

Best Wishes
loggin



Joined: 23 Sep 2010
Posts: 10

View user's profile Send private message

PostPosted: Fri Sep 24, 2010 8:48 am     Reply with quote

I read before about the crystal but there's nothing written except SJK 25.000!
About the board-I use a test board but I thing this is not the problem.
However, thanks to all for the answers!
loggin



Joined: 23 Sep 2010
Posts: 10

View user's profile Send private message

PostPosted: Tue Oct 19, 2010 12:29 am     Reply with quote

At the end - it's solved.Thanks to all of You for the advices!!!
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Tue Oct 19, 2010 9:56 am     Reply with quote

loggin wrote:
At the end - it's solved.Thanks to all of You for the advices!!!


What was the problem?

How about changing the initial topic subject to a more descriptive one with [SOLVED] in the line so others can find it in searches?

Cheers,

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
loggin



Joined: 23 Sep 2010
Posts: 10

View user's profile Send private message

PostPosted: Wed Oct 20, 2010 6:17 am     Reply with quote

Due to I use a test board for this project, I use wires to connect pins to other points or buses. The wire to the 59th pin (Vdd) evidently was not soldered very well (*devil*). I had to resolder the junctions to the pin one by one to find where is the problem. And almost always the problem is something little little hidden for the eyes in the first look.... Thanks to all for the patience......Cheers....Regards....
KU5D



Joined: 10 Feb 2008
Posts: 46
Location: Asheville, North Carolina

View user's profile Send private message

PostPosted: Fri Oct 22, 2010 9:09 am     Reply with quote

My issue is just the opposite. I've used internal osc on other chips (18F4525 and 8527) with no problem, but cannot get the 97J60 to run on anything but an external crystal. #FUSES INTRC seems like the only change I made on the others, but that's not the case here it seems. Am I missing something simple?
_________________
Confidence is the feeling you have right before you fully understand the situation...
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Fri Oct 22, 2010 9:12 am     Reply with quote

KU5D wrote:
_________________
Confidence is the feeling you have right before you fully understand the situation...


Bahahaha!

I worked at a startup company from 1995 to 2000 and was employee #1 right after the founders. Between one of the founders, some employees and myself, our favorite saying was, "If you aren't scared #%!@-less, then you don't really know what's going on."

Hahaha..
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
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