This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DS80C400 doesnt show 400000 content.

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++));

Parents
  • 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.

Reply
  • 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.

Children