Пн июн 28, 2021 01:13:26
Пн июн 28, 2021 07:44:38
Пн июн 28, 2021 08:13:31
А вот для компилятора Си...
-Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x8030ff
Пн июн 28, 2021 10:37:48
Пн июн 28, 2021 11:23:31
-Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x8090ff,--defsym=__stack=0x8010ff
Пн июн 28, 2021 14:13:25
Пн июн 28, 2021 15:32:03
#include <xmem.h>
void setup() {
// initialise the memory
xmem::begin(false);
}
void loop() {
// declare some pointers into external memory
int *intptr=reinterpret_cast<int *>(0x2200);
char *charptr=reinterpret_cast<char *>(0x2200);
// store integers in bank 0
xmem::setMemoryBank(0,false);
intptr[0]=1;
intptr[10000]=2;
intptr[20000]=3;
// store characters in bank 1
xmem::setMemoryBank(1,false);
charptr[0]='a';
charptr[10000]='b';
charptr[20000]='c';
delay(1000);
}
Добавьте собственные флаги компилятора в platform.local.txt. Просто создайте его в том же каталоге, где находится platform.txt. Например:
compiler.c.extra_flags=
compiler.c.elf.extra_flags=
compiler.S.extra_flags=
compiler.cpp.extra_flags=-mcall-prologues -fno-split-wide-types -finline-limit=3 -ffast-math
compiler.ar.extra_flags=
compiler.objcopy.eep.extra_flags=
compiler.elf2hex.extra_flags=
Пн июн 28, 2021 16:45:18
Пн июн 28, 2021 18:20:21
Features
We believe our simulation models are the most accurate and the most complete on the market today. A
summary of model capabilities is listed below:
• Supports the entire instruction set.
• Supports all port and other I/O pin operations.
• Supports all counter/timers including seperate prescalers, capture compare and PWM modes.
• Supports watchdog timer.
• Supports serial U(S)ART.
• Supports master slave SPI, USI and TWI serial interfaces.
• Supports Analogue-to-Digital Conversion (ADC) and analogue comparator modules in all modes.
• Supports all internal and external interrupt modes.
• Supports internal code and data EEPROM memory inc. code protection and data persistence.
• Internally generated processor clock for performance. Event timing accurate to one clock period.
• Provides internal consistency checks on code (e.g. execution of invalid op-codes, illegal memory accesses,
stack overflow checking, etc.).
• Fully integrated in to the VSM source level debugging system.
• Fully integrated into the Proteus Diagnostic Control System.
Limitations
The following is a listing of known limitations in the current version of the AVR® family:
x Brown-out Reset is not implemented.
x Power supply voltage changing is not supported.
x JTAG and other in-circuit debugging interfaces are not supported.
x External programming of memories is not supported.
x Electrical characteristics dependency of the temperature is not implemented.
Вт июн 29, 2021 02:07:20
Вт июн 29, 2021 08:20:13
Execution timing should be nearly accurate, different access times for internal RAM / external RAM / EEPROM and other hardware components are simulated.
Вт июн 29, 2021 18:17:45
---
MCUCR |= (1<<SRE); // External memory interface enable
XMCRA = 0;
XMCRB = 0; // Нам нужны Все разряды адреса
---
byte* mem; //
mem = (byte*)malloc(BUFFER_SIZE); //
---
// Fill memory incrementing values
int index;
byte Data;
for(index = 0; index < (BUFFER_SIZE + 1); index++) {
mem[index + Offset] = Data;
Data++
}
// Display memory block
for(index = 0; index < (BUFFER_SIZE + 1); index++) {
Serial.print(mem[index + Offset], HEX);
}
Вт июн 29, 2021 18:46:40
An optional external data SRAM can be used with the ATmega128. This SRAM will occupy an
area in the remaining address locations in the 64K address space. This area starts at the
address following the internal SRAM. The Register file, I/O, Extended I/O and Internal SRAM
occupies the lowest 4352bytes in normal mode, and the lowest 4096bytes in the ATmega103
compatibility mode (Extended I/O not present), so when using 64Kbyte (65536 bytes) of External Memory, 61184bytes of External Memory are available in normal mode, and 61440 bytes in
ATmega103 compatibility mode. See “External Memory Interface” on page 25 for details on how
to take advantage of the external memory map
Вт июн 29, 2021 21:55:08
Ср июн 30, 2021 08:04:06
Поскольку внешняя память отображается после внутренней памяти, как показано на рисунке 11, только 60 Кбайт внешней памяти доступен по умолчанию (адресное пространство от 0x0000 до 0x10FF зарезервировано для внутренней памяти). Однако можно использовать всю внешнюю память, маскирование старших бит адреса до нуля. Это можно сделать с помощью битов XMMn и управления программно наиболее значимые биты адреса. Установив порт C на выход 0x00 и высвободив наиболее значимые биты для нормальной работы вывода порта, интерфейс памяти будет адресовать 0x0000 - 0x1FFF. См. следующие примеры кода
#define OFFSET 0x2000
void XRAM_example(void)
{
unsigned char *p = (unsigned char *) (OFFSET + 1);
DDRC = 0xFF;
PORTC = 0x00;
XMCRB = (1<<XMM1) | (1<<XMM0);
*p = 0xaa;
XMCRB = 0x00;
*p = 0x55;
}
Ср июн 30, 2021 10:49:34
Ср июн 30, 2021 11:20:56
Переменные __malloc_heap_start и __malloc_heap_end могут использоваться для ограничения функции malloc(), чтобы она работала в определенной области памяти. Эти переменные статически инициализируются для указания на начало кучи __heap_start и конец кучи __heap_end соответственно, where __heap_start заполняется линкером для указания области вне .bss, и __heap_end устанавливается в 0, чем подразумевается для malloc(), что куча находится ниже стека (стек расположен в более старших адресах, чем куча).
Если куча перенесена в external RAM, то __malloc_heap_end должна быть настроена соответствующим образом. Это можно сделать либо во время выполнения кода (run-time), путем записи значения в эту переменную, или это может быть реализовано автоматически во время линковки (link-time), путем настройки значения символа __heap_end.
Ср июн 30, 2021 12:09:21
Ср июн 30, 2021 13:11:35
With all the features the External Memory Interface provides, it is well suited to operate as an
interface to memory devices such as External SRAM and Flash, and peripherals such as LCDdisplay, A/D, and D/A.
Ср июн 30, 2021 14:49:20