DATA command and a 16f628


Closed Thread
Results 1 to 6 of 6
  1. #1
    yourmomOS's Avatar
    yourmomOS Guest

    Unhappy DATA command and a 16f628

    Hello all, I need some help if you could. I am trying to write data to the internal EEPROM of a 16f628. I have several stings that I will call later in the actual program but I can not seem to get past the DATA @127 mark in the eeprom. I keep getting an error that says ERROR DATA.ASM 161:[218] Address limit of blablabla exceeded. If a single character in a string is one byte, when I add up all the bytes of all the strings, I should not be approaching the limit of the eerom. Here is the code.


    UNITID DATA @0, 1 'UNIT ID SPACE
    'EEPROMCONTROLAD DATA WORD @2, 'THIS HOLDS EXTERNAL EEPROM BOOKMARK
    GPSCOM9600 DATA @10, "$PSRF100,1,9600,8,1,0*0D " 'SET GPS UNIT TO 9600BPS
    GPSCOM19200 DATA @35, "$PSRF100,1,19200,8,1,0*38" 'SET GPSUNIT TO 19200BPS
    GPSDISCGA DATA @60, "$PSRF103,00,00,00,01*24 " 'TURN OFF CGA MESSAGES
    GPSDISGLL DATA @85, "$PSRF103,01,00,00,01*25 " 'TURN OFF GLL MESSAGES
    GPSDISGSA DATA @110, "$PSRF103,02,00,00,01*26 " 'TURN OFF GSA MESSAGES
    GPSDISGSV DATA @135, "$PSRF103,03,00,00,01*27 " 'TURN OFF GSV MESSAGES
    GPSDISRMC DATA @160, "$PSRF103,04,00,00,01*20 " 'TURN OFF RMC MESSAGES
    GPSDISVTG DATA @185, "$PSRF103,05,00,00,01*21 " 'TURN OFF VTG MESSAGES

    It dies on the @110 one. If I comment that one and all after it out, it will compile without the error. I know that one crosses some kind of 128byte barrier, but it doesnt work if I start it at say...@150 either. Any help would be greatly appreciated.

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hi mom,

    The 16F628 only has 128 bytes of EEPROM, so all that stuff won't fit.

    Since these appear to be "Fixed" commands that never change, EEPROM may not be the best place for them anyhow.

    If you are trying to put them in EEPROM in order to save program space, you may want to check out this thread...

    Embedded Strings in your Code Space
    http://www.picbasic.co.uk/forum/showthread.php?t=1999
    <br>
    DT

  3. #3
    Join Date
    Feb 2006
    Posts
    5


    Did you find this post helpful? Yes | No

    Default

    I tried to compile strings.pbp and strings-16.pbp using pbp 2.45, Microcode studio 2.3.0.0 and MPASM from mplab ide v 7.3.1. It errors to :

    Error[113] c:\pbc\pbcpic14.lib 428 : Symbol not previously defined (EEADRH)

    I'm stuck!! Please Advise

  4. #4
    Join Date
    Feb 2006
    Posts
    5


    Did you find this post helpful? Yes | No

    Default

    Forgot to state that that occurs with a 16f628A.

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hi Richard,

    Good Point!

    Using that technique requires that the PIC is able to read from it's own Flash memory. &nbsp; Which the 16F628(A) can't do.


    yourmomOS,

    Please disregard that last post. Well, except for the "It won't fit" part.
    <br>
    DT

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


    Did you find this post helpful? Yes | No

    Default

    So you still have 2 choices
    1. Change Your PIC to and have one that can read from it's own Flash mem to fit your Strings
    2. Keep the same PIC BUT Save your String to an external EEPROM.
    Steve

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

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