R-Engine-D
Chapter 4: Software
4-5
For a 512K SRAM, the physical address is 0x00000-0x07ffff
3) The on-board EE must have a correct jump address for the re40_115.HEX with starting address of
0xfa000.
4) The STEP2 jumper must be installed on J2 pins 38-40.
4.2
RE.LIB
RE.LIB is a C library for basic R-Engine-D operations. It includes the following modules: AE.OBJ,
SER0.OBJ, SER1R.OBJ, and AEEE.OBJ. You need to link RE.LIB in your applications and include the
corresponding header files in your source code. The following is a list of the header files:
Include-file name
Description
AE.H
PPI, timer/counter, ADC, DAC, RTC, Watchdog
SER0.H
Internal serial port 0
SER1R.H
External UART SCC26C92
AEEE.H on-board
EEPROM
4.3
Functions in AE.OBJ
4.3.1
R-Engine-D Initialization
ae_init
This function should be called at the beginning of every program running on R-Engine-D core controllers.
It provides default initialization and configuration of the various I/O pins, interrupt vectors, sets up
expanded DOS I/O, and provides other processor-specific updates needed at the beginning of every
program.
There are certain default pin modes and interrupt settings you might wish to change. With that in mind, the
basic effects of
ae_init
are described below. For details regarding register use, you will want to refer to the
AMD Am186ER Microcontroller User’s manual.
•
Initialize the upper chip select to support the default ROM. The CPU registers are configured such
that:
−
Address space for the ROM is from 0x80000-0xfffff (to map MemCard I/O window)
−
512K ROM Block size operation.
−
Three wait state operation (allowing it to support up to 120 ns ROMs). With 70 ns ROMs, this
can actually be set to zero wait state if you require increased performance (at a risk of stability
in noisy environments). For details, see the UMCS (Upper Memory Chip Select Register)
reference in the processor User’s manual.
outport(0xffa0, 0x80bf); // UMCS, 512K ROM, 0x80000-0xfffff
•
Initialize LCS (
Lower Chip Select
) for use with the SRAM. It is configured so that:
−
Address space starts 0x00000, with a maximum of 512K RAM.
−
Three wait state operation. Reducing this value can improve performance.
−
Disables PSRAM, and disables need for external ready.
outport(0xffa2, 0x7fbf); // LMCS, base Mem address 0x0000
•
Initialize MMCS and MPCS so that
MCS0
and
PCS0-PCS6
(except for PCS4) are configured so:
−
MCS0
is mapped also to a 256K window at 0x80000. If used with MemCard, this
chip select line is used for the I/O window.