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

How much can read/write_program_memory() handle?

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



Joined: 17 Jun 2019
Posts: 537
Location: Des Moines, Iowa, USA

View user's profile Send private message Visit poster's website

How much can read/write_program_memory() handle?
PostPosted: Fri Nov 22, 2019 9:02 am     Reply with quote

For read_program_memory() and write_program_memory() on PIC24 parts:

The help file mentions minimum sizes for reading and writing, but does this CCS function have a maximum size limit? The code I am working to only reads and writes in the minimum size, and I had assumed that was because that's how the API worked. But a quick test seems to let me get an entire "erase size" block (2K on this part, I think).

Any known issues with using larger blocks than the read/write minimum?

(Apologies to the forum admins; I accidentally posted this in the wrong area yesterday.)
_________________
Allen C. Huffman, Sub-Etha Software (est. 1990) http://www.subethasoftware.com
Embedded C, Arduino, MSP430, ESP8266/32, BASIC Stamp and PIC24 programmer.
http://www.whywouldyouwanttodothat.com ?
Ttelmah



Joined: 11 Mar 2010
Posts: 19219

View user's profile Send private message

PostPosted: Mon Nov 25, 2019 1:33 am     Reply with quote

Obvious issue is that you then need a large buffer.
The PCD bootloader uses 64byte transfers.
On chips with smaller pages (128byte), this merrily accepts transfers
of KB at a time.
allenhuffman



Joined: 17 Jun 2019
Posts: 537
Location: Des Moines, Iowa, USA

View user's profile Send private message Visit poster's website

PostPosted: Mon Nov 25, 2019 8:20 am     Reply with quote

Ttelmah wrote:
Obvious issue is that you then need a large buffer.
The PCD bootloader uses 64byte transfers.
On chips with smaller pages (128byte), this merrily accepts transfers
of KB at a time.


I am actually trying to find limits on the CCS calls themselves. From tests on one of the PIC24s we use, I was able to do:

Code:
unsigned int8 buffer[2048];
// fill buffer
write_program_memory (address, buffer, 2048);


It appeared to do all 2K. I am just wondering if that is handled by CCS for all PIC variations, and I can rely on it, or if I need to split everything up into multiple small read/writes.
_________________
Allen C. Huffman, Sub-Etha Software (est. 1990) http://www.subethasoftware.com
Embedded C, Arduino, MSP430, ESP8266/32, BASIC Stamp and PIC24 programmer.
http://www.whywouldyouwanttodothat.com ?
Ttelmah



Joined: 11 Mar 2010
Posts: 19219

View user's profile Send private message

PostPosted: Mon Nov 25, 2019 9:12 am     Reply with quote

I can't see any reason it wouldn't. Internally the count is 16bit. Never
heard of any issue with larger transfers.
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