|
|
View previous topic :: View next topic |
Author |
Message |
allenhuffman
Joined: 17 Jun 2019 Posts: 588 Location: Des Moines, Iowa, USA
|
How much can read/write_program_memory() handle? |
Posted: Fri Nov 22, 2019 9:02 am |
|
|
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 ?
Using: 24FJ256GA106, 24EP256GP202 and 24FJ64GA002. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19587
|
|
Posted: Mon Nov 25, 2019 1:33 am |
|
|
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: 588 Location: Des Moines, Iowa, USA
|
|
Posted: Mon Nov 25, 2019 8:20 am |
|
|
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 ?
Using: 24FJ256GA106, 24EP256GP202 and 24FJ64GA002. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19587
|
|
Posted: Mon Nov 25, 2019 9:12 am |
|
|
I can't see any reason it wouldn't. Internally the count is 16bit. Never
heard of any issue with larger transfers. |
|
|
|
|
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
|