21
LatticeMico
8
Microcontroller
Lattice Semiconductor
User’s Guide
R01 = 0x08
0x00006
0x0A101
addi R01,0x01
R01 = 0x09
0x00007
0x10308
mov R03,R01
R03 = 0x09
0x00008
0x10410
mov R04,R02
R04 = 0x03
0x00009
0x12535
movi R05,0x35
R05 = 0x35
0x0000A
0x12643
movi R06,0x43
R06 = 0x43
0x0000B
0x08628
add R06,R05
R06 = 0x78
0x0000C
0x0A613
addi R06,0x13
R06 = 0x8B
0x0000D
0x10728
mov R07,R05
R07 = 0x35
0x0000E
0x10830
mov R08,R06
R08 = 0x8B
0x0000F
0x12916
movi R09,0x16
R09 = 0x16
0x00010
0x12ADF
movi R10,0xDF
R10 = 0xDF
•
•
•
Building Simulator from Source
Although Lattice provides precompiled binary files, the source is available for compilation. The following commands
should be used in the Unix and Windows environments.
•
Unix and Cygwin Environments:
gcc -o isp8sim isp8sim.c
•
Windows Environment:
cl -o isp8sim_win isp8sim.c
Example
To display the features and capabilities of the LatticeMico8, a demonstration example is also available. It demon-
strates the interaction between the timer and the controller and the interrupt capability.
# This program will allow user to run a fibonacci number
# generator and updown counter. This program responds to
# the interrupt from the user (through Orcastra).
# When there is an interrupt, the program will halt the current program,
# and execute the int_handler function. When the intr_handler function
# is done, the program will continue from its last position
b int_handler
nop
nop
seti
# set the program to be able to receive interrupt
nop
nop
b start