Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC18 oscillator settings for usb

Status
Not open for further replies.

slogin5

Newbie level 5
Joined
Sep 27, 2009
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,333
PIC18 oscillator for usb

Hi,
From what I can understand to use USB in pic18 you need an external oscillator.
Now,can I run the PIC at 1 or 4 MHz while the usb runs at 48MHz?
I am asking because this mode isn't specified in the datasheet(attached).
Another question,I can't run the usb from the external and the pic from the inetnal,right?
Thanks.
 

manish12

Advanced Member level 3
Joined
Nov 21, 2006
Messages
982
Helped
66
Reputation
132
Reaction score
33
Trophy points
1,308
Activity points
6,114
Re: PIC18 oscillator for usb

4mhz /8 mhz is best for usb.
set the following for 48mhz from 8mhz

PLLDIV_2_1L >> set for 8mhz/reset for 4mhz
CPUDIV_OSC1_PLL2_1L
USBDIV_2_1L
FOSC_HSPLL_HS_1H
FCMEM_OFF_1H
IESO_OFF_1H
PWRT_ON_2L
BOR_ON_2L
BORV_43_2L
VREGEN_ON_2L
WDT_OFF_2H
WDTPS_256_2H
MCLRE_ON_3H
LPT1OSC_OFF_3H
PBADEN_OFF_3H
CCP2MX_ON_3H
STVREN_ON_4L
LVP_OFF_4L
ICPRT_OFF_4L
XINST_OFF_4L
DEBUG_OFF_4L
 

slogin5

Newbie level 5
Joined
Sep 27, 2009
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,333
Re: PIC18 oscillator for usb

Thanks,
But,if I am not mistaken this sets the pic operating clock to 48MHz.
Will I encounter any problems if I set the usb to 48MHz like here,and the pic to 2MHz(to save power)?
Is there a way to get 1Mhz/48MHz(PIC/USB ratio)?
To get 2MHz/48MHz it easy to use a 4MHz oscillator.

Added after 2 hours 5 minutes:

Another question,I see that the ECPLL mode uses much less power than HSPLL,how can I use it?Where can I find such external clocks?
 

Slorn

Junior Member level 2
Joined
Oct 20, 2009
Messages
22
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,283
Location
Belgium
Activity points
1,412
Re: PIC18 oscillator for usb

Hi

I took a look in the 18F4550 datasheet. There is a table on page 31 an 32 that shows all possible oscillator configurations you can use with usb. There is one for a 1MHz CPU frequency (p32).

Slorn
--
Dwengo... gets you started with microcontrollers!
 

slogin5

Newbie level 5
Joined
Sep 27, 2009
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,333
Re: PIC18 oscillator for usb

Thank you for your help,
Unfortunately the pic18f87j50 is a bit different.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top