Jump to content

Helping me to store hudge data tables in PIC


Recommended Posts

Hello evreybody at ucapps,

I'm trying to program a software based on "midimon" for helping me to read parameters of an Evolver synth on a display.

For this I read the sysex message from the midi output that the instrument sends when an encoder is turned.

When I get the parameter value, I look in an indexed table to print a corresponding string. The problem is that I use

large tables and it seems that I get overflow message when compiling the prog.

One of my tables is made of 75 entries of 16 bytes strings:

mullw 16

TABLE_ADDR DEST_NAME_TABLE

movf PRODL, W

addwf TBLPTRL, F

movf PRODH, W

addwfc TBLPTRH, F

movlw 16 ; (16 chars)

goto MIOS_LCD_PrintPreconfString

DEST_NAME_TABLE

db "No destination "

db "OSC 1 Frequency"

db "OSC 2 Frequency"

db "OSC 3 Frequency"

db "OSC 4 Frequency"... and so on 75x

and when I compile I get this message:

./include/asm/macros.h:172:Error [126] Argument out of range (1133 not between -1024 and 1023)

Thinking this table was too long I splitted it into two tables of 38 entries each, but as I compile the program with only one table

I have not errors, and when I add the second one I get the same errors, it seems to me that I reached a memory limitation

of the PIC. Am I right?

I'm really a newbee in programming PIC in assembler, could someone give me a hint for overcoming this problem?

Is there a specifical allocation possible for this tables?

PS I use a PIC 18F452 and I don't use the Tracememory block of the original midimon.

thank you for your help,

Best Regards,

Alain

Link to comment
Share on other sites

Hello evreybody at ucapps,

Thank you to those who took the time to read my previous message.

I found out that my problem lied on the fact that I had my table between 2 labels of my JUMPTABLE and there were too many lines between the rgoto instruction and the labels and this generated this adressing error!

I just wrote my table at the end of my ".inc" file and everything is now ok.

; branch depending on PARAMETER NUMBER (0 à 127)

movf TMP1, W

andlw 0x7f

JUMPTABLE_2BYTES_UNSECURE

rgoto Para_typ_1

rgoto Para_typ_2

...

rgoto Para_typ_128

Para_typ_1

..x lines of code...

Para_typ_2

>>>> error [126] Argument out of range (1133 not between -1024 and 1023)

because GPASM doesn't find the flag...

Best Regards,

Alain

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...