|
|
View previous topic :: View next topic |
Author |
Message |
gfbankston
Joined: 21 Jul 2014 Posts: 35
|
reading program memory results in wrong data being retrieved |
Posted: Mon Jul 28, 2014 7:35 am |
|
|
Hello,
I am using a graphic lcd, with which I must send 5 * 8bits to write a 5x7 character to the screen.
Using rom messages, the correct character is being retrived from rom, and is then passed to the font5x7 routine. The font5x7 routine correctly computes the rom location of the character in question, but then retrieves a completely different byte other than the one indicated by the rom pointer.
It is weird too, since the messages and the LCD init string are all being correctly retrieved!
The font table is located at 0x7F1E and after adding the character displacement, the pointer shows 0x7FF0.(example)
But, both using: read_program_memory(font_ptr,font_buf,5); and using
PASS_STRINGS = IN_RAM reveal exactly the same results.
The only difference between a message and the font table is the sheer size of the font table. The symbol table shows the font table and its range of hex addresses, and looks sane.
Latest version of CCS compiler, device = PIC18F25K50
This same code runs perfectly on the XC8 compiler.
TIA for any advice...
GlenB |
|
|
gfbankston
Joined: 21 Jul 2014 Posts: 35
|
more info |
Posted: Mon Jul 28, 2014 8:24 am |
|
|
Hello,
Although the symbols file showed my font table at 0x7f1e, the debugger
shows it is not there. The code also uses the 0x7f1e at the font_table
pointer. So, the symbol table and the code agree, problem is: the linker is NOT updating the symbol file with the REAL address nor the hex code.
The compiler has moved all the messages in rom up to the top of the code space for the 'main' file. I have no idea, yet, where the actual font table is because the lcd source is a separate, linked file.
I am going to change my code from a linked in lcd file to one that is included into the main file and see what happens...
GlenB |
|
|
gfbankston
Joined: 21 Jul 2014 Posts: 35
|
linker troubles |
Posted: Mon Jul 28, 2014 8:57 am |
|
|
Yes, including the lcd source into the main file worked. Trying to link
in the lcd file did not work.
I have no idea why!!!??? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Jul 28, 2014 9:07 am |
|
|
CCS can only link object files if you have the CCS IDE (PCWH, PCWHD, etc).
To do this, you have to enable "Multiple Compilation Units" in the IDE.
If you have the command line compiler (PCB, PCM, PCH, etc.) and you
normally use MPLAB as your IDE, then you don't have the ability to link
object files. Everything has to be an #include file. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|