Oscillator Configs?
<br>
Just the default that came with PBP:
i'm new to 18Fxxxx chips. I'm not overly familiar with these configs.Code:__CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L __CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H __CONFIG _CONFIG3H, _PBADEN_OFF_3H __CONFIG _CONFIG4L, _LVP_OFF_4L & _ICPRT_OFF_4L & _XINST_OFF_4L
Is there 2 different clocks at different speeds for the 4550? In mister_e's USB Demo program, the OSC is defined as 48, but a 4Mhz oscillator is used.
That would work for 20Mhz.
For 4Mhz try _PLLDIV_1_1L inplace of _PLLDIV_5_1L
<br>
DT
Thanks. Works like a charm.
Im trying to familiarize myself with the CONFIG settings now.
Dos you have any insight on the 2 different oscillator settings? I.e. "DEFINE OSC 48" in the code, and defining 4Mhz in CONFIG.
The 2550/4550 etc type chips have a really nice PLL in the oscillator stage.
The PLL always ends up running at 96 Mhz, and to do so, it needs a reference of 4mhz. So if you're using a 20Mhz crystal, it has to be divided by 5 with the prescaler to get back down to 4Mhz. That's the _PLLDIV_?_1L
Then once you have the 4 Mhz reference, the PLL will run at 96 Mhz.Code:Crystal 4 - _PLLDIV_1_1L 8 - _PLLDIV_2_1L 12 - _PLLDIV_3_1L 16 - _PLLDIV_4_1L 20 - _PLLDIV_5_1L 24 - _PLLDIV_6_1L External Oscillator 40 - _PLLDIV_10_1L 48 - _PLLDIV_12_1L
A postscaler can divide that by 2 to give 48 Mhz to the USB. _USBDIV_2_1L
And a seperate postscaler can give the CPU 48, 32, 24 or 16 Mhz depending on the _CPUDIV_OSC1_PLL2_1L config setting.
In effect, you can get any of these frequencies, no matter which one of the (multiple of 4Mhz) crystal you use.
You can have a 4Mhz crystal supplying 48Mhz to the USB and 16 Mhz to the CPU, or both USB and CPU at 48Mhz.
Clear as Mud, right.
<br>
DT
Bookmarks