Hi, I want to know whether below code will perform expected task or not ?
void test(unsigned char const xdata* buffer);
unsigned char magicString[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
void main(void) { unsigned char i;
while(1) { for(i=0; i<8; i++) { magicString[i] += 1; } test(magicString); } }
void test(unsigned char const xdata* buffer) { unsigned char j;
for (j=8; j>0; j++) { send(*buffer++); // another function } }
Will test() and send() function works ok ? Will send() will send all 8 byte of data of magicString or not ? is there any logic mistake ?
Thanks in advance ?
Why not get your answers by running it in the simulator?
I can do it on simulator and it works fine... but while i m running real time, its giving unpredicted behavior... i just wrote a simple modified piece of code, actual code is a bit different, but the piece giving error is that i wrote... do u find anything strange in that ?
I can do it on simulator and it works fine... but while i m running real time, its giving unpredicted behavior... sounds as if you are addressing xdata you do not have (activated). 1) what derivative do you use (all numbers and letters) 2) external RAM? if yes to 2) 3) what RAM (all numbers and letters) 4) what speed RAM? 5) what clock speed the uC? 6) what Vcc the uC, what Vcc the RAM
View all questions in Keil forum