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

H4 does it work? (PLL 4 x clock multiplier)

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



Joined: 30 Oct 2003
Posts: 209
Location: Norfolk, England

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

H4 does it work? (PLL 4 x clock multiplier)
PostPosted: Tue Jul 20, 2004 4:22 am     Reply with quote

Hi,
I am having great difficulty in getting my 18F442 to run at 40MHz. For development I was using a 40Mhz crystal, no problem I though, for production I can use 10MHz and set the H4 fuse!
Wrong! PIC runs at 10MHz!

Any ideas what I am doing incorrect. My fuse statment is:

#fuses H4,NOWDT,NOPUT,DEBUG,NOLVP

I am about to dig myself into the datasheet to set the registeres manually, but is there a CCS way of doing it?

Will
Ttelmah
Guest







Re: H4 does it work? (PLL 4 x clock multiplier)
PostPosted: Tue Jul 20, 2004 4:35 am     Reply with quote

Will Reeve wrote:
Hi,
I am having great difficulty in getting my 18F442 to run at 40MHz. For development I was using a 40Mhz crystal, no problem I though, for production I can use 10MHz and set the H4 fuse!
Wrong! PIC runs at 10MHz!

Any ideas what I am doing incorrect. My fuse statment is:

#fuses H4,NOWDT,NOPUT,DEBUG,NOLVP

I am about to dig myself into the datasheet to set the registeres manually, but is there a CCS way of doing it?

Will

I'm amazed you got the chip to run at 40MHz, using a 40MHz 'crystal', since the internal oscillator is only rated for 25MHz max, and though it will sometimes go a little beyond this, usually fails well short of 40Mhz. The fact that you got it to run, implies that your 40MHz crystal, may have a very high gain. Now if the one being used for H4 operation, is from the same 'family', and has similar characteristics, it probably explains your problem. The PLL, will fail to work, if the input is overdriven. Hence with high gain crystals, it becoms neessary to add a resistor, as an attenuator to bring the signal level down. The question also arises of how old the chip is, since early versions of this family, definately had this problem 'worse', than the current releases.
H4, does work (though check the 'fuses' in your programmer, and verify that what is being written to the chip, is the same as you have selected), but it is a somewhat more 'fussy' configuration than the normal PIC oscillator.

Best Wishs
lucky



Joined: 12 Sep 2003
Posts: 46
Location: South Coast - England

View user's profile Send private message Visit poster's website

H4
PostPosted: Tue Jul 20, 2004 4:36 am     Reply with quote

Hi Will,

Are you setting the #use delay correctly?

#fuses H4, NOWDT, PUT, BROWNOUT, WRT, NOOSCSEN, BROWNOUT, BORV27, STVREN, NOLVP, NODEBUG
#use delay(clock=40000000,RESTART_WDT)

Works for me to give 40MHz from a 10MHz clock on my MP3 player.
_________________
Lucky
www.mpic3.com - MPIC3 player project, Forum, Downloads, Online Shop
Will Reeve



Joined: 30 Oct 2003
Posts: 209
Location: Norfolk, England

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

PostPosted: Tue Jul 20, 2004 5:53 am     Reply with quote

