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

write_program_memory

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



Joined: 06 Dec 2005
Posts: 59

View user's profile Send private message

write_program_memory
PostPosted: Sun Sep 12, 2010 11:24 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Sep 12, 2010 12:33 pm     Reply with quote

Post a small compilable test program that demonstrates the problem,
and post your compiler version.
nilsener



Joined: 06 Dec 2005
Posts: 59

View user's profile Send private message

PostPosted: Mon Sep 13, 2010 12:37 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Sep 13, 2010 2:15 am     Reply with quote

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: 19257

View user's profile Send private message

PostPosted: Mon Sep 13, 2010 3:25 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Sep 13, 2010 4:36 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Sep 13, 2010 4:56 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Sep 13, 2010 6:04 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Sep 16, 2010 7:05 am     Reply with quote

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...
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