assemblyavratmegaproteus

Connecting 6116 to ATMega128


I have been trying to connect a 6116 to an ATMega128 in Proteus. I have the following schematic: enter image description here

I can somewhat write to 6116 but I don't think I am accessing to correct addresses. I used the following code to test if everything was working correctly:

.include "m128def.inc"

        ldi r16, 0x80 
        out MCUCR, r16

        clr r16
        sts XMCRA, r16
        
        ldi r16, 0x03
        sts XMCRB, r16
        
        ldi r16,1
        sts 0x1100, r16

        here: jmp here

So when I run this code, I expect to see value 1 at $0000 of 6116. However, this is what I see: enter image description here

value 1 appears at $0100 of 6116. What am I missing here, what is wrong? I am extremely new to this and sorry if I butchered something.

Edit: Here are the settings that I get when I double click on the MCU enter image description here


Solution

  • I'm pretty sure if you write to address 0x1100, you'll get the location 0x100 in the 6116 for both configurations. You should start at 6k boundary (0x1800 = 0b1100000000000 => 0b**00000000000) to be sure you are starting at 0x0000 in external memory.

    enter image description here

    For 2kB memory you'll have to count on the address "masking" = you don't have the address lines available:

    enter image description here

    Of course in 103 compatibility mode (memory configuration B) you could've start on 4k boundary, instead of 6k