Hi guys,
I was using a 4pin 40MHz crystal in the old Microchip development board. The new design uses a 10MHz ceramic oscillator with built in decoupling caps (it's three pins one of which is GND). I've scoped the osc pins and there is a lovely 10MHz sine wave present on the osc2 pin.

Here is the end of my list file:
Configuration Fuses:
Word 1: 2600 H4 NOOSCSEN

So it would appear that the compiler is getting the first configuration word correct although I can't see where it actually lists the "programming" of it in the list file!

To answer your questions, both chips were "new" from Farnell in the UK, one was a 40pin PDIP (development) the other a 44pin PLCC (production).

I’ve now placed a 100Ohm resistor in the OSC2 line and low and behold the PLL appears to have kicked in and she is running at 40MHz!

Scoping the OSC2 pin and the sine wave looks just like before!

I’ve looked at the resonators datasheet (CSTCC) and nothing is mentioned about series resistors, is 100Ohm a sensible value?

You imply you shouldn’t run with an external clk frequency of 40MHz? I thought the 18F422 can run DC to 40MHz external freq?

Thanks for your help guys.

Will
Ttelmah
Guest







PostPosted: Tue Jul 20, 2004 6:34 am     Reply with quote

Will Reeve wrote:
Hi guys,
I was using a 4pin 40MHz crystal in the old Microchip development board. The new design uses a 10MHz ceramic oscillator with built in decoupling caps (it's three pins one of which is GND). I've scoped the osc pins and there is a lovely 10MHz sine wave present on the osc2 pin.

Here is the end of my list file:
Configuration Fuses:
Word 1: 2600 H4 NOOSCSEN

So it would appear that the compiler is getting the first configuration word correct although I can't see where it actually lists the "programming" of it in the list file!

To answer your questions, both chips were "new" from Farnell in the UK, one was a 40pin PDIP (development) the other a 44pin PLCC (production).

I’ve now placed a 100Ohm resistor in the OSC2 line and low and behold the PLL appears to have kicked in and she is running at 40MHz!

Scoping the OSC2 pin and the sine wave looks just like before!

I’ve looked at the resonators datasheet (CSTCC) and nothing is mentioned about series resistors, is 100Ohm a sensible value?

You imply you shouldn’t run with an external clk frequency of 40MHz? I thought the 18F422 can run DC to 40MHz external freq?

Thanks for your help guys.

Will

There is a seperate 'application note', about oscillator use on the processors. This mentions the possible need for series resistors. The problem appears to be that the PLL, 'clips' internally, at a level slightly below the normal input. Hence it is more sensitive to this overdrive than the input itself...
The chip is specified to 'run' to 40MHz, using either H4, or an external oscillator. However the maximum frequency specified for the internal oscillator, is 25Mhz. This is 'Fosc', in table 22.4 of the data sheet.
If you are using an external osciallator, it is fine, but you said a 'crystal'. Being 'new', does not give any idea of the actual age of the chip. Look at the date code on the chip. This is also vital information for which silicon revision the chips are, and which 'errata' sheets apply...

Best Wishes
Will Reeve



Joined: 30 Oct 2003
Posts: 209
Location: Norfolk, England

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

PostPosted: Tue Jul 20, 2004 7:39 am     Reply with quote

You are correct. My mistake. I was using an external crystal and over driving the internal osc circuit! Seemed to work OK.

On first inspection of the datasheet I read (or wanted to read!) 40MHz was ok as a Crystal, but that’s OK only as an external clock source!

I am amazed it worked, but it did!

Thanks for educating me. I learn something every time I read the forum!

Will
Ttelmah
Guest







PostPosted: Wed Jul 21, 2004 2:40 am     Reply with quote

Will Reeve wrote:
You are correct. My mistake. I was using an external crystal and over driving the internal osc circuit! Seemed to work OK.

On first inspection of the datasheet I read (or wanted to read!) 40MHz was ok as a Crystal, but that’s OK only as an external clock source!

I am amazed it worked, but it did!

Thanks for educating me. I learn something every time I read the forum!

Will

I think this well illustrates how much more 'annoying', the MicroChip data sheets have become, than their 'ancestors'. If you look at sheets for the early chips, they have features like tables showing the frequency for each oscillator option (and things like having the register addresses next to the names in the section of the sheet about particular registers). The current sheets have gone 'disparate', with the necessity to refer to the section on a particular feature, then look up the addresses or timings, in another part, without a clear cross reference....
It is a sad development, and one that has caught everyone dealing with the PIC processors at some time or another.
Glad it is working now.
Yes, 100R, os a reasonable value (usually perhaps 56R is a 'minimum', and 200R+, represents the point where the oscillator stops).

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