PIC18F452 Compile Problem


Closed Thread
Results 1 to 11 of 11
  1. #1
    Join Date
    Mar 2005
    Posts
    37

    Default PIC18F452 Compile Problem

    I am using PICBASIC PRO 2.43 and have been trying to modify the PIC18F452.inc file to allow compile without warning. I found a post by Bruce mentioning to remove the warning add w = -230 to the .inc file. I try to add the @ _CONFIG fuses to my source file but it does not allow me to compile. Can someone submit a simple sample with how to set the fuses for a PIC18F452?

    If I try to go ahead and progran the chip wth the warnings my programmer gives me the following

    Configuration fuses
    Actual: 00 21 0E 0F 00 01 81 00 0F C0 0F E0 0F 40
    Expected: FF F9 FE FF FF FF FB FF 0F C0 0F E0 0F 40

    and does not program the chip!

    Please help! Scott

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


    Did you find this post helpful? Yes | No

    Default

    Few things are missing in your post:
    1. Wich message you have?
    2. Are you using MPASM?
    3. Wich programmer?
    Steve

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

  3. #3
    Join Date
    Mar 2005
    Posts
    37


    Did you find this post helpful? Yes | No

    Default

    Seem to get everything to compile without warnings. I am using MPASM and the programmer I am using is the ICD-U40. I know I know!

  4. #4
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    In your programmer, do you have an option of reading actual configuration fuses and re-inserting it into the hex file?


    ----------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  5. #5
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hi Scott,

    MPASM doesn't like it when you have config fuse settings in your source code,
    and in the PBP device header file.

    To insert them in your source you need to comment them out in 18F452.inc.

    Open 18F452.INC in your PBP directory, comment these out, save it, then add
    config fuse options in your source.
    Code:
            LIST p = 18F452, r = dec, w = -311, w = -230, f = inhx32
            INCLUDE "P18F452.INC"   ; MPASM  Header
            ;__CONFIG    _CONFIG1H, _OSCS_OFF_1H & _XT_OSC_1H
            ;__CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H
            ;__CONFIG    _CONFIG4L, _LVP_OFF_4L
    Now you can drop them into your source;

    Code:
    asm
      __CONFIG    _CONFIG1H, _OSCS_OFF_1H & _XT_OSC_1H
      __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H
      __CONFIG    _CONFIG4L, _LVP_OFF_4L
    endasm
    I'm not familiar with the device programmer you're using, but make sure you
    always erase the target before trying to program it.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  6. #6
    Join Date
    Mar 2005
    Posts
    37


    Did you find this post helpful? Yes | No

    Unhappy

    Bruce,

    The ICD-U40 is the CCS USB Programmer!

    I have tried all that everyone suggested but it will not program the PIC18F452. It may be my version of PICBAsic Pro 2.43. I may rewrite the code with the CCS Compiler. I hate to start over since I have had everything working in PICBASIC Pro for the PIC16F877.

    Thanks anyway,

    Scott

  7. #7
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hi Scott,

    Bummer. Have you contacted CCS? I beleive they have firmware updates for
    their programmers. May or may not help, but I don't think there's any reason
    to port over from PBP to CCS if it's just a problem with the programmer.

    I know people get tired of hearing this one, but it's also a good idea to keep
    PBP & MPLAB updated as well.

    If it would help, I could send you a known working .hex file for a 452 compiled
    with PBP. If it doesn't go in, then at least you're 100% sure it's your device
    programmer, and CCS should be able to get you sorted out on that one.

    I like/use the CCS compilers, but I don't use their programmers. MeLabs U2 is
    all I use now. All my other programmers are gathering dust...;o}
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

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


    Did you find this post helpful? Yes | No

    Default

    Bruce, And i feel one of those is obsolete and no longer on the market

    His name begin with W and you already carry those in the past.
    Steve

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

  9. #9
    Join Date
    Mar 2005
    Posts
    37


    Did you find this post helpful? Yes | No

    Default

    Hi Bruce,

    I have been looking at upgrading but timing is an issue here! I would like to test your sample .hex file just to see if it works. I will test this tonight and let you know. At least I will hopefully know were the problem is!!!

    Thanks again,

    Scott

  10. #10
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hi Scott,

    No problem. Shoot me an email. I'll just respond with the .hex file in .zip
    format back to you.

    Let me know the osc frequency, and whatever config fuse settings you
    prefer.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  11. #11
    inteco's Avatar
    inteco Guest


    Did you find this post helpful? Yes | No

    Default

    Scott,

    Instead of using ICD-U software, try download and use MACH X software. But you need to use the newest ICDU software, and upgrade the firmware first prior of using the the new MACHX software.

    Downloading step :
    1. Open MACH X
    2. Browse /open the *.hex generated by PBP
    3. in the MACHX click CONFIGURATION/ID, then click on any
    configuration hex number located in the left side row.
    Do NOT change the number just click it, as if you want to change.
    4. Then click SAVE AS button, save the *.hex to a new name
    (whatever.hex)
    5. Then click BURN CHIP
    6. Trust this would work.

Similar Threads

  1. DT's instant interupts compile problem
    By comwarrior in forum General
    Replies: 4
    Last Post: - 18th October 2009, 19:30
  2. USB compile problem
    By keymuu in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 22nd September 2008, 16:39
  3. Problem to compile my program
    By wagner in forum Off Topic
    Replies: 5
    Last Post: - 7th July 2008, 20:17
  4. 18F452 compile problem
    By pcbb in forum General
    Replies: 1
    Last Post: - 21st April 2007, 02:16
  5. problem whit pic18f452
    By ocastrillo in forum General
    Replies: 3
    Last Post: - 9th March 2007, 16:18

Members who have read this thread : 1

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