SX/B PAGE Errors
Hi to everybody.
First of all i'll introduce myself. I'm Hector Garcia from Mexico(i appologize if i have a bad english), i do PC programming since almost 15 years.
I'm new to parallax programing; since I'm a VB programmer, SXB its being easy to me.
Now, i'm changing the code for a GPS Parallax Module, with a SX20 uC on it, using the open source provided from Parallax to the module.
My task is to add almost 150 fixed bytes in order to be sended at startup as
ASCII characters from the GPS module to another device connected to it, via the SIO pin.
I use SX Key IDE, SX/Blitz to program the chip, and the code is in SXB.
When i add those bytes - on DATA tables- plus the commands required to send the data,
and i call to assemble the code, i get an error regarding to the pagezise: "Adress exed memory limit" .
I now i made one of two situations: or i fullfilled the entire 2k memory of the uC, or i exeded the first PAGE with all the code on it.
Usually I do programming Microchip PIC's, and when i get those errors, i divide the code across page boundaries, using PAGESET command.
I read the faqs for SX Microcontroller, published on this forum by G
First of all i'll introduce myself. I'm Hector Garcia from Mexico(i appologize if i have a bad english), i do PC programming since almost 15 years.
I'm new to parallax programing; since I'm a VB programmer, SXB its being easy to me.
Now, i'm changing the code for a GPS Parallax Module, with a SX20 uC on it, using the open source provided from Parallax to the module.
My task is to add almost 150 fixed bytes in order to be sended at startup as
ASCII characters from the GPS module to another device connected to it, via the SIO pin.
I use SX Key IDE, SX/Blitz to program the chip, and the code is in SXB.
When i add those bytes - on DATA tables- plus the commands required to send the data,
and i call to assemble the code, i get an error regarding to the pagezise: "Adress exed memory limit" .
I now i made one of two situations: or i fullfilled the entire 2k memory of the uC, or i exeded the first PAGE with all the code on it.
Usually I do programming Microchip PIC's, and when i get those errors, i divide the code across page boundaries, using PAGESET command.
I read the faqs for SX Microcontroller, published on this forum by G
Comments
Comments and white space have no effect on program size.
Thanks for your answer.
Here is the code attached, my lines are all the DATAS after the Pgm_ID label. They're the ASCII commands required to set up a GPRS modem connection. (i've changed the server addres, and the Host IP addres ). My subroutines are between Get_Info and Get_Valid labels, plus a TX_STR routine (taked from SXB Reference Manual)
to replace the original TX_BYTE routine
In fact, there is a routine called WAIT_MS that i removed thinking that PAUSE would give me more space than.
After reading your post i changed all those PAUSE commands to WAIT_MS calls, and it worked!
The code is working, but i still have the Page trouble.
I wish to know if there is a sample code somewhere to understand the page boundaries.
And to know how much memory i am using.
Perhaps this comment is useless, on Microchip MPLAB IDE there is a window called "Program Memory"
wich allows to see the memory addreses used by program, and to determine the Page locations.
Is on parallax tools something similar?
Thanks, again
Regards
Hector
Like you, I'm a customer, so I don't know what Parallax is doing vis-a-vis improvements to the SX-Key IDE.
To use this subroutine your code would look like this:
Post Edited (JonnyMac) : 12/20/2007 5:50:25 AM GMT
Its true! i was letting more of the original code untouched, but, now that you tell me (and after another detailed reading to your N&B article), it seems that
the code itself needs to be optimized, keeping the original logic, of course.
I'm learning with every word i read. Now, i know that i have used almost all the space on the chip,
there aren't page boundaries troubles -like in PICS- to worry about and,
i should pay more attention to the readings of another articles, such your N&B, i see now that you did the same optimization regarding "GPRMC" string.
I'll follow your recommendations.
I did a tricky code meter, suggested on G
I followed your recommendations Jonn.
I made a routine, based on yours, to wait for a string specified on a DATA table;
after changing all the redundant "GPRMC" callings, I got 73 lines of NOPS free!!
Also, i made another test, there was a single active lookup for "GPGGA" into Get_Sats soubroutine,
i made a table with the string, and change the commands WAIT_FOR_GPS for a single call to my routine,
with the table name as a parameter. It gave me 6 more lines than before!!.
I put the result code attached, it's plenty of trash, but i think it could be useful for future reference (begginer thoughts)
Thanks again!!
Best Regards