View previous topic :: View next topic |
Author |
Message |
nilsener
Joined: 06 Dec 2005 Posts: 59
|
write_program_memory |
Posted: Sun Sep 12, 2010 11:24 am |
|
|
Hello,
the CCS Manual says:
write_program_memory(address, dataptr, count);
Every fourth byte of data will not be written, fill with 0x00.
Why will it not be written and filled with 0x00?
If I write 8 bytes of data, what will happen with byte 4 and 8?
Are they lost?
Thanks for any help
Nilsener |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Sep 12, 2010 12:33 pm |
|
|
Post a small compilable test program that demonstrates the problem,
and post your compiler version. |
|
|
nilsener
Joined: 06 Dec 2005 Posts: 59
|
|
Posted: Mon Sep 13, 2010 12:37 am |
|
|
v4.014
PIC18F2685
Hello PCM,
I actually have no problem but I must understand why every fourth byte of data will not be written, fill with 0x00, and what will happen with byte 4, 8, 12 and 16 if I write 16 byte of data. Are they lost? Is this filling with 0x00 a thing that I have to concern or can I ignore it?
Best Regards
Nilsener |
|
|
Wayne_
Joined: 10 Oct 2007 Posts: 681
|
|
Posted: Mon Sep 13, 2010 2:15 am |
|
|
PCM programmer wrote: | Post a small compilable test program that demonstrates the problem,
and post your compiler version. |
Do what PCM has asked.
We have no idea why YOUR program doesn't work as YOU expect because we don't know what YOU expect it to do and we don't know what YOUR code does.
What data are you writing ?
Are you writing 00 to the 4 byte every time ?
Are you actually writing 4 bytes ?
What address are you writing to ?
What fuses have you got set ?
Is the pic resetting just before writing the 4th byte ?
... |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19541
|
|
Posted: Mon Sep 13, 2010 3:25 am |
|
|
Ouch....
4.014. Odds of much working are small.
I can't see any reference to only three bytes being written in the manual on a later compiler.
Best Wishes |
|
|
Wayne_
Joined: 10 Oct 2007 Posts: 681
|
|
Posted: Mon Sep 13, 2010 4:36 am |
|
|
I just had a shock moment, I thought I was being a bit harsh after re-reading the post:-
I sudenly thought he meant that the help says:- "Every fourth byte of data will not be written, fill with 0x00. " But I just checked my help (V.4) and it didn't. I know it is still possible his does.
I appologise for being a bit harsh if this is what your help says as it is a bit strange! |
|
|
nilsener
Joined: 06 Dec 2005 Posts: 59
|
|
Posted: Mon Sep 13, 2010 4:56 am |
|
|
Hello Wayne_,
don't worry about the articulation of your first answer, no problem.
You are right, my help says nothing about the "Every fourth byte of data will not be written, fill with 0x00.", but the CCS Manual from August 2009 does.
And by reading this, my first question was, what will happen with byte 4,8,12,16 if I write 16 byte of data.
Is this filling with 0x00 a thing that I have to concern or can I ignore it? |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Mon Sep 13, 2010 6:04 am |
|
|
I think you missed Ttelmah's post.
The thing you have to be concerned about is your compiler version. At first I missed it, I read it as v4.114 because that is a soon to be released version and about 100 versions(!) newer than yours.
V4.014 is very old and is from the early days of the v4 compiler. These early compiler releases were very unstable and often failed to compile even the most simple program. Only starting around release v4.070 the compiler became usable again. On this forum I won't help people with the old compiler versions, because even when you get to work around your current problem you will find a new compiler bug on the next line of code you write.
Either revert to the stable v3.249 that was available for download at the time you bought your compiler or upgrade to a new compiler version. |
|
|
Blob
Joined: 02 Jan 2006 Posts: 75 Location: Neeroeteren, Limburg, Belgium
|
|
Posted: Thu Sep 16, 2010 7:05 am |
|
|
Hello,
TS means the CCS manual from august 2009 and also june 2010 says this:
Quote: | ยท write_program_memory(address, dataptr, count);
- Writes count bytes of data from dataptr to address in program memory.
- Every fourth byte of data will not be written, fill with 0x00. |
page 44 in the 2009 manual, p 49 in the 2010.
I can not explain why... |
|
|
|