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 CCS Technical Support

40 MHz ceramic oscillator with 18F8722

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



Joined: 02 May 2006
Posts: 1

View user's profile Send private message

40 MHz ceramic oscillator with 18F8722
PostPosted: Tue May 02, 2006 4:39 pm     Reply with quote

hello all,

made own board with PIC18F8722 and am using
a 40 MHz ceramic oscillator (w/ caps) (part no. PX400CCT in DigiKey). this oscillator has been used before in other projects.

listing of header :
include <18f8722.h>
#device ICD=TRUE
#fuses HS,NOLVP,NOWDT,NOPUT,NOPROTECT
#use delay (clock=40000000)
#use rs232 (baud=2400, xmit=PIN_G1, rcv=PIN_G2, stream=PORT1)
#define PINC2trial PIN_C2

i put a 10x scope on OSC2 and get a dc value of 5v and
the scope on OSC1 is a little above common. i'm should see 40MHz
oscillation but obviously don't.

program bumps a pin hi and then low for test purposes:

#include <proto_icd.h>
#include <stdlib.h>
void main() {
while(TRUE) {
output_high(PINC2trial);
delay_cycles(100);
output_low(PINC2trial);
delay_cycles(100);
}
}

of course the pin doesn't move.

any ideas? thanks a bunch.
ba
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue May 02, 2006 4:53 pm     Reply with quote

Look in the 18F8722 data sheet, in the section on Electrical Characteristics.
Find the Table called "External Clock Timing Requirements".
It shows that for HS mode, the maximum frequency is 25 MHz.

If you want to use 40 MHz, according to the table, you have two choices:

1. You can use an external oscillator, in EC mode at 5v.
It looks like Digikey p/n XC323CT would work. Here's a photo:
http://rocky.digikey.com/WebLib/ECS/Web%20Photos/ECS-395-M-EXT.jpg
I picked a surface mount oscillator since your other part number
was also smt.

2. You can use a 10 MHz crystal in H4 mode at 5v.
It looks like Digikey p/n XC716CT would work. Here's a photo:
http://rocky.digikey.com/WebLib/ECS/Web%20Photos/CSM-7%20CRYSTAL.jpg
jnx



Joined: 21 Oct 2006
Posts: 2

View user's profile Send private message

PostPosted: Sun Oct 22, 2006 12:56 am     Reply with quote

HI PCM programmer / Mark,

IM USING A PIC18F8720 / PIC18F8722 FOR A MONTH.

- I USE 40MHZ ( SG513PH ) WITH FUSE SETTING SHOWN BELOW

I MAKE MY PROTO HARDWARE WORKING PERFECTLY BUT I HAVE QUESTION IN MY MIND:

- DID I OVERCLOCK THE 18F8720 / 18F8722?
- DID I USE THE CORRECT FUSE SETTINGS?
- DID MY OBJECTIVE SATISFY TO USE 40MHZ CRYSTALL TO 18F8720 AND 18F8722?
- RDA IS WORKING GOOD , ANY MAJOR ISSUE WITH RESPECT TO OTHER PERIPHERALS?


#if defined(__PCH__)
#include <18F8720.h>
#device ADC=10
#device *=16
#fuses EC,NOWDT,NOPROTECT,NOLVP,NOPUT
#use delay(clock=40000000)
#use rs232(baud=38400, xmit=PIN_C6, rcv=PIN_C7,ERRORS,STREAM=RS232)
#endif


THANX FOR HELPING SMALL GUY LIKE ME,
_________________
micro_small,

.NET_PIC'er
Ttelmah
Guest







PostPosted: Sun Oct 22, 2006 2:36 am     Reply with quote

Typing 'ALL IN CAPS', is considered shouting, and rude.
The point being made by PCM programmer, is that what you are doing, is 'out of spec' for the chip. It may well work (people have successfully 'overclocked' many of the PICs), _but_ it is a sure way to build a product that is likely to be unreliable in the future.
So, the answers to your questions, are that:
1) You are overclocking the _oscillator_ section of the chip.
2) No. Since you are doing something that the chip is not designed to do.
3) No. Same comment.
4) The 'core' of the chip, will work happily at this frequency, but the oscillator is likely to become unreliable at temperature/voltage extremes. It is _never_ the way to design a relaible product, to exceed the manufacturers spec.

Best Wishes
jnx



Joined: 21 Oct 2006
Posts: 2

View user's profile Send private message

PostPosted: Sun Oct 22, 2006 3:24 am     Reply with quote

Hi Ttelmah,

Many thanx for the feed back and for the CAPS LOCK reminder. Ttelmah now im using 10Mhz oscillator is my fuse settings correct to achive 40mhz in PIC18F8720 / PIC18f8722?


#if defined(__PCH__)
#include <18F8720.h>
#device ADC=10
#device *=16
#fuses H4,NOWDT,NOPROTECT,NOLVP,NOPUT
#use delay(clock=40000000)
#use rs232(baud=38400, xmit=PIN_C6, rcv=PIN_C7,ERRORS,STREAM=RS232)
#endif
_________________
micro_small,

.NET_PIC'er
Ttelmah
Guest







PostPosted: Sun Oct 22, 2006 5:25 am     Reply with quote

Much better. :-)
You don't actually 'need' the #device *=16 line (PIC18 chips always run as if this is used). However having it doesn't cause a problem.

Best Wishes
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