[En-Nut-Discussion] Building and accessing a memory mapped Nut Expansion

Hugo Simon hugo.simon at gmx.de
Tue Mar 14 13:52:46 CET 2006


Hi,

as mentioned before I want to connect an old Z80 driven device to the
Ethernut. Therfore I choose to memory map it to Ethernut's memory area like
this:

0xd000..0xd7ff  mapped to Z80's memory 0xf000..0xf7ff
0xd800..0xdfff  mapped to Z80's IO area

So I took a 74138 and connect it to some address lines of the Ethernut to
build an address decoder:

Pin 1 (A)  -> A12
Pin 2 (B)  -> A11
Pin 3 (C)  -> A14
Pin 4 (/E1)-> A13
Pin 5 (/E2)-> GND
Pin 6 (E3) -> A15

So there should appear a puls on Pin 7 (Q7) if accessing 0xD800..0xDFFF and
on Pin 10 (Q5) if accessing 0xD000..0xD7FF. But I get no pulse at all. One
none of the output pins.

Maybe I do something wrong in the software?

I defined some global pointers:

static char *maindisp = (char *)0xd0b0;
static char *keydisp  = (char *)0xd370;
static char *keyb     = (char *)0xd810;

The access to this memory locations is then done with:

  *keyb=value;

or with

  memset(maindisp,value,72*8);

or with

  maindisp[s]=value;

Maybe avrgcc blocks these memory accesses because it's above RAMTOP? Or is
something wrong with that pointer initialization?

Thank you
Thorsten








More information about the En-Nut-Discussion mailing list