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 CCS Technical Support

[SOLVED] PCD Sanity Check w/BYTE sized CONST strings/values

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



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

[SOLVED] PCD Sanity Check w/BYTE sized CONST strings/values
PostPosted: Mon Dec 28, 2009 6:26 pm     Reply with quote

Hey there,

I'm using a verified LCD driver to talk with my Explorer 16.

the LCD.c was a carry over from all the CCS usual stuff.

And it's worked in the past.

When I compile the module into my stuff now, I have LCD init problems which I've whittled down to the LCD Init String which is normally posed as:

BYTE const LCD_INIT_STRING [] = {0x38, 0x0C, 0x01, 0x06};

I get the right number of bytes (4) written to the display (byte wide port on PORTE) but the bytes are wrong.

They come out 0x38, 0x00, 0x01, 0x00

I know there's compiler changes all the time. I even tried

#DEVICE CONST=

with the ROM and ROMI to see how MPLAB sees the output different.

When MPLAB's WATCH can see LCD_INIT_STRING, it has the wrong content (it's a printf to a UART!!) vs the right content on my scope but MPLAB lists the const as "out of bounds"

I'm using PCD 4.103 w/PIC24FJ128GA010.

The LCD works fine, I loaded up old working code that verifies its operation.

Thanks,

-Ben

EDIT: I looked at prog ROM and the spot that CCS sticks the string reads:

$0157E8 0C0038
$0157EA 060001

Which if I'm reading this right, is getting packed wrong.

_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D


Last edited by bkamen on Tue Dec 29, 2009 12:19 am; edited 1 time in total
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Dec 28, 2009 9:00 pm     Reply with quote

I don't have that compiler, but if you want a work-around, try removing
the 'const'. Let it be a RAM array.
It sounds like a possible bug and it should be investigated, but if
you were in a hurry to test the program...
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Mon Dec 28, 2009 11:07 pm     Reply with quote

PCM programmer wrote:
I don't have that compiler, but if you want a work-around, try removing
the 'const'. Let it be a RAM array.
It sounds like a possible bug and it should be investigated, but if
you were in a hurry to test the program...



I did a couple of other tests to show the code should it send out the right string works... but packing the array is busted.

I did try removing CONST and the array works as I'd expect.

(sigh) I submitted a bug report to CCS.

Wow.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

packed byte arrays in PCD Fixed in 4.104
PostPosted: Tue Dec 29, 2009 12:38 pm     Reply with quote

This has been resolved with the latest version (4.104).

FAST!

_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
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