18F458 and 20MHz osc problem...


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    batee's Avatar
    batee Guest

    Unhappy 18F458 and 20MHz osc problem...

    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]
    Last edited by batee; - 16th October 2004 at 19:45.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    THat's fast blink led !!!
    Did you try programming with HS as oscillator mode in MPLAB??
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    batee's Avatar
    batee Guest


    Did you find this post helpful? Yes | No

    Default

    Yeah, I tried the HS mode. Does the same thing (nothing).

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

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    "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??
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    batee's Avatar
    batee Guest


    Did you find this post helpful? Yes | No

    Default

    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

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    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
    Last edited by mister_e; - 16th October 2004 at 20:31.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts