View previous topic :: View next topic |
Author |
Message |
PICoHolic
Joined: 04 Jan 2005 Posts: 224
|
PIC18F2550 USB using internal OSC |
Posted: Tue Jan 29, 2008 4:47 am |
|
|
Hello,
What proper configuration bits settings in order to get the 18F2550 USB run using the internal 8MHz oscillator?
I'm using the following configuration:
Code: |
#FUSES NOWDT //No Watch Dog Timer
#FUSES WDT128 //Watch Dog Timer uses 1:128 Postscale
#FUSES INTHS // OSC!?!?!?!?!?!?
#FUSES PROTECT //Code protected from reads
#FUSES BROWNOUT //Reset when brownout detected
#FUSES BORV20 //Brownout reset at 2.0V
#FUSES PUT //Power Up Timer
#FUSES NOCPD //No EE protection
#FUSES NOSTVREN //Stack full/underflow will not cause reset
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOWRT //Program memory not write protected
#FUSES NOWRTD //Data EEPROM not write protected
#FUSES NOIESO //Internal External Switch Over mode disabled
#FUSES NOFCMEN //Fail-safe clock monitor disabled
#FUSES NOPBADEN //PORTB pins are configured as digital I/O on RESET
#FUSES NOWRTC //configuration not registers write protected
#FUSES NOWRTB //Boot block not write protected
#FUSES NOEBTR //Memory not protected from table reads
#FUSES NOEBTRB //Boot block not protected from table reads
#FUSES NOCPB //No Boot Block code protection
#FUSES MCLR //Master Clear pin enabled
#FUSES LPT1OSC //Timer1 configured for low-power operation
#FUSES NOXINST //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
#FUSES PLL2 //Divide By 2(8MHz oscillator input)
#FUSES CPUDIV1 //No System Clock Postscaler
#FUSES USBDIV //USB clock source comes from PLL divide by 2
#FUSES VREGEN //USB voltage regulator enabled
|
...and...
Code: |
setup_oscillator(OSC_8MHZ|OSC_TIMER1|OSC_31250|OSC_PLL_OFF);
|
|
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Tue Jan 29, 2008 7:55 am |
|
|
Forget it.
The internal oscillator, is several orders of magnitude too inacurate to be used for USB. This is why, if you look at the oscillator diagram, there is no route from the internal oscillator, to the USB circuitry. Hence no fuse pattern to make this work, and even if there was, it wouldn't be reliable.
The internal oscillator, is _only_ for use for the CPU. It can't run the USB.
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
PICoHolic
Joined: 04 Jan 2005 Posts: 224
|
|
Posted: Tue Jan 29, 2008 8:39 am |
|
|
Yes,
I have noticed that there is no route from the internal oscillator, to the USB circuitry. I'll use an external OSC
Thank you Ttelmah |
|
![](templates/subSilver/images/spacer.gif) |
|