CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

reading program memory results in wrong data being retrieved

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
gfbankston



Joined: 21 Jul 2014
Posts: 35

View user's profile Send private message

reading program memory results in wrong data being retrieved
PostPosted: Mon Jul 28, 2014 7:35 am     Reply with quote

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

View user's profile Send private message

more info
PostPosted: Mon Jul 28, 2014 8:24 am     Reply with quote

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

View user's profile Send private message

linker troubles
PostPosted: Mon Jul 28, 2014 8:57 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jul 28, 2014 9:07 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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