PDA

View Full Version : 18F458 and 20MHz osc problem...



batee
- 16th October 2004, 19:39
Got a problem with an 18F458 and an oscillator higher than 4MHz. Using a PICDEM 2+ protoboard.

Typical blinky LED program:

DEFINE OSC 20
LED VAR PORTB.1
main: HIGH LED
PAUSE 100
LOW LED
PAUSE 100
GOTO main

Works for a 16F877 and a 20MHz osc. Works fine with a 4MHz osc and 18F458, doesn't work with anything higher (including the defined 20MHz).

Using PBPv2.45 and MPLAB v6.5.

Compiling calls PBPW with this line:
Executing: "C:\PIC\PBP\PBPW.EXE" -p18F458 -ampasmwin -oq -c -z -v "test.bas"

I've tried other "Configuration Bits" in MPLAB, but I can't seem to make them stick. Do these do anything for PBP?

Thanks,

Bryan A. Thompson
[email protected]

mister_e
- 16th October 2004, 19:43
THat's fast blink led !!!
Did you try programming with HS as oscillator mode in MPLAB??

batee
- 16th October 2004, 19:48
Yeah, I tried the HS mode. Does the same thing (nothing).

I noticed that HS mode changes back to XT when I compile.

mister_e
- 16th October 2004, 19:55
"I noticed that HS mode changes back to XT when I compile."
Of course because XT is the default value if there's no DEFINE OSC_HS included. But what about if you set HS mode when programming ???

which programmer do you use??

batee
- 16th October 2004, 20:02
OK, got it to work.

Have to change Config Bits to HS after compiing and before programming. Every single time I program, it seems, because compiling changes it back to XT mode.

Is there anything I can change about MPLAB so this doesn't happen?

Bryan

mister_e
- 16th October 2004, 20:16
add this line in your program header

@ DEVICE HS_OSC

You must use PM.exe instead of MPASM to compile with this DEVICE line. But in this case i don't know if it will work. PM.exe may not handle this pic18FXXX.

let me know