Let us suppose that a PIC microcontroller (speciffically the 16f628a) will handle a large block of data. Each Byte of this block has been previously defined by another application.
Since the PIC microcontroller is Harvard(Program and data are separate), any constant in program memory must be stored as instructions like load-immediate.
The only way to store constants on the PIC is through data EEPROM and Instruction Memory. Unfortunately, The EEPROM will not fit the block.
To make it worse, this specific part does not support self-programming.That means the program cannot modify or even directly read the value stored at the instruction memory.
Is there any way to reduce this:
#define block[1] something
#define block[2] something else
...
#define block[200] last byte
load_immediate block[1] //loads first char of array block
store area //stores on RAM address area
load_immediate block[2] //loads secind char of array block
store area+1 //stores into Area + 1
... //and so on...
load_immediate block[200] //up to the last char.
store area+199
Into this:
__define_array block //generates defines for the array block.
allocate(block, area) //generates the instructions that allocate the entire array into ram starting from address area.
Is there any macro like this in mplab? Or will i have the hand cramps to store an ascii table without having it vanish everytime i turn the microcontroller off?
This non-accessible ROM thing is really snipping with my mind.
Since the PIC microcontroller is Harvard(Program and data are separate), any constant in program memory must be stored as instructions like load-immediate.
The only way to store constants on the PIC is through data EEPROM and Instruction Memory. Unfortunately, The EEPROM will not fit the block.
To make it worse, this specific part does not support self-programming.That means the program cannot modify or even directly read the value stored at the instruction memory.
Is there any way to reduce this:
#define block[1] something
#define block[2] something else
...
#define block[200] last byte
load_immediate block[1] //loads first char of array block
store area //stores on RAM address area
load_immediate block[2] //loads secind char of array block
store area+1 //stores into Area + 1
... //and so on...
load_immediate block[200] //up to the last char.
store area+199
Into this:
__define_array block //generates defines for the array block.
allocate(block, area) //generates the instructions that allocate the entire array into ram starting from address area.
Is there any macro like this in mplab? Or will i have the hand cramps to store an ascii table without having it vanish everytime i turn the microcontroller off?
This non-accessible ROM thing is really snipping with my mind.