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

Dallas DS80C400 far memory access

I'm not succeeding in accessing memory through pointers with the 24bit contiguous DS80C400 memory model. I've looked at the support doc http://www.keil.com/support/docs/2172.htm and tried adding a pointer to an absolute address (see line between //~ below code), this fails to compile.

#include "rom400_init.h"
#include <stdio.h>
// leave 4000h bytes for function parameters
#define RAM_START             0x14000
#define RAM_END               0x5FFFF

void main()
{
//~+GJE
unsigned char far my_array[0x10] _at_ 0x400000;
//~-GJE
    printf("DS80C400 Template Project\r\n");
    init_rom(RAM_START, RAM_END);
    // let's print out a little version information...
    printf("DS80C400 Initialization Library Version %d\r\n", init_version());
    while(1)
        {
        }
}

Other methods of declaring & accessing a pointer are all not producing expected results for me, have tried FVAR() and FCVAR() access macros, far, etc, eg

unsigned char const far *   pROM ;
pROM = (unsigned char const far *) 0x400002 ;
for(i=0;i<4;i++){printf("%02bx",*pROM); pROM++;}


should print ASCII for "TINI" (that's the code execution tag ID thing for the TINI bootloader to find) but doesn't, showing

DS80C400 Template Project
DS80C400 Silicon Software - Copyright (C) 2002 Maxim Integrated Products
S/N: 445E700A91964189 MAC ID: 0060350975F6
DS80C400 Initialization Library Version 19
00460240


instead. Am sure I'm missing something...

Have been following the instructions for project setup in Dallas AN613 and the C_library examples from the ftp.dalsemi.com/.../index.html site.

Meantime I'll have to crack on with also understanding Java code on this thing!

thanks in advance
greg