Log in

View Full Version : DATA command and a 16f628



yourmomOS
- 23rd March 2006, 23:51
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.

Darrel Taylor
- 24th March 2006, 00:21
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>

RichardC
- 24th March 2006, 01:14
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

RichardC
- 24th March 2006, 01:16
Forgot to state that that occurs with a 16f628A.

Darrel Taylor
- 24th March 2006, 01:41
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>

mister_e
- 24th March 2006, 13:54
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.