PBP is driving me crazy trying to make an 18F chip blink


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2005
    Location
    New Zealand
    Posts
    171

    Default PBP is driving me crazy trying to make an 18F chip blink

    I'm normally a calm collected person - but I'm about ready to throw my computer and all associated components out the window.

    I've spent around 10 hours so far trying to make an LED on an 18F8722 blink

    I was running PBP2.42 and just bought the upgrade to PBP2.50, I know I might be a little unrealistic in my expectations but I feel strongly that when you pay good money for software it should just work, you shouldn't have to mess around with the operating files - it should just work!

    I whittled away at my old INC and BAS files till eventually I got no errors - you know doing the old subtitute __CONFIG for CONFIG, changing labels and so forth - I got it programmed but LED no flash.

    At that point I bought the upgrade - but the new version came up with more problems and errors than the old one. Why won't it work?????

    I get errors like : address exceeds max range for this processor
    overwriting previous address contents
    missing "=" in parameter

    I'm genuinely about to start looking at other compilers if I can't get this problem nutted soon, It's just proving to be a total waste of my time and money. Common guys at MELabs - just make it work is all that I ask.

    Here's my code that seems to be taxing it so much

    @ CONFIG OSC=HS
    ' Use HS oscillator (10MHZ)

    TRISB = 0
    TRISH = 0
    porth = 0

    Start:
    porth.0 = 1
    pause 500
    porth.0 = 0
    pause 1000
    goto start

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


    Did you find this post helpful? Yes | No

    Default

    First thought. Being that you want to set the fuses in the code, have you commented out the code in the *.inc file?

    "overwriting previous address contents"

    Indicates you have not.

    And you have and use the latest MPASM?

    Hang in there. It will work.

    And you may want to look at this if you have not already.
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    Last edited by mackrackit; - 20th June 2008 at 02:18. Reason: Add link
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Oct 2005
    Location
    New Zealand
    Posts
    171


    Did you find this post helpful? Yes | No

    Default

    OK, yeah I've been reading that thread over and over, I got rid of the osc=hs define in the code and that got rid of most of my errors thanks, So if you want to define something that's listed in the INC you have to REM it out in the INC file?

    My issue now is the errors listed are missing "=" in parameter...

    the inc file is written like this: CONFIG _CONFIG1H, _OSC_HS_1H

    do I change it to read? CONFIG OSC=HS

    If so, why? Why hasn't this been done for me? This was brought up three years ago in the post that you mention, I've bought the latest version of PBP and downloaded the latest MPASM (v5.2) This is my first time using MPASM and the 18F chip, so may not really know wot I'm doing - but surely it shouldn't be this hard

    Thanks for your input

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by George View Post
    OK, yeah I've been reading that thread over and over, I got rid of the osc=hs define in the code and that got rid of most of my errors thanks, So if you want to define something that's listed in the INC you have to REM it out in the INC file?

    My issue now is the errors listed are missing "=" in parameter...

    the inc file is written like this: CONFIG _CONFIG1H, _OSC_HS_1H

    do I change it to read? CONFIG OSC=HS

    If so, why? Why hasn't this been done for me? This was brought up three years ago in the post that you mention, I've bought the latest version of PBP and downloaded the latest MPASM (v5.2) This is my first time using MPASM and the 18F chip, so may not really know wot I'm doing - but surely it shouldn't be this hard

    Thanks for your input
    Hi George,
    My first try with an 18F actually 18F4550, I copied one of my other programs to try it out.
    Configs are pretty much assembly, PBP whisks right past and MPASM chokes on them, EDIT: Mackrackit has the skinny on the settings below, Found in P18f8722.inc file in MPASM Suite directory.
    Last edited by Archangel; - 20th June 2008 at 05:23.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

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


    Did you find this post helpful? Yes | No

    Default

    I normally set the configs in the *.inc, just a personal pref I guess.

    I do not have a 8722 so I can not test it, But this compiles.
    Code:
    DEFINE	OSC  10
    
    TRISB = 0
    TRISH = 0
    porth = 0
    
    Start:
    porth.0 = 1
    pause 500
    porth.0 = 0
    pause 1000
    goto start
    And this is the *.inc
    Code:
    LIST p = 18F8722, r = dec, w = -311, w = -230, f = inhx32
            INCLUDE "P18F8722.INC"	; MPASM  Header
            __CONFIG    _CONFIG1H, _OSC_HS_1H
            __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
            __CONFIG    _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
            NOLIST
    And yes, if you set the fuses in code space, the *.inc needs to be REMed.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Oct 2005
    Location
    New Zealand
    Posts
    171


    Did you find this post helpful? Yes | No

    Default

    Hey guys, finally got it going thanks for your input - changed the INC files and it works well - interesting that MPASM gets choked on the configs here's wot I changed it to finally

    NOLIST
    ifdef PM_USED
    LIST
    "Error: PM does not support this device. Use MPASM."
    NOLIST
    else
    LIST
    LIST p = 18F8722, r = dec, w = -311, w = -230, f = inhx32
    INCLUDE "P18F8722.INC" ; MPASM Header
    CONFIG OSC=HS
    CONFIG WDT=ON, WDTPS=512
    CONFIG MCLRE=ON
    CONFIG LVP=ON, XINST=OFF
    NOLIST
    endif
    LIST
    EEPROM_START EQU 0F00000h
    BLOCK_SIZE EQU 64

Similar Threads

  1. 18f series chip locked up
    By glkosec in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 11th August 2009, 07:27
  2. Newby- PBP wont compile for 18F (MPLAB)
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th December 2005, 23:30
  3. Make your own I2C Chip
    By NL2TTL in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 11th August 2005, 17:29
  4. Why use an 18F chip
    By AndyP in forum General
    Replies: 3
    Last Post: - 16th August 2004, 16:38

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