PDA

View Full Version : How to configure the clock??!!



sergio.elias
- 16th June 2006, 06:51
Hi there. I feel silly asking this but... ahhh what the.. here it goes
I´ve used PIC18F4550 with PIC Basic Pro a year ago and everything worked fine with serial communication. Now I´m working on a project using the same PIC with a peripheral device attached to the MCU serial port. The baudrate used will be 115200 and a 40 Mhz crystal in order to have the least error possile. It has been working fine with the internal oscillator but it can't give me 40 MHz. I´m having so many trouble configuring this crystal. Can anybody tell me the programming steps to get this crystal working properly, maybe I´m forgetting some register. I remember that the last time I had to modify a PBP .inc file but i cant find this. Can somebody help me??... thank you

Bruce
- 20th June 2006, 01:43
More information would be helpful.

Are you trying to run the CPU core at 40MHz, and clock the USB module from
the same oscillator?

Or are you not using the USB module, and just trying to configure the PIC to
run on your 40MHz crystal?

Is this a 40MHz crystal (I.E. one requiring parallel caps) or is it a 40MHz TTL
clock oscillator?

sergio.elias
- 21st June 2006, 03:59
Hi Bruce... I´m not using the USB module. I want to run the CPU core at 40 MHz..... my crystal is a 40 MHz parallel cut (it requires capacitors).... and doesn´t work on HS mode... I dont know what to do... I´ve tried so many different configurations...

Bruce
- 21st June 2006, 05:48
Hi Sergio,

Above 25MHz, you'll need a TTL type clock oscillator. HS and HSPLL support
up to 25MHz primary osc.

Make sure you have the latest verion of the 4550 data sheet rev DS39632C
and look in the electrical characteristics section at table 28-8, parameter 1A.

With a 40MHz TTL type clock oscillator, and EC or ECIO oscillator modes, it
should work fine.

With this config you should still have full-speed USB, 40MHz CPU clock, and
have port function on RA6.

CONFIG PLLDIV=10,CPUDIV=OSC1_PLL2,USBDIV=2,FOSC=ECIO_EC