Nikos,
If you haven't already, it's best to comment out the default oscillator settings in the 18F4550.inc file in the PBP folder, I'm sure you've done that before with other PIC's ...
Then you can set the options in your main program.
Here's a possibility for blinking an LED on PORTA.1 with a 4550 using the Internal Oscillator @4Mhz and your original code ...
Code:
'18F4550 with Int OSC Blinky
@ __CONFIG _CONFIG1H, _FOSC_INTOSC_XT_1H
DEFINE OSC 4 ; CPU runs @ 4 Mhz
OSCCON = %01100010 ; 4 Mhz Internal Oscillator
;DEFINE OSC 8 ; CPU runs @ 8 Mhz
;OSCCON = %01110010 ; 8 Mhz Internal Oscillator
ADCON1 = $0F ; Disable Analog inputs
loop:
High PORTA.1 'Turn on LED
Pause 500 ' Delay for .5 seconds
Low PORTA.1 'Turn off LED
Pause 500 ' Delay for .5 seconds
Goto loop ' Go back to loop and blink LED forever
End
Keep in mind that the internal oscillator can't drive the USB module. But you can add a crystal to drive the USB and still run the CPU on Internal. Your choice.
HTH,
Bookmarks