I wrote some code earlier and couldn't get it to work. It turned out that two of my buffers were overlapping. I've chopped it down to minimal code but can't see what I have done wrong.
Can someone confirm that this code,
when run and then paused results in the following variable allocations,
buff = 0x85 to 0xd4
IDbuffer = 0xc4 to 0xcd
Can someone confirm they see the same results and it's not some quirk of my setup?
Can anyone explain why IDbuffer is in the middle of buff?
I've tried using #pragma idata and various other things but I just can't get this initialised ram array to work.
I'm sure there's some simple reason why this doesn't work but I just can't see it at the moment.
Thanks,
Mike.
Can someone confirm that this code,
Code:
#include <p18f1320.h>
#pragma config WDT = OFF, LVP = OFF, OSC = INTIO2, DEBUG = OFF, MCLRE = ON
unsigned char IDbuffer[]=
{0x01,0x12,0x23,0x34,0x45,0x56,0x67,0x78,0x89,0x90};
void StoreID(unsigned char* Data){
unsigned char buff[80];
while(1);
}
void main(void){
char Count;
OSCCON=0x70;
StoreID(&IDbuffer[0]);
while(1){
}
}
buff = 0x85 to 0xd4
IDbuffer = 0xc4 to 0xcd
Can someone confirm they see the same results and it's not some quirk of my setup?
Can anyone explain why IDbuffer is in the middle of buff?
I've tried using #pragma idata and various other things but I just can't get this initialised ram array to work.
I'm sure there's some simple reason why this doesn't work but I just can't see it at the moment.
Thanks,
Mike.