hi Klaus,
What exactly do you mean by "set oscillator to XT"?
wich kind of programmer do you use :PICSTART, EPIC or else ?
When you compile your code with PBP, here are the default osc setting you'll find the the pic18F452.inc file
__CONFIG _CONFIG1H, _OSCS_OFF_1H & _XT_OSC_1H
These mean that you'll use XT oscillator (4mhz in your case) and you disable the oscillator switching mode (don't care for your app now)
BUT i heard that some PIC programmer don't refresh those setting when you use the .HEX file for programming you PIC. So they will use their own default.. sometime RC-OSC as RA6. In this case you have chance if anything is working.
In your programmer program you must have some place to set the "configuration bit" or "configuration fuse". Be sure to have XT OSC as oscillator setting. If anything is properly set, it will work.
Case not try another program like simple Blink, keep Pull-up enable on PORTB, remove any interrupt stuff and do the blink while your push button is hold. that way you'll know that everything is working.
Code:
TRISB=%11110111
LED VAR PORTB.3
start:
while PORTB.0=0
toggle LED
pause 500
wend
goto start
Be sure MCLR pin is set to 5Volt with pull-up resistors. And the last one be sure that you have capacitor (10-22pf) on each pin of your crystal to the ground.
i can't say more than this
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks