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

Please help me. If i used pic18f458 with crystal 40 MHz.

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







Please help me. If i used pic18f458 with crystal 40 MHz.
PostPosted: Wed Dec 15, 2004 10:19 am     Reply with quote

Please help me. If i used pic18f458 with crystal 40 MHz. How many value of Capacitor for 40MHz Crystal? Because i use c=22Pf . it is not work.
And in datasheet of PIC18F458 in table2-2. What is TBD. Please explain me.
ckielstra



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

View user's profile Send private message

PostPosted: Wed Dec 15, 2004 10:56 am     Reply with quote

What voltage are you running the processor at?

Please post your #fuse settings.
Ttelmah
Guest







Re: Please help me. If i used pic18f458 with crystal 40 MHz.
PostPosted: Wed Dec 15, 2004 11:20 am     Reply with quote

a wrote:
Please help me. If i used pic18f458 with crystal 40 MHz. How many value of Capacitor for 40MHz Crystal? Because i use c=22Pf . it is not work.
And in datasheet of PIC18F458 in table2-2. What is TBD. Please explain me.

You cannot use the 18F458 with a 40MHz crystal...
The options are:
Use 10Mhz, and the PLL
Use an external oscillator module.
The internal oscillator is rated for 25MHz _maximum_. Table 27-6 in the data sheet.

Best Wishes
Ttelmah
Guest







PostPosted: Wed Dec 15, 2004 11:21 am     Reply with quote

TBD is 'To Be Determined'
a
Guest







PostPosted: Thu Dec 16, 2004 3:20 am     Reply with quote

#include <18F458.h>
#device adc=8
#use delay(clock=40000000,RESTART_WDT)
#fuses NOWDT,WDT128,HS, NOPROTECT, NOOSCSEN, BROWNOUT, BORV20, PUT, NOCPD, NOSTVREN, NODEBUG, NOLVP, NOWRT, NOWRTD, NOWRTB, NOCPB, NOWRTC, NOEBTR, NOEBTRB
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,stream=SDATA1)
ckielstra



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

View user's profile Send private message

PostPosted: Thu Dec 16, 2004 5:39 am     Reply with quote

Quote:
The internal oscillator is rated for 25MHz _maximum_. Table 27-6 in the data sheet.
Looking at table 27-6 I read it as 40MHz being allowed in the -40C to +85C temperature range. The 25MHz maximum is for the temperature range +85C to +125C.

Most people running the PIC18F458 at 40MHz are using a 10MHz crystal combined with the internal PLL frequency multiplier because of better EMC properties and I guess 10MHz crystals are easier to acquire.

At a quick glance I don't see any errors in the #fuses line. Only one strange thing, you have set the Brown Out voltage reset at 2.0V, with a processor running at 5V this seems a bit low.

Which brings me to the next thing; You didn't answer my question about the voltage you are running the processor at.

What exact version of the 458 are you using? Please give the exact type number as it is on your chip package so we can see if it is the F or LF and the industrial or Extended temperature range.

Many small details can go wrong, but before going into this any further make sure the rest of your circuit is correct. An easy way to prove this is by placing a 10MHz crystal and a small test program blinking a led.
a
Guest







PostPosted: Thu Dec 16, 2004 9:42 am     Reply with quote

thank you "ckielstra" Now i use crystal 4 pin==> Vcc,GND,OUTPUT,N/C
its is OK. now i'm not use capacitor. and my Vcc is 5V. Thank you for your reply.
Ttelmah
Guest







PostPosted: Thu Dec 16, 2004 4:22 pm     Reply with quote

I must have a different version of the 'sheet' to you Ckielstra. On mine, the maximum _oscillator_ frequency for the internal oscillator, is listed a 25MHz, independant of temperature range. The maximum CLKI frequency _for an external source_ goes to 40Mz on the lower temperature range. This is why I said that an external oscillator (rather than using the internal oscillator), was one option. This is what the original poster has now done...

Best Wishes
ckielstra



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

View user's profile Send private message

PostPosted: Fri Dec 17, 2004 2:45 am     Reply with quote

Hi Ttelmah,

The name of my datasheet is 41159c.pdf (January 2003), it turns out there is a newer version 41159d.pdf (September 2004). This newer document has the maximum frequency for HS oscillator lowered from 40MHz to 25MHz.

Thanks for helping me find this new datasheet document.
Ttelmah
Guest







PostPosted: Fri Dec 17, 2004 5:54 am     Reply with quote

That sounds a typical 'MicroChip' change, to really annoy people using the chip!.... :-)

Best Wishes
achamber2k
Guest







h4
PostPosted: Sun Dec 19, 2004 10:08 pm     Reply with quote

is h4 not hs in fuses, delay in 40000000
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