External memory in SPC3

Dear all,

The Siemens Profibus Controller (SPC3), connected to a T89C51RD2 via P0 (multiplexed) and P2, has in its first few addresses registers/latches which I have to set in order to start using it. I believe the SPC to be wired to begin at 0x8000, as the output from P2.7 is inverted before being put into SPC3.

In the options for target, I've set:
memory model: small
code rom: small
off chip xdata memory: start: 0x8000 size: 0x600
The rest of the options are left blank.
In STARTUP.A51 I've set:
XDATASTART EQU 8000H
XDATALEN EQU 600H
and in code:
AUXR = 0x0E;

Suppose the address of the register that i'm trying to read is 04H in the SPC. Why does putchar(XBYTE[0x0004]) (or putchar(XBYTE[0x8004]) for that matter) not work? (ie. it outputs the value of the address, '04', and not its contents) I later used a for-loop to output XBYTE[0x0000] through to XBYTE[0xFFFF], which always seem to return the last 2 hex-digits of every address.

I've also set the xdata in 'options for target' and Startup.A51 to 0x0000 with size 0x000 to the same effect.

Did i miss out or misunderstand something? Any help would be greatly appreciated.

Parents
  • Ping,

    Are you accounting for the multiplexed nature of the 8051 architecture bus? In other words, do you have an address latch? AD0-AD7 first emit the address, then toggle ALE (address latch enable) to have your address latch hold it. Then they emit the data and strobe WR for writes. Does this not match what you're seeing?

Reply
  • Ping,

    Are you accounting for the multiplexed nature of the 8051 architecture bus? In other words, do you have an address latch? AD0-AD7 first emit the address, then toggle ALE (address latch enable) to have your address latch hold it. Then they emit the data and strobe WR for writes. Does this not match what you're seeing?

Children
More questions in this forum