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

CCSLoad truncating input Serial Number value

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



Joined: 25 Jun 2015
Posts: 8
Location: Lewisville, Texas

View user's profile Send private message

CCSLoad truncating input Serial Number value
PostPosted: Thu Jun 25, 2015 9:48 am     Reply with quote

I am using CCSLoad 5.018, with Serial Number enabled, using the "Prompt user for serial number" option, to save a Binary of length 4 bytes to address 0007FC to 0007FF.

When prompted, I enter serial number 17792, and at the end of the mem write to LOAD-n-GO, CCSLoad pops up a green bubble indicating Serial Number 17792, which is the desired value.

But at runtime on the PIC, the four byte binary field contains 1779, which appears to have truncated the last digit.

If CCSLoad were configured to pass a string, there could be a problem with the PIC code itself, but since this is a binary field, it is more likely that CCSLoad truncated the input string before converting it to binary.

Is this a known issue? Any suggestions or other explanation for what might be going on?

Thanks.

Jim
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Thu Jun 25, 2015 11:32 am     Reply with quote

Quote:
when storing serial number to EEPROM: dataee=x - The address x is the start address in the data EEPROM. binary=x - The integer x is the number of bytes to be written to address specified. -or- string=x - The integer x is the number of bytes to be written to address


serial numbering is meant to allow ALPHA and NUMERIC CHARS -
it saved the first 4 chars of the STRING you entered. the balloon merely echoed your INPUT but only the first 4 chars of the STRING get saved.
with the exception of the error in what the popup showed - it looks normal to me. let it write 5 chars and you will have the whole thing saved

its a case of TTWIW i think.
experiment more and post your code .....for setting it and reading it both.
maybe its CCS OR maybe its you - the code will reveal all Very Happy Very Happy
jfathman



Joined: 25 Jun 2015
Posts: 8
Location: Lewisville, Texas

View user's profile Send private message

PostPosted: Thu Jun 25, 2015 12:39 pm     Reply with quote

Thanks, I think you are right. I changed the length from 4 to 5 and it picked up my input string without truncation. I thought the length 4 was the binary in-memory length, not the input string limit. It might have been nice if the CCSLoad green bubble indicated how much of the input was actually used, or provided some other feedback/warning.

Now what I am wrestling with is that during these experiments, CCSLoad decided to change the To: address to 0007FE, where we had 0007FF before, and it now insists on 0007FE, which makes it (I think) a two byte field in memory instead of four. I can't see yet why it is doing this.

Thanks.

Jim
jfathman



Joined: 25 Jun 2015
Posts: 8
Location: Lewisville, Texas

View user's profile Send private message

PostPosted: Mon Jul 06, 2015 1:28 pm     Reply with quote

Following up for future readers of this topic --

It turns out the correct length was four (no change). I was experiencing a problem with CCSLoad when programming the PIC18F67J60 using LOAD-n-GO.

When I reverted from a recent CCSLoad version 5.018 to an earlier version 4.030, the serial number programmed properly, without any truncation.
temtronic



Joined: 01 Jul 2010
Posts: 9163
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Jul 06, 2015 4:57 pm     Reply with quote

re: memory address of 7FE instead of 7FF.

This might be 'required' to give 'word length' set onto even boundaries. I know htere's a real name for what I'm trying to say but it's late, I'm hot, hungry and it's a 'Monday'... 4 things busted and no parts...

Jay
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