Hi, I have D80c400 evaluation kit and I am tring to read memory location 400000h. According to application note 606. The controller stores 'TINI' hex values, but when I read the loaction I am not getting the same value as mentioned.
unsigned char *ptrROM; unsigned int locationCounter; ptrROM = (unsigned char *)0x400000h; for(locationCounter =0; locationCounter<9;locationCounter++) printf("\r\ ROM value at = %x", *(ptrROM++));
HI.
it is a long long time now when i did 80c400. but i know and understand yo're problem.
u set the pointer to 0x400000 but the run time librarie will acccess one of
0x410000
or
0x3F0000
sorrey but i can not remember teh detail.
the high byte is (of thfree) is use for generic pointer in keil.
u must look at the docmuents from the c libs.
this is relevent;
7. If you write any 8051 code that will be called from C, note that pointers as they are passed down from C code aren't immediately usable in 8051, and pointers that are usable in 8051 must be altered before they are suitable for C use. Use the macro FIXKEILPOINTER to change the high byte of a pointer passed down from C into something usable in 8051. For example, if the pointer is passed to assembly in r3:r2:r1... FIXKEILPOINTER r3 The parameter should be the register or direct that contains the high byte of the pointer. To alter a pointer back so it can be returned to the C program... UNFIXKEILPOINTER r3
Always yo're Freind.
Zeusti.
Thanks a lot for your response. I gone through the document but they had not mention anything about how to use that macro in C file. I am using µVision3v3.53 and wanted to know, wether this version provide support for 24 bit addressing mode.
wen i worked with it keil did a dk51 and a pk51.
teh pk51 woz the pro version and had 24 bit.
i c keil do pk51 and ca51 now.
u need pk51.
u also need 2 look at the maxim dallas c libs documants 4 the 80c400.
i remembar their are c macros 4 the addresesses but i do not remembar teh names.
good luck.
Always yo're freind.
the tini c libs ar at
ftp.dalsemi.com/.../index.html
and one about 24 bit pointers at
files.dalsemi.com/.../structFARPTR.html
plz read thru it. i did not use these C macros bcoz i did a lot in assemblar for my memory accesses
Zeuisti.
Thanks for Your reply.