'DEFINE OSC 8' seems to be ignored by PBP ?


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    Nov 2008
    Posts
    96


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Could you try those lines ???

    Code:
     
     
    @ Errorlevel -306
     
    '-----------------------
    ' PIC Defines
    ' ===========
     'Config bits 
     
    @    __CONFIG  _CONFIG1H, _IESO_OFF_1H & _FSCM_OFF_1H & _INTIO2_OSC_1H
    @    __CONFIG  _CONFIG2L, _PWRT_ON_2L & _BOR_ON_2L & _BORV_27_2L
    @    __CONFIG  _CONFIG2H, _WDT_ON_2H & _WDTPS_32K_2H
    @    __CONFIG  _CONFIG3H, _MCLRE_OFF_3H
    @    __CONFIG  _CONFIG4L, _DEBUG_OFF_4L & _LVP_OFF_4L & _STVR_OFF_4L
    @    __CONFIG  _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L
    @    __CONFIG  _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H
    @    __CONFIG  _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L
    @    __CONFIG  _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H
    @    __CONFIG  _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L
    @    __CONFIG  _CONFIG7H, _EBTRB_OFF_7H    
     
    '    Include "modedefs.bas"          ' Include serial modes
    '   DEFINE OSC 8 '8Mhz clock used. Note - Set PIC config fuses on programmer to use Internal RC OSC
    ' Define some constants if needed
     
     ....
    ....
     
     
    ' Initialise Processor - check for each PIC type 
    ' --------------------
        ADCON1 = %11111111              'Turn off all AD's     
        OSCCON =  %01100111     'set INTRC to 4 MHZ    <<<  I Think the error was here : define directly bits without ANY ORing ...
    '    OSCCON = %01110111     'set INTRC to 8 MHZ
    '    OSCTUNE = 0                      'OSC trim set to Null
    and comment your configs ... ( I cut and pasted from an old 1320 program of mine ... as you see I never believe in defaults !!! )

    your OSCCON settings ... mmmhhhh, how to say, ... I do not like them !!!!

    Alain
    OK, we have success.

    Your @ _Config text compiles with no errors. I also confirmed that my code slowed down as expected if there was a mismatch of DEFINE and OSC settings... All good.

    Your OSCCON works too, but so does mine. Interesting, I read in another forum that the OR'd method was good because it allowed the other bits to not be altered. Maybe I misinterpreted when or why this was good.

    So, anybody understand why the preferred Microchip config method gave me an error ?

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mr.sneezy View Post
    So, anybody understand why the preferred Microchip config method gave me an error ?
    Like I was telling a friend of mine called ..." Skimask " ... ( coughing sounds around ??? Why ??? )

    "As a pilot, you know it works well and will not try to see if other ways could have been working ...

    may be it is just a very little thing ... but I want to have an in-deep look before telling anything ...

    BTW: do you have any link to this " new config way " ???

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    Join Date
    Nov 2008
    Posts
    96


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    BTW: do you have any link to this " new config way " ???

    Alain
    Alain, I just read the detailed comments right out of the bottom of the 18F1220.INC out of my late installation of MPASM. It list's the config 'directives' for both methods, but says we should be using the new type syntax...

    Martin

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    So, anybody understand why the preferred Microchip config method gave me an error ?
    Nope, I do not understand it but there are lots of things I do not understand. I just know that the new way does not work well for me when I tried it a time or two so I figure why fight it. Use the way that has worked for years.

    Maybe it is something for a later version of MPASM?
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Hi, Dave

    Just found µChip writes :

    Code:
    @ CONFIG BOR = ON, PWRT = ON, BORV = 27
    With spaces around " = " sign ...

    too weak to give a decent conclusion...

    BTW ... I found a nice tool in the MPLAB Help ... Config values tables for the 18x series !!!
    but none for 10,12 and 16 Series

    Alain
    Last edited by Acetronics2; - 25th May 2010 at 14:50.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Thanks Alain.
    I will give it a try later. But as you mentioned to our masked friend.
    If it is not broke do not try fixing it.

    Looks like a cleaner way though...
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    The new style config directives can't be inserted directly into your code. These only
    work when in the default PBP device include files.

    See post #3 in this thread; http://www.picbasic.co.uk/forum/showthread.php?t=9145&
    Regards,

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

  8. #8
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Hi, Bruce,

    Thanks for the tip ...

    [Humour ON]

    So, If I understand it well ...

    When we want non-defaults Configs through PbP, we have to comment the .inc relevant lines ...

    And if we want to use the new configs with PbP, we have to re-install them into those .inc files ...

    Did I get It correctly ???

    [Humour OFF]

    Regards
    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  9. #9
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Thanks Bruce!
    I like the configs in code space so it looks like the old way is the way for now.
    Dave
    Always wear safety glasses while programming.

  10. #10
    Join Date
    Nov 2008
    Posts
    96


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Thanks Bruce!
    I like the configs in code space so it looks like the old way is the way for now.
    FWIW I like it in my code space too, I miss enough stuff now without hiding more info in INCs. So I guess it's the _config method for a while longer :-)
    Martin

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