18F8722 sample code


Closed Thread
Results 1 to 9 of 9

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Thanks, but I've not even got that far yet, I cant' get it compiling, I'm using MPASM5.20 through MicroCode but i'm getting errors like...

    Warning[230] c:\progr~\pbp2.42\18F8722.inc 20 : _Config has been depreciated for PIC18 devices use directive Config
    Error[113] c:\progr~\pbp2.42\18F8722.inc 20 : Symbol not previously defined (_OSCS_OFF_1H)
    Error[113] c:\progr~\pbp2.42\18F8722.inc 20 : Symbol not previously defined (_XT_OSC_1H)

    etc...

    One thing I forgot to mention is I didn't have the 18F8722.inc and bas files in my pbp2.42 version, i think DT said I could rename the 18F8720.inc and bas files, I did it in notepad and changed any internal ref to the 8720 to the 8722 and saved it accordingly. I've never used MPASM before so not even sure if that's working correctly.

    Do I have to go in and do more mods to my INC file? Here's how it reads currently

    NOLIST
    ifdef PM_USED
    LIST
    "Error: PM does not support this device. Use MPASM."
    NOLIST
    else
    LIST
    LIST p = 18F8722, r = dec, w = -302, f = inhx32
    INCLUDE "P18F8722.INC" ; MPASM Header
    __CONFIG _CONFIG1H, _OSCS_OFF_1H & _XT_OSC_1H
    __CONFIG _CONFIG2L, _BOR_ON_2L & _BORV_20_2L & _PWRT_ON_2L
    __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H
    __CONFIG _CONFIG3H, _CCP2MX_ON_3H
    __CONFIG _CONFIG4L, _STVR_ON_4L & _LVP_OFF_4L & _DEBUG_OFF_4L
    NOLIST
    endif
    LIST
    EEPROM_START EQU 0F00000h
    BLOCK_SIZE EQU 8



    Tho it seems the configs are diff from pbp to mpasm so that's why it's having trouble?

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Thumbs down

    The upgrade is only $25 ya know...
    Config - do a search on presetting the config registers.
    Other than that, just pretend it's an 18F8720, if your programmer will let you.

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


    Did you find this post helpful? Yes | No

    Default

    Yah, I know the upgrade is only $25, and if needs be I'll end up getting it. I only use PBP from time to time, if it were a full time effort then I'd deff upgrade when new releases come out. However have found if I change lines like:
    __CONFIG _CONFIG1H, _OSCS_OFF_1H & _XT_OSC_1H

    in my INC files to

    CONFIG _CONFIG1H, _OSCS_OFF_1H & _XT_OSC_1H

    As it was sortof telling me in the errors then those particular errors disappear which is good - however these errors are now superceeded by others which is not so good.

    Error[176] : CONFIG Directive error: (missing "=" in parameter "_CONFIG1H")

    So I suppose I've been making progress but I've now tried to place a = sign in the config1h line copying the inc file from MPASM but no joy - any ideas?

    Thanks

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Yep, read:
    http://www.picbasic.co.uk/forum/show...=preset+config
    It's got all the good info in it for doing up the config fuses.

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


    Did you find this post helpful? Yes | No

    Default

    Thanks, I was reading through that. Still can't make anything work tho, the whole missing "=" thing has got me confused. I've tried replacing statements like _OSC_HS_1H with ones like OSC = XT which are found in the INC file of MPASM but still it keeps saying "=" is missing (config directive error)

    Anyone have any ideas on how to rewrite these? (just one will do I'm sure I could figure the rest if given an example)


    CONFIG _CONFIG1H, _OSCS_OFF_1H & _XT_OSC_1H
    CONFIG _CONFIG2L, _BOR_ON_2L & _BORV_20_2L & _PWRT_ON_2L
    CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H
    CONFIG _CONFIG3H, _CCP2MX_ON_3H
    CONFIG _CONFIG4L, _STVR_ON_4L & _LVP_OFF_4L & _DEBUG_OFF_4L

Similar Threads

  1. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 21:07
  2. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  3. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  4. MN1307 sample code problem
    By ngeronikolos in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 20th November 2008, 20:41
  5. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26

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