View previous topic :: View next topic |
Author |
Message |
wavelength
Joined: 21 Mar 2014 Posts: 12
|
Large array question |
Posted: Fri May 15, 2015 2:07 pm |
|
|
All,
I have a simple project using the 16F1705. I have a large array (7330 bytes) and using HDx I am able to create that in hex C format. Basically this is a setup file for a small FPGA. The PIC is going to set this up and then an I2C device then sleep. I want this in DIP so I can send updates if needed.
I get a segment error because of the length. I remember doing a project before with this error and I had do specify some 16 bit pointer or something and I can't seem to find it.
Anybody remember what this is?
Thanks,
Gordon _________________ J. Gordon Rankin
Wavelength Audio, ltd. |
|
|
wavelength
Joined: 21 Mar 2014 Posts: 12
|
|
Posted: Fri May 15, 2015 2:42 pm |
|
|
All,
Ok I see this has to do with the missinterpretation of 14K bytes verses 8K program space.
Anyone know of a simple zip routine? This structure is has tons of zero's in it.
Thanks,
Gordon _________________ J. Gordon Rankin
Wavelength Audio, ltd. |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Fri May 15, 2015 2:59 pm |
|
|
i would us a cheap pic with I2C as a HOST-
16f1825 ( $1.10/100) comes to mind -
and then
add a DIP socket-8 that is crafted to hold a 24LC64-N package
EEPROM CHIP ( $.33/100) with 8 k bytes of storage and just jack the DIP 8 in and out of your pic handler circuit.
leave the PIC loader board wherever - and just mail a 3/$1 throw away DIP program loader part. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri May 15, 2015 3:54 pm |
|
|
Quote: | Ok I see this has to do with the missinterpretation of 14K bytes verses 8K program space. |
Flash memory pages in the 16F1705 are 2048 words long, and there are
four pages. Each word is 14 bits. You can store one byte per word
with a RETLW xx instruction. The compiler does this for you when you
declare an array. So, allowing for some code to access the data, you
could store nearly 8K bytes in the PIC.
However, the compiler will not let an array be larger than a 2K program
memory page. You will have to break the large array into at least four
smaller arrays. Also, there is a small amount (less than 16 words)
of "access code" that the compiler places at the start of each array.
So you can't store exactly 2048 bytes per rom page. |
|
|
|