View previous topic :: View next topic |
Author |
Message |
jfathman
Joined: 25 Jun 2015 Posts: 8 Location: Lewisville, Texas
|
CCSLoad truncating input Serial Number value |
Posted: Thu Jun 25, 2015 9:48 am |
|
|
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
|
|
Posted: Thu Jun 25, 2015 11:32 am |
|
|
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 |
|
|
jfathman
Joined: 25 Jun 2015 Posts: 8 Location: Lewisville, Texas
|
|
Posted: Thu Jun 25, 2015 12:39 pm |
|
|
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
|
|
Posted: Mon Jul 06, 2015 1:28 pm |
|
|
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: 9246 Location: Greensville,Ontario
|
|
Posted: Mon Jul 06, 2015 4:57 pm |
|
|
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 |
|
|
|