Hi Everybody!
I'm working on a project with a AT8C51RE2 and reached the maximum code size of 65K.
So i set up the code banking mechanism and split my programm to three banks.
Everythings works fine, only string handover between banks often give some chaotic results.
For example ive got an constant char code table in bank #1 like this one:
static const char code g_UnitDesignation[UnitDesignationId_LENGTH][MaxChar_UnitDesignation]= { {""}, {"s"}, {"min"}, {"days"}, {"mg/l"} }
if try to access over an function in common bank:
char* Log_GetLogText(UINT8 UnitDesignationId, float LogValue) { char outputString[Protocol_MaxOutputChars]; sprintf(outputString, "Log %s=%5.3f", Unit_getUnitDesignation(UnitDesignationId), LogValue); return outputString; }
the generated output is often mutilated badly. (".000Logä")
Does anybody have an idea how to handle this cross access over banks or have a hint whats going wrong?
Thanks a lot,
David
Thanks for your reply.
Refer to the manual: http://www.keil.com/support/man/docs/bl51/bl51_bk_commonarea.htm
Every code constant should be placed in the comman bank, unless you can guarantee that you operate in the same bank at the time of access.
So i try to transfer the code constant to string variable inside the bank and return it as a variable to the other bank.
Or did i miss the point?