连接6116到ATMega128

huangapple go评论60阅读模式
英文:

Connecting 6116 to ATMega128

问题

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

连接6116到ATMega128

I can somewhat write to 6116 but I don't think I am accessing the 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 the value 1 at $0000 of 6116. However, this is what I see:

连接6116到ATMega128

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:

连接6116到ATMega128

英文:

I have been trying to connect a 6116 to an ATMega128 in Proteus. I have the following schematic:
连接6116到ATMega128

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:
连接6116到ATMega128

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
连接6116到ATMega128

答案1

得分: 1

I think you run the chip in "ATmega103 compatibility mode" which is selected by the M103C fuse bit. That's the default value of the fuse (See ATmega128 datasheet page 287).

在这个兼容模式下,“内存配置 B” 正在使用 (来自数据表第32页):

内存配置 B 指的是 ATmega103 的兼容模式,配置 A 指的是非兼容模式。

Thus, memory address 0x1100 refers to address 0x100 in the external RAM.

因此,内存地址0x1100指的是外部RAM中的地址0x100。

Also, it might be that Proteus simulation just doesn't entirely support all the external memory modes.

此外,可能是Proteus仿真不完全支持所有外部内存模式。

英文:

I think you run the chip in "ATmega103 compatibility mode" which is selected by the M103C fuse bit. That's the default value of the fuse (See ATmega128 datasheet page 287).

In this compatibility mode, "Memory configuration B" is in use (from datasheet page 32):

> Memory configuration B refers to the ATmega103 compatibility mode, configuration A to the non-compatible mode.

连接6116到ATMega128

Thus, memory address 0x1100 refers to address 0x100 in the external RAM.

Also, it might be that Proteus simulation just doesn't entirely support all the external memory modes.

答案2

得分: 1

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 => 0b00000000000) to be sure you are starting at 0x0000 in external memory.

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

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

英文:

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.

连接6116到ATMega128

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

连接6116到ATMega128

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

huangapple
  • 本文由 发表于 2023年5月8日 02:48:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/76195728.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定