17
LatticeMico
8
Microcontroller
Lattice Semiconductor
User’s Guide
Configuration Options
The LatticeMico8 microcontroller has the following configurable features:
•
Register File size:
LatticeMico8 can be configured to have 16 or 32 registers. Default configuration is 32 8-bit
registers. Un-commenting the line `define REGISTERS_16, will configure the micro-controller with 16 registers.
Note: the Assembler will allow registers 16 through 31 to be used.
•
Internal Scratch Pad memory size:
Default configuration is 32 bytes. Un-commenting the `define
SCRATCH_PAD_MEM_16, will configure the controller to have 16 bytes of internal scratch pad memory.
•
External memory interface:
The external memory interface can be optionally enabled. This allows for adding an
extra 256 bytes of memory to the microcontroller. By default this is not available, un-commenting the line `define
EXT_SP_MEM will enable this feature.
I/O Configurations
Table 1. I/O with No External Scratch Pad Memory
Table 2. I/O with 256 Bytes External Scratch Pad Memory
When `define EXT_SP_MEM is set, three extra ports are added to the controller to communicate with the external
scratch pad memory. The
ext_dout
is used to write data into the external memory. The address bus
ext_addr
is
also shared.
Assembler and Instruction Set Simulator
The software tools for the LatticeMico8 microcontroller include an Assembler and an Instruction Set Simulator, both
developed in C. The purpose of the Assembler is to generate an Embedded Block RAM (EBR) initialization file from
a text assembler input file. The purpose of the Simulator is to execute a program in the host environment. This sec-
tion describes the use of these tools.
Assembler
The assembler reads in a text assembler source file (default extension .s) and creates one of the following as out-
put:
• Hexadecimal output file (can be used by Module Manager)
• Binary output file (can be used by Module Manager)
Name
In/Out
Width (bits)
Description
clk
In
1
Clock
rst_n
In
1
Reset active low
ext_io_din
In
8
Input data for import
intr
In
1
Interrupt active high
ext_addr
Out
8
Address for import/export
ext_dout
Out
8
Output data for export
ext_io_wr
Out
1
High for export
ext_io_rd
Out
1
High for import
intr_ack
Out
1
Interrupt acknowledge active high
Name
In/Out
Width (bits)
Description
ext_mem_din
In
8
Input from external scratch pad
ext_mem_wr
Out
1
High indicates write to external memory
ext_mem_rd
Out
1
High indicates read from external memory