PDA

View Full Version : Help with HS in sample programms



sirnoname
- 20th June 2006, 18:10
Hi,

I got really big problem to find out which config bits are needed
for the USB18 demo's in the PBP directory. (oszillator)
I use a 20MHz quarz as used in the LABXU board and want to
run the mousedemo.bas program. But also in the sample HEX files
of the LABX board, the config words are not transfered through the
HEX file :(
Please someone can tell me his working config word ?
Or perhaps what for a combination used ?
HS / HS PLL / USB? etc.
I cannot figure it out :(
Is it right to use this line:
Define OSC 48
or should it be 20 ? internal 96MHz ?

regards,
sirnoname

Bruce
- 20th June 2006, 22:59
These are the defaults I use on most all USB projects. 18F4550 target with a
20MHz primary crystal osc.


CONFIG PLLDIV=5,CPUDIV=OSC1_PLL2,USBDIV=2,FOSC=HSPLL_HS,F CMEM=OFF,IESO=OFF
CONFIG VREGEN=ON,CCP2MX=ON,WDT=OFF,WDTPS=32768,PBADEN=OFF ,PWRT=OFF,MCLRE=ON
CONFIG LPT1OSC=OFF,BOR=ON,BORV=2,STVREN=ON,LVP=OFF,ICPRT= OFF,XINST=OFF,DEBUG=OFF
CONFIG WRTB=ON

You would use Define OSC 48 since the CPU core is running at 48MHz.