Cannot compile for 40MHz 4 x pll


Closed Thread
Results 1 to 9 of 9
  1. #1
    Join Date
    May 2007
    Posts
    66

    Default Cannot compile for 40MHz 4 x pll

    I have a PIC18F2320 and PIC18F242 and would like to run either one @ 40MHz with 4 x pll using a 10MHz crystal.

    I cannot get my PBP program to compile.
    I am using:
    MicroCode Studio Plus V3.0.0.0.
    PicBasic Pro 2.47
    Asembler = MPASM


    The first two lines of my pbp program is:

    @ __CONFIG _CONFIG1H, _OSCS_OFF_1H & _HSPLL_OSC_1H
    ' Oscillator switch OFF
    ' Use HSPLL (fosc X 4) oscillator (10mhz)

    DEFINE OSC 40


    If I try to compile my program for the PIC18F2320, I get the following error message:

    'Symbol not previously define (_OSCS_OFF_1H)'

    If I try to compile my program for the PIC18F242, I get the following error message:

    'Overwriting previous address contents'


    I noticed that the .inc file for the 18f2320 differs from the .inc file for the 18f242 as follow:

    18f2320: __CONFIG _CONFIG1H, _XT_OSC_1H
    18f242 : __CONFIG _CONFIG1H, _OSCS_OFF_1H & _XT_OSC_1H

    I also tried to change the inc file for the 18f2320 to

    __CONFIG _CONFIG1H, _OSCS_OFF_1H & _XT_OSC_1H

    but then I get one additional compiler error for the 18f2320.inc file:

    Symbol not previously defined (_OSCS_OFF_1H)


    Please help!!
    Thank you.

  2. #2
    Join Date
    May 2007
    Posts
    66


    Did you find this post helpful? Yes | No

    Default

    I'm using MPASM v5.03

    Any help is appreciated!

  3. #3
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Thumbs down

    It's a non-stopping-mess with this CONFIGs...

    1. For the 18F-Devices you must use MPASM.
    2. The 18F2320.INC-file in PBP looks nice - but is useless IMHO. The many fuses which can be used are ignored, but if you use your own __CONFIGs, you get an error (overwriting ...).
    3. There are many similar threads and Mel has written the answer...
    4. For me - I comment the CONFIG-lines inside the PBP-inc-files and write my own __CONFIG-directives in my code ... the hole xx bytes long. What to write is hidden in the P18F2320.INC-file inside MPASM ! (the last part of the file).
    5. Using this, you will get a warning out of MPASM to use the new CONFIG-directive.
    6. Using this, you will get further errors, because MPASM is not compatible to the writing inside its own INC-files!
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

  4. #4
    Join Date
    May 2007
    Posts
    66


    Did you find this post helpful? Yes | No

    Default

    BigWumpus

    Thank you for your reply.
    I have searched this forum and looked at the other threads in this regard before I posted my question, and the code I am using is the code suggested by Mel?
    I must be missing something because I cannot figure out the fix from those other threads.
    Please excuse my ignorance but I do not fully understand what you are suggesting.
    Are you saying there is no solution to the problem? (refer point 5 and 6)
    Thank you for taking the time to help me!

  5. #5
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Wink

    Go inside your 18F2320.INC inside the PBP-directory.
    Comment out all CONFIG__-lines by a ";".
    Look inside the P18F2320.INC-file in your MPASM-directory and get the possible settings.

    f.e.:

    @ __CONFIG _CONFIG1H, _HSPLL_OSC_1H
    ...
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

  6. #6
    Join Date
    May 2007
    Posts
    66


    Did you find this post helpful? Yes | No

    Default

    BigWumpus

    Thank you!
    I did what you suggested and using the following setting for the PIC 18F2320, my pbp program compiles!

    @ __CONFIG _CONFIG1H, _HSPLL_OSC_1H

    However, now my pic18f2320 resets continuously?
    This is the first time I am using a pic18f.
    Up to now I have been using a pic16f73 without any problems.
    I have used the same circuit which worked fine for my pic16f73 (similar to the one on page 9 of the pbp manual, showing the basic setup).
    Does anyone know of any specific issues that one should be aware of when changing from pic16f to a pic18f. Should my circuit be modified in any way? (both the pic16f73 and pic18f2320 is 28 pin pics with an almost identical pin layout)
    Can it be that the pic 18f is more sensitive to voltage changes?
    Last edited by passion1; - 21st October 2007 at 14:05.

  7. #7
    Join Date
    May 2007
    Posts
    66


    Did you find this post helpful? Yes | No

    Default

    Trying to track the reason for the continuous reset I display the values for
    Power-on-reset (POR), Brown-out reset (BOR) , stack full reset (STKFUL) and stack underflow reset (STKUNF) bits, but all are showing to be zero after each reset, so that does not seem to be the problem?

  8. #8
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Exclamation

    Quote Originally Posted by passion1 View Post
    Trying to track the reason for the continuous reset I display the values for
    Power-on-reset (POR), Brown-out reset (BOR) , stack full reset (STKFUL) and stack underflow reset (STKUNF) bits, but all are showing to be zero after each reset, so that does not seem to be the problem?
    WDT ?

    Missing Loop ?


    You have to write down all the CONFIG-Lines for all Config-registers !
    You have to read the other lines inside the files too !
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

  9. #9
    Join Date
    May 2007
    Posts
    66


    Did you find this post helpful? Yes | No

    Default

    BigWumpus

    Thank you for the advice!
    Everything is working now!!

Similar Threads

  1. 4 pin 4 x 4 keypad interface using pic basic pro
    By dunlao_john in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th January 2009, 05:21
  2. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  3. 4 by 4 kepads routine
    By vladimir059@hot in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 3rd March 2007, 22:19
  4. Real Time Clock & Eeprom
    By smart_storm in forum General
    Replies: 8
    Last Post: - 17th February 2006, 19:03
  5. having problems with Hantronix 20x4 lcd
    By Rhatidbwoy in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 22nd December 2005, 12:22

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