FPGA-TN-02155-4-7-MachXO2-Programming-and-Configuration-User-Guide
FPGA-TN-02155-4-7-MachXO2-Programming-and-Configuration-User-Guide
User Guide
Technical Note
FPGA-TN-02155-4.7
October 2024
MachXO2 Programming and Configuration User Guide
Technical Note
Disclaimers
Lattice makes no warranty, representation, or guarantee regarding the accuracy of information contained in this document or the suitability of its
products for any particular purpose. All information herein is provided AS IS, with all faults, and all associated risk is the responsibility entirely of the
Buyer. The information provided herein is for informational purposes only and may contain technical inaccuracies or omissions, and may be otherwise
rendered inaccurate for many reasons, and Lattice assumes no obligation to update or otherwise correct or revise this information. Products sold by
Lattice have been subject to limited testing and it is the Buyer's responsibility to independently determine the suitability of any products and to test
and verify the same. LATTICE PRODUCTS AND SERVICES ARE NOT DESIGNED, MANUFACTURED, OR TESTED FOR USE IN LIFE OR SAFETY CRITICAL
SYSTEMS, HAZARDOUS ENVIRONMENTS, OR ANY OTHER ENVIRONMENTS REQUIRING FAIL-SAFE PERFORMANCE, INCLUDING ANY APPLICATION IN
WHICH THE FAILURE OF THE PRODUCT OR SERVICE COULD LEAD TO DEATH, PERSONAL INJURY, SEVERE PROPERTY DAMAGE OR ENVIRONMENTAL
HARM (COLLECTIVELY, "HIGH-RISK USES"). FURTHER, BUYER MUST TAKE PRUDENT STEPS TO PROTECT AGAINST PRODUCT AND SERVICE FAILURES,
INCLUDING PROVIDING APPROPRIATE REDUNDANCIES, FAIL-SAFE FEATURES, AND/OR SHUT-DOWN MECHANISMS. LATTICE EXPRESSLY DISCLAIMS
ANY EXPRESS OR IMPLIED WARRANTY OF FITNESS OF THE PRODUCTS OR SERVICES FOR HIGH-RISK USES. The information provided in this document
is proprietary to Lattice Semiconductor, and Lattice reserves the right to make any changes to the information in this document or to any products at
any time without notice.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
2 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
Contents
Contents ............................................................................................................................................................................... 3
Acronyms in This Document ................................................................................................................................................. 7
1. Introduction .................................................................................................................................................................. 8
2. MachXO2 Features ....................................................................................................................................................... 9
3. Definition of Terms ..................................................................................................................................................... 10
4. Configuration Details .................................................................................................................................................. 11
5. Configuration Process and Flow ................................................................................................................................. 12
5.1. Power-up Sequence .......................................................................................................................................... 13
5.2. Initialization ....................................................................................................................................................... 13
5.3. Configuration .................................................................................................................................................... 14
5.4. Wake-up ............................................................................................................................................................ 14
5.5. User Mode......................................................................................................................................................... 15
5.6. Clearing the Configuration Memory and Re-initialization ................................................................................ 15
5.7. Memory Space Accessibility .............................................................................................................................. 15
5.8. On-chip Flash Programming .............................................................................................................................. 16
5.9. Bitstream/PROM Sizes ...................................................................................................................................... 16
5.10. Feature Row ...................................................................................................................................................... 18
5.11. Key Features ...................................................................................................................................................... 19
5.12. Configuration Modes ........................................................................................................................................ 19
5.13. sysCONFIG™ Ports ............................................................................................................................................. 20
5.14. sysCONFIG Pins ................................................................................................................................................. 20
5.14.1. Self-Download Port Pins ............................................................................................................................... 21
5.14.2. Master and Slave SPI Configuration Port Pins .............................................................................................. 24
5.14.3. I2C Configuration Port Pins ........................................................................................................................... 26
5.14.4. JTAG Configuration Port Pins ....................................................................................................................... 26
6. Configuration Modes .................................................................................................................................................. 29
6.1. SDM Mode ........................................................................................................................................................ 29
6.2. Master SPI Configuration Mode (MSPI) ............................................................................................................ 30
6.3. Dual Boot Configuration Mode ......................................................................................................................... 32
6.4. Slave SPI Mode (SSPI) ........................................................................................................................................ 33
6.5. I2C Configuration Mode..................................................................................................................................... 35
7. WISHBONE Configuration Mode ................................................................................................................................ 37
7.1. JTAG Mode ........................................................................................................................................................ 37
7.2. TransFR Operation ............................................................................................................................................ 38
8. Software Selectable Options ...................................................................................................................................... 40
8.1. Configuration Mode and Port Options .............................................................................................................. 41
8.1.1. JTAG Port ...................................................................................................................................................... 41
8.1.2. Slave SPI Port ................................................................................................................................................ 41
8.1.3. Master SPI Port............................................................................................................................................. 42
8.1.4. I2C Port ......................................................................................................................................................... 42
8.1.5. SDM Port ...................................................................................................................................................... 42
8.1.6. MCCLK Frequency......................................................................................................................................... 43
8.1.7. ENABLE_TRANSFR ........................................................................................................................................ 43
8.2. Bitstream Generation Options .......................................................................................................................... 43
8.2.1. COMPRESS_CONFIG ..................................................................................................................................... 43
8.2.2. CONFIGURATION .......................................................................................................................................... 43
8.2.3. USERCODE .................................................................................................................................................... 44
8.2.4. USERCODE_FORMAT .................................................................................................................................... 44
8.2.5. CUSTOM_IDCODE ......................................................................................................................................... 44
8.2.6. CUSTOM_IDCODE_FORMAT ........................................................................................................................ 44
8.2.7. SHAREDEBRINIT ............................................................................................................................................ 44
8.2.8. MUX_CONFIGURATION_PORTS ................................................................................................................... 45
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 3
MachXO2 Programming and Configuration User Guide
Technical Note
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
4 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
Figures
Figure 5.1. Configuration Flow ........................................................................................................................................... 12
Figure 5.2. Configuration from Power-On-Reset Timing .................................................................................................... 13
Figure 5.3. Flash Memory Space of a MachXO2 Device ..................................................................................................... 16
Figure 5.4. Feature Row Example ....................................................................................................................................... 18
Figure 5.5. Period PROGRAMN is Always Observed ........................................................................................................... 22
Figure 5.6. Configuration from PROGRAMN Timing ........................................................................................................... 22
Figure 5.7. Configuration Error Notification ....................................................................................................................... 22
Figure 5.8. Default JTAG Port with JTAG_PORT = ENABLE.................................................................................................. 27
Figure 5.9. JTAG Port Behavior with JTAG_PORT = DISABLE .............................................................................................. 28
Figure 6.1. Master SPI Configuration Mode ....................................................................................................................... 30
Figure 6.2. RC Delay ............................................................................................................................................................ 32
Figure 6.3. Slave SPI Configuration Mode........................................................................................................................... 34
Figure 6.4. I2C Configuration Logic...................................................................................................................................... 35
Figure 7.1. WISHBONE Configuration Mode....................................................................................................................... 37
Figure 7.2. Bitstream Update Using TransFR ...................................................................................................................... 38
Figure 7.3. Example Process Flow....................................................................................................................................... 39
Figure 8.1. sysCONFIG Preferences in Global Preferences Tab, Diamond Spreadsheet View ............................................ 40
Figure 9.1. Wake-up Sequence Using Internal Clock .......................................................................................................... 47
Figure 10.1. Unencrypted JEDEC File Example ................................................................................................................... 52
Figure 10.2. MachXO2 Flash Memory Programming Flow ................................................................................................. 60
Figure 10.3. MachXO2 Slave SPI/I2C SRAM Configuration Flow ......................................................................................... 65
Figure 10.4. Status Register Value after Erase .................................................................................................................... 66
Figure 10.5. Status Register Value After Program .............................................................................................................. 66
Figure 10.6. Slave SPI/I2C SRAM Read Status Register Flow ............................................................................................... 68
Figure 10.7. Retrieval Delay Timing Requirement for Single-Page Reads .......................................................................... 71
Figure 10.8. Flash Page Command and Data Sequence...................................................................................................... 72
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 5
MachXO2 Programming and Configuration User Guide
Technical Note
Tables
Table 5.1. Memory Space Accessibility of Different Ports .................................................................................................. 15
Table 5.2. Maximum Configuration Bits ............................................................................................................................. 17
Table 5.3. Feature Row Option and Diamond Spreadsheet View....................................................................................... 18
Table 5.4. MachXO2 Feature Row Elements....................................................................................................................... 18
Table 5.5. Configuration Modes ......................................................................................................................................... 19
Table 5.6. MachXO2 Programming and Configuration Ports .............................................................................................. 20
Table 5.7. Default State of the sysCONFIG Pins1 ................................................................................................................. 21
Table 5.8. Default State in Diamond for Each Port ............................................................................................................. 21
Table 5.9. Master SPI Configuration Port Pins .................................................................................................................... 24
Table 5.10. Slave SPI Configuration Port Pins ..................................................................................................................... 24
Table 5.11. MachXO2 MCLK Valid Frequencies (MHz) ....................................................................................................... 25
Table 5.12. JTAG Port Pins .................................................................................................................................................. 27
Table 6.1. Master SPI Port Pins ........................................................................................................................................... 30
Table 6.2. Master SPI Configuration Software Settings ...................................................................................................... 31
Table 6.3. Slave SPI Port Pins .............................................................................................................................................. 33
Table 6.4. I2C Port Pins ........................................................................................................................................................ 35
Table 6.5. Slave Addresses for I2C Ports1 ............................................................................................................................ 36
Table 8.1. Configuration Mode/Port Options ..................................................................................................................... 41
Table 8.2. Security Options ................................................................................................................................................. 45
Table 10.1. Number of Pages of Flash Memory for the MachXO2 Family .......................................................................... 49
Table 10.2. MachXO2 JEDEC File Format ............................................................................................................................ 50
Table 10.3. MachXO2 sysCONFIG Programming Commands ............................................................................................. 69
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
6 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 7
MachXO2 Programming and Configuration User Guide
Technical Note
1. Introduction
The MachXO2™ is an SRAM-based Programmable Logic Device that includes an internal Flash memory which makes the
MachXO2 appear to be a non-volatile device. The MachXO2 provides a rich set of features for programming and
configuration of the FPGA. You have many options available to you for building the programming solution that fits your
needs. Each of the options available is described in detail so that you can put together the programming and
configuration solution that meets your needs.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
8 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
2. MachXO2 Features
Key programming and configuration features of MachXO2 devices are:
Instant-on configuration from internal Flash PROM – powers up in milliseconds
Single-chip, secure solution
Multiple programming and configuration interfaces:
1149.1 JTAG
Self-download
Slave SPI
Master SPI
Dual Boot
I2C
WISHBONE bus
User Flash Memory (UFM) for non-volatile data storage:
Configuration Flash memory overflow
EBR Initialization data
Application specific data
Transparent programming of non-volatile memory
Optional dual boot with external SPI memory
Optional security bits for design protection
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 9
MachXO2 Programming and Configuration User Guide
Technical Note
3. Definition of Terms
This document uses the following terms to describe common functions:
BIT – The BIT file is the configuration data for the MachXO2 that is stored in an external SPI Flash. It is a binary file
and is programmed unmodified into the SPI Flash.
Configuration – Configuration refers to a change in the state of the MachXO2 SRAM memory cells.
Configuration Data – This is the data read from the non-volatile memory and loaded into the FPGA’s SRAM
configuration memory. This is also referred to as a bitstream, or device bitstream.
Configuration Mode – The configuration mode defines the method the MachXO2 uses to acquire the configuration
data from the non-volatile memory.
Internal Flash Memory – JED file or bit file can be programmed directly into the internal flash sector. User does not
need to know where an actual page of the configuration data starts. The MachXO2 configuration engine handles
the parsing in the flash to SRAM transfer.
JEDEC – The JEDEC file contains the configuration data programmed into the MachXO2 Configuration Flash, User
Flash Memory, Feature Row, and Feature Bits. Format information is provided later in this technical note.
Offline mode – Offline mode is a term that is applied to both non-volatile memory programming and SRAM
configuration. When using offline mode programming/configuration the FPGA no longer operates in user mode.
The contents of the non-volatile or SRAM configuration memory are updated, but the MachXO2 does not perform
your logic operations until offline mode programming/configuration is complete.
Number Formats – The following nomenclature is used to denote the radix of numbers
0x – Numbers preceded by ‘0x’ are hexadecimal
b (suffix) – Numbers suffixed with ‘b’ are binary
All other numbers are decimal
Port – A port refers to the physical connection used to perform programming and some configuration operations.
Ports on the MachXO2 include JTAG, SPI, I2C, and WISHBONE physical connections.
Programming: Programming refers to the process used to alter the contents of the internal or external non-volatile
configuration memory.
Transparent Mode – Transparent mode is used to update the Configuration Flash, and User Flash Memory while
leaving the MachXO2 in User Mode.
User Mode – The MachXO2 is in user mode when configuration is complete, and the FPGA is performing the logic
functions you have programmed it to perform.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
10 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
4. Configuration Details
MachXO2 devices contain two types of memory, SRAM and Flash. SRAM memory contains the active configuration,
essentially the “fuses” that define the behavior of the FPGA. The active configuration is, in most cases, retrieved from a
non-volatile memory. The non-volatile memory holds the configuration data that is loaded into the FPGAs SRAM. The
MachXO2 provides an internal Flash memory that stores the configuration data loaded into the MachXO2 SRAM.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 11
MachXO2 Programming and Configuration User Guide
Technical Note
PROGRAMN or
Initialization INITN = Low
INITN Released
Device refresh
• PROGRAMN falling edge
• IEEE 1532 REFRESH command
Device refresh
Wake Up
DONE Released
De vice refresh
User Mode
* The voltage level is for the MachXO3 E device. Voltage level may vary for other devices.
** The external INITN and DONE are bidirectional, open-drain I/O only when enabled.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
12 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
The MachXO2 sysCONFIG ports provide industry standard communication protocols for programming and configuring
the FPGA. Each of the protocols shown in Table 5.1 provides a way to access the MachXO2 device’s internal Flash
memory, or to load its configuration SRAM. The Memory Space Accessibility section provides information about the
capabilities of each sysCONFIG port.
The sysCONFIG ports capable of accessing the Flash memory have a priority order. Table 5.1 lists each of the sysCONFIG
ports in their priority order. The MSPI configuration port does not have the ability to alter the Flash memory space, and
as a result is not a factor in the sysCONFIG port priority scheme. The priority scheme is important to be aware of, as a
Configuration Logic operation using a low priority sysCONFIG port can be interrupted by a higher priority sysCONFIG
port. The operation of the Configuration Logic is not defined when a low priority sysCONFIG port is interrupted by a
higher priority sysCONFIG port. Do not permit simultaneous access to the Configuration Logic using a sysCONFIG port.
tINITL
V CC /VCCIO
INITN
DONE
Note: The external INITN and DONE are bidirectional, open-drain I/O only when enabled.
5.2. Initialization
The MachXO2 enters the memory initialization phase immediately after the Power On Reset circuit drives the INITN
and DONE status pins low. The purpose of the initialization state is to clear all of the SRAM memory inside the FPGA.
The FPGA remains in the initialization state until all of the following conditions are met:
The tINITL time period has elapsed
The PROGRAMN pin is deasserted
The INITN pin is no longer asserted low by an external master
The dedicated INITN pin provides two functions during the initialization phase. The first is to indicate the FPGA is
currently clearing its configuration SRAM. The second is to act as an input preventing the transition from the
initialization state to the configuration state.
During the tINITL time period the FPGA is clearing the configuration SRAM. When the MachXO2 is part of a chain of
devices each device has different tINTIL initialization times. The FPGA with the slowest tINTIL parameter can prevent
other devices in the chain from starting to configure. Premature release of the INITN in a multi-device chain may cause
configuration of one or more chained devices to fail to configure intermittently.
The active-low, open-drain initialization signal INITN must be pulled high by an external resistor when initialization is
complete. To synchronize the configuration of multiple FPGAs, one or more INITN pins should be wire-ANDed. If one or
more FPGAs or an external device holds INITN low, the FPGA remains in the initialization state.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 13
MachXO2 Programming and Configuration User Guide
Technical Note
5.3. Configuration
The rising edge of the INITN pin causes the FPGA to enter the configuration state. The FPGA is able to accept the
configuration bitstream created by the Diamond development tools.
The MachXO2 begins fetching configuration data from non-volatile memory. The memory used to configure the
MachXO2 is either the internal Flash, or an external SPI Flash. The MachXO2 does not leave the Configuration state if
there are no memories with valid configuration data. It is necessary to program the non-volatile memory internal or
attached to the FPGA, or to program it using the JTAG port. Only JTAG, SSPI and I2C mode are allowed to be used as
programming mode when the device is in a blank/erased state.
During the time the FPGA receives its configuration data the INITN control pin takes on its final function. INITN is used
to indicate an error exists in the configuration data. When INITN is high, configuration proceeds without issue. If INITN
is asserted low, an error has occurred and the FPGA does not operate.
5.4. Wake-up
Wake-up is the transition from configuration mode to user mode. The MachXO2’s fixed four-phase wake-up sequence
starts when the device has correctly received all of its configuration data. When all configuration data is received, the
FPGA asserts an internal DONE status bit. The assertion of the internal DONE causes a Wake Up state machine to run
that sequences four controls. The four control strobes are:
Global Output Enable (GOE)
Global Set/Reset (GSR)
Global Write Disable (GWDISn)
External DONE
The first phase of the Wake-Up process is for the MachXO2 to release the Global Output Enable. When it is asserted,
permits the FPGA’s I/O to exit a high-impedance state and take on their programmed output function. The FPGA inputs
are always active. The input signals are prevented from performing any action on the FPGA flipflops by the assertion of
the Global Set/Reset (GSR).
The second phase of the Wake-Up process releases the Global Set/Reset and the Global Write Disable controls.
The Global Set/Reset is an internal strobe that, when asserted, causes all I/O flip-flops, Look Up Table (LUT) flipflops,
distributed RAM output flip-flops, and Embedded Block RAM output flip-flops that have the GSR enabled attribute to
be set/cleared per their hardware description language definition.
The Global Write Disable is a control that overrides the write enable strobe for all RAM logic inside the FPGA. The
inputs on the FPGA are always active, as mentioned in the Global Output Enable section. Keeping GWDIS asserted
prevents accidental corruption of the instantiated RAM resources inside the FPGA.
The last phase of the Wake-Up process is to assert the external DONE pin. The external DONE is a bi-directional, open-
drain I/O only when it is enabled. An external agent that holds the external DONE pin low prevents the wakeup process
of the MachXO2 from proceeding. Only after the external DONE, if enabled, is active high does the final wake-up phase
complete. Wake-Up completes uninterrupted when the external DONE pin is not enabled.
Once the final wake-up phase is complete, the FPGA enters user mode.
The wake-up process is illustrated in Figure 9.1.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
14 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 15
MachXO2 Programming and Configuration User Guide
Technical Note
128 Bits
Usercode
Feature Row
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
16 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
The Configuration Flash is, for most designs, large enough to store the compressed configuration data that is loaded
into the SRAM configuration memory. However, as the amount of logic in the design increases, and the amount of pre-
initialized EBR increases, the size of the configuration data also increases. The increase in size can cause the
configuration data to overflow into the UFM sector. It is also possible, but unlikely, that the configuration data can get
too large for the internal Flash memory altogether. In the event configuration data grows too large to fit in the
combined Configuration Flash/UFM memory space the design needs to be modified so that it is smaller, or an external
configuration memory must be used. You can provide input to the software generating the configuration data to
prevent the overflow into the UFM.
In the event the configuration data is too large for the combined Configuration Flash and UFM memory you can store
the device bitstream in an external SPI Flash. Table 5.2 shows the maximum uncompressed bitstream sizes allowing
you to select a SPI Flash.
Table 5.2. Maximum Configuration Bits
Device Uncompressed Bitstream Size Uncompressed Bitstream Size Maximum Internal Units
Without EBR With EBR Flash
LCMXO2-256 0.09 N/A 0.071 Mb
LCMXO2-256HC 0.09 N/A 0.071 Mb
LCMXO2-256ZE 0.09 N/A 0.071 Mb
LCMXO2-640 0.19 0.20 0.17 Mb
LCMXO2-640HC 0.19 0.20 0.17 Mb
LCMXO2-640ZE 0.19 0.20 0.17 Mb
LCMXO2-640UHC 0.19 0.20 0.17 Mb
LCMXO2-1200 0.35 0.41 0.33 Mb
LCMXO2-1200HC 0.35 0.41 0.33 Mb
LCMXO2-1200ZE 0.35 0.41 0.33 Mb
LCMXO2-1200UHC 0.35 0.41 0.33 Mb
LCMXO2-2000 0.51 0.58 0.47 Mb
LCMXO2-2000HC 0.51 0.58 0.47 Mb
LCMXO2-2000HE 0.51 0.58 0.47 Mb
LCMXO2-2000ZE 0.51 0.58 0.47 Mb
LCMXO2-2000U 0.51 0.58 0.47 Mb
LCMXO2-2000UHC 0.51 0.58 0.47 Mb
LCMXO2-2000UHE 0.51 0.58 0.47 Mb
LCMXO2-4000 0.93 1.02 0.80 Mb
LCMXO2-4000HE 0.93 1.02 0.80 Mb
LCMXO2-4000HC 0.93 1.02 0.80 Mb
LCMXO2-4000ZE 0.93 1.02 0.80 Mb
LCMXO2-7000 1.47 1.70 1.38 Mb
LCMXO2-7000HE 1.47 1.70 1.38 Mb
LCMXO2-7000HC 1.47 1.70 1.38 Mb
LCMXO2-7000ZE 1.47 1.70 1.38 Mb
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 17
MachXO2 Programming and Configuration User Guide
Technical Note
A relationship of Feature Row option and Diamond Spreadsheet View is shown in Table 5.3 and Table 5.4.
Table 5.3. Feature Row Option and Diamond Spreadsheet View
MASTER_SPI_PORT CONFIGURATION BOOT_SEL[2:1], MSPI_Persistent_Enable
ENABLE CFG1 001
ENABLE EXTERNAL 011
EFB_USER CFG1 000
DISABLE CFG1 000
Note:
CFG includes CFG, CFG_EBRUFM, or CFGUFM.
A full list of the functions controlled by the Feature Row and their default values are shown in Table 5.4.
Table 5.4. MachXO2 Feature Row Elements
Feature SW Default Mode State (Programmed) HW Default Mode State (Erased)
PROGRAMN Persistence Disabled Enabled
INITn Persistence Disabled Disabled
DONE Persistence Disabled Disabled
Custom IDCODE 0x00000000 0x00000000
TraceID™ 00000000 00000000
Security1 OFF OFF
JTAG Port Persistence Enabled Enabled
SSPI Port Persistence Disabled Enabled
I2C Port Persistence Disabled Enabled
MSPI Port Persistence Disabled Disabled
I2C Programmable Primary yyyxxxxx00 1111000000
Configuration Address2, 3
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
18 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 19
MachXO2 Programming and Configuration User Guide
Technical Note
The primary configuration mode, for a majority of MachXO2 designs, is Self-Download Mode. It has an advantage in
configuration speed because the internal configuration clock runs at frequencies higher than can be applied to an
external memory. It does not require an extra PROM, which increases the cost of your product. It does not rely on an
external programmer to load the SRAM using the JTAG port.
The External Download mode’s advantage is that it makes all the User Flash Memory available for your use. You do not
have to be concerned about the Configuration Flash image overflowing into the UFM, or overflowing the available
internal Flash memory.
The Dual Boot mode offers a reliability advantage for the MachXO2. By first loading the internal Flash memory image,
the FPGA can continue to operate even if the initial configuration fails. In such cases, a fail-safe configuration data
image can be downloaded into the MachXO2's SRAM as a backup. The primary cause of a failed reprogramming of the
internal memory is typically a power outage.
The JTAG port’s advantage is that it provides the widest set of functions and features for programming, configuring,
and testing the MachXO2 system.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
20 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 21
MachXO2 Programming and Configuration User Guide
Technical Note
INITN
PROGRAMN
tPRG MJ
PROGRAMN
t IN ITL
INITN tDPPI NIT
INITN
The INITn pin is a bidirectional, open-drain I/O pin only when it is enabled. It has the following functions:
After power is applied, after a PROGRAMN assertion, or a REFRESH command it goes low to indicate the SRAM
configuration memory is being erased. The low time assertion is specified with the tINITL parameter.
After the tINITL time has elapsed the INITn pin is deasserted (that is active high) to indicate the MachXO2 is ready for
its configuration bits. The MachXO2 begins loading configuration data from either the internal Flash memory or an
external SPI Flash.
INITn can be asserted low by an external agent before the tINITL time has elapsed in order to prevent the FPGA from
reading configuration bits. This is useful when there are multiple programmable devices chained together. The
programmable device with the longest tINITL time can hold all other devices in the chain from starting to get data
until it is ready itself.
The last function provided by INITn is to signal an error during the time configuration data is being read. Once tINITL
has elapsed and the INITn pin has gone high, any subsequent INITn assertion signals the MachXO2 has detected an
error during configuration.
The following conditions causes INITN to become active, indicating the Initialization state is active:
Power has just been applied
PROGRAMN falling edge occurred
The IEEE 1532 REFRESH command has been sent using a slave configuration port (JTAG, SSPI, I2C, or WISHBONE).
If the INITN pin is asserted due to an error condition, the error can be cleared by correcting the configuration bitstream
and forcing the FPGA into the Initialization state.
Configuration
Started
PROGRAMN
tIN ITL Configuration
Error
INITN
DONE
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
22 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
The INITN pin of a MachXO2 device is not visible external to the device when in the Feature Row HW Default Mode
state. The INITN pin, when in this mode, is pulled high by default. The INITN behavior described in Figure 5.7 is only
visible outside the MachXO2 when the INITN pin is enabled.
The INITN can be recovered as a general purpose I/O. By default, the INITN pin is disabled. You can use the Diamond
Spreadsheet View to enable it.
If an error is detected when reading the bitstream, INITN goes low, the internal DONE bit is not set, the DONE pin stays
low, and the device does not wake up. The device fails configuration when the following happens:
The bitstream CRC error is detected
The invalid command error detected
A time out error is encountered when loading from the on-chip Flash
The program done command is not received when the end of on-chip SRAM configuration or on-chip Flash
memory is reached
DONE
The DONE pin is a bidirectional open drain with a weak pull-up that signals the FPGA is in User mode.
The DONE pin drives low in tandem with the INITN pin when the FPGA enters Initialization mode. As described earlier,
this condition happens when power is applied, PROGRAMN is asserted, or an IEEE 1532 Refresh command is received
through an active configuration port. During POR and configuration, the DONE pin is driven low.
By default, the DONE pin is a general purpose I/O when the MachXO2 is in the Feature Row HW Default Mode state.
The default mode causes the MachXO2 to automatically sequence through the Wake-Up sequence after the internal
DONE bit is asserted. You can enable the DONE output pin by setting the SDM_port configuration parameter using the
Diamond Spreadsheet view. The FPGA does not stall waking up waiting for the DONE pin to be asserted high.
The DONE pin has the following functions:
Externally driving DONE pin - Easy for Daisy Chaining
The FPGA can be held from entering User mode indefinitely by having an external agent keep the DONE pin
asserted low. To use DONE to stall entering User mode the SDM_PORT must enable the DONE I/O, and the FPGA
Feature Row must be programmed. (This feature is supported in Diamond 3.5 and later. Earlier versions of
Diamond do not enable the stall feature when SDM_PORT enables DONE I/O). A common reason for keeping
DONE driven low is to allow multiple FPGAs to be completely configured. As each FPGA reaches the DONE state, it
is ready to begin operation. The last FPGA to configure can cause all FPGAs to start in unison.
Monitoring DONE pin for status of FPGA configuration.
Sampling the DONE pin is a way for an external device to tell if the FPGA has finished configuration. However,
when using IEEE 1532 JTAG to configure SRAM the DONE pin is driven by a boundary scan cell, so the state of the
DONE pin has no meaning during IEEE 1532 JTAG configuration (once configuration is complete, DONE takes on the
behavior defined by the SDM_PORT setting in the Feature Row). The DONE pin is pulled high when the
configuration is successful, and you can observe this by enabling this pin in the SDM port setting in Diamond
software. If the DONE pin is enabled using the SDM port setting the DONE pin is pulled high as soon as
configuration is complete, and this behavior can make a part appear to be successfully configured to other logic
monitoring the DONE pin.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 23
MachXO2 Programming and Configuration User Guide
Technical Note
MCLK/CCLK
The MCLK/CCLK, when active, are clocks used to sequentially load the configuration data for the FPGA. The pin
functions as:
The MCLK/CCLK pin’s default state for a MachXO2 in the Feature Row HW Default Mode state is to act as the
configuration clock (such as CCLK). This allows an external Slave SPI master controller to program the MachXO2. The
maximum CCLK frequency and the data setup/hold parameters can be found in the AC timing section of MachXO2
Family Data Sheet (FPGA-DS-02056). The Feature Row must be configured to ENABLE the Slave SPI Port if you want to
use the port to reprogram the MachXO2 after it enters user mode.
The MCLK/CCLK pin functions as a Master Clock (MCLK) when the MachXO2 is configured in Dual Boot or External Boot
modes. A 1K pull-up resistor is required when using these modes. The MCLK becomes an output and provides a
reference clock for a SPI Flash attached to the MachXO2’s Master SPI Configuration port. MCLK actively drives until all
the configuration data has been received. When the MachXO2 enters user mode the MCLK output tristates. This allows
the MCLK to become a general purpose I/O. The MCLK is reserved for use, in most post-configuration applications, as
the reference clock for performing memory transactions with the external SPI PROM.
The MachXO2 generates MCLK from an internal oscillator. The initial frequency of the MCLK is nominally 2.08 MHz. The
MCLK frequency can be altered using the MCCLK_FREQ parameter. You can select the MCCLK_FREQ using the Diamond
Spreadsheet View. For a complete list of the supported MCLK frequencies, see Table 5.11.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
24 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
During the initial stages of device configuration, the frequency value specified using MCCLK_FREQ is loaded into the
FPGA. Once the MachXO2 accepts the new MCLK_FREQ value the MCLK output begins driving the selected frequency.
Make certain when selecting the MCLK_FREQ that you do not exceed the frequency specification of your configuration
memory, or of your PCB. Review the MachXO2 AC specifications in MachXO2 Family Data Sheet (FPGA-DS-02056) when
making MCLK_FREQ decisions.
SN
The SN pin is the Slave SPI ports chip select. An external SPI bus master asserts the SN pin active low to perform actions
using the MachXO2’s programming and configuration logic. The SN pin is available when the MachXO2 is in the Feature
Row HW Default Mode state, and in user mode when the Slave SPI port is set to the ENABLE setting. The SN pin is a
general purpose I/O in user mode when the Slave SPI port is set to the DISABLE setting.
Proper operation of the MachXO2 depends upon maintaining the SN pin in the correct state:
SN must be deasserted (that is, held High) when configuring using Master SPI mode. SN signal needs to be clean
during power up. Noise on SN pins may cause device failing to download from flash. SN must be asserted when
configuring using Slave SPI mode.
SN must be deasserted when the MachXO2 is in user mode, and SPI memory transactions are initiated using the
internal WISHBONE bus.
SN must be deasserted when accessing the Configuration Logic in the MachXO2 using I2C.
When SN is asserted, CSSPIN must be deasserted. Deasserting CSSPIN places the shared SPI pins into a high
impedance state.
The Master SPI port and the Slave SPI port share three common pins, SI/SISPI, SO/SPISO, and MCLK/CCLK. The
MachXO2 permits both ports to be available at the same time. They are not permitted to be accessed at the
same time. The Slave SPI and the Master SPI port must be time multiplexed when both ports are enabled.
SN must be deasserted, even if recovered for GPIO, whenever the Feature Row is Erased through the I2C
sysCONFIG port (for example, embedded reconfiguration). If asserted, configuration may not complete
successfully. Lattice recommends the SN pin be pulled high externally to augment the weak internal pull-up.
CSSPIN
The CSSPIN pin is an active low chip select used by the Master SPI configuration mode to enable an external SPI Flash.
When the MachXO2 is programmed to configure in either External or Dual Boot mode the CSSPIN pin is asserted to the
attached SPI Flash. The MachXO2 asserts CSSPIN until all configuration data bytes have been loaded, at which time the
CSSPIN enters a high impedance state.
When the MachXO2 is in the Feature Row HW Default Mode state the CSSPIN is a general purpose I/O with a weak
pulldown. It must have an external pull-up resistor when the External and Dual Boot configuration modes are used.
CSSPIN must ramp in tandem with the SPI PROM VCC input. It remains a general purpose I/O when the FPGA enters
user mode. You must ENABLE the Master SPI port to reserve CSSPIN for use by the internal SPI Master logic.
When configuring from an external SPI Flash, ensure that the SPI Flash VCC and the MachXO2 VCCIO2 are at the same
level. Ensure that the SPI Flash VCC meets is at the recommended operating level.
Some SPI PROM manufacturers require the chip select input of the PROM ramp in unison to the PROMs VCC rail. The
CSSPIN pin, by default, has a weak pull-down resistor internally. Adding a 4.7 kΩ to 10 kΩ pull-up resistor to the CSSPIN
pin on the MachXO2 is recommended.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 25
MachXO2 Programming and Configuration User Guide
Technical Note
SI/SISPI
The SI/SISPI is a dual function bidirectional pin. The direction depends upon whether a Master or Slave mode is active.
The SI/SISPI is an input data pin when using the Slave SPI mode and is an output data pin when using the Master SPI
mode. In Master SPI mode, the MachXO2 drives SI/SISPI until all configuration data bytes have been loaded, at which
time the SI/SISPI enters a high impedance state.
At least one of the sysCONFIG preferences, SLAVE_SPI_PORT or MASTER_SPI_PORT, must be set to ENABLE to preserve
this pin as SI/SISPI and allow access to the SPI interface.
SO/SPISO
The SO/SPISO pin is a dual function bidirectional pin. The direction depends upon whether a Master or Slave mode is
active. The SO/SPISO is an input data pin when using the Master SPI mode and is an output data pin when using the
Slave SPI mode.
At least one of the sysCONFIG preferences, SLAVE_SPI_PORT or MASTER_SPI_PORT, must be set to ENABLE to preserve
this pin as SO/SPISO and allow access to the SPI interface.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
26 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
When the device is programmed through IEEE 1149.1 control, the sysCONFIG programming pins, such as DONE, cannot
be used to determine programming progress. This is because the state of the boundary scan cell drives the pin, per the
IEEE JTAG standard, rather than normal internal logic.
Table 5.12. JTAG Port Pins
Pin Name Pin Function Pin Direction (Configuration Mode) Default Function (User
(Configuration Mode) Mode)
TDI TDI Input with weak pull-up TDI
TDO TDO Output with weak pull-up TDO
TCK TCK Input TCK
TMS TMS Input with weak pull-up TMS
JTAGENB I/O Input/output with weak pull-down I/O
TDO
The Test Data Output (TDO) pin is used to shift out serial test instructions and data. When TDO is not being driven by
the internal circuitry, the pin is in a high impedance state. The only time TDO is not in a high impedance state is when
the JTAG state machine is in the Shift IR or Shift DR state. This pin should be wired to TDO of the JTAG connector, or to
TDI of a downstream device in a JTAG chain. An internal pull-up resistor on the TDO pin is provided. The internal
resistor is pulled up to VCCIO Bank 0.
TDI
The Test Data Input (TDI) pin is used to shift in serial test instructions and data. This pin should be wired to TDI of the
JTAG connector, or to TDO of an upstream device in a JTAG chain. An internal pull-up resistor on the TDI pin is
provided. The internal resistor is pulled up to VCCIO of Bank 0.
TMS
The Test Mode Select (TMS) pin is an input pin that controls the progression through the 1149.1 compliant state
machine states. The TMS pin is sampled on the rising edge of TCK. The JTAG state machine remains in or transitions to
a new TAP state depending on the current state of the TAP, and the present state of the TMS input. An internal pull-up
resistor is present on TMS per the JTAG specification. The internal resistor is pulled to the VCCIO of Bank 0.
TCK
The test clock pin (TCK) provides the clock used to time the other JTAG port pins. Data is shifted into the instruction or
data registers on the rising edge of TCK and shifted out on the falling edge of TCK. The TAP is a static design permitting
TCK to be stopped in either the high or low state. The maximum input frequency for TCK is specified in the DC and
Switching Characteristics section of MachXO2 Family Data Sheet (FPGA-DS-02056). The TCK pin does not have a pull-up.
An external pull-down resistor of 4.7 kΩs is recommended to avoid inadvertently clocking the TAP controller as power
is applied to the MachXO2.
JTAGENB
The JTAG ENABLE pin, also known as the IEEE 1149.1 conformance pin, is an input pin that can be used to multiplex the
JTAG port. The JTAGENB pin is only active in user mode. The JTAGENB pin is a user I/O while the JTAG port is in the
ENABLE state. Figure 5.8 shows the default behavior of the JTAG port of a MachXO2 device.
MachXO2
TCK TCK/IO
TMS TMS/IO
TDI TDI/IO
TDO TDO/IO
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 27
MachXO2 Programming and Configuration User Guide
Technical Note
The JTAG port can become general purpose I/O. By setting the JTAG_PORT preference in the Diamond Spreadsheet
View to the DISABLED state. When the JTAG port is in the DISABLED state the JTAGENB pin becomes a dedicated input.
Driving the JTAGENB low disables the JTAG port and the four JTAG pins become general purpose I/O. Driving the
JTAGENB input high enables the JTAG port. Figure 5.9 shows JTAG port behavior under the control of the JTAGENB.
Ma c h X O 2 Ma c h X O 2
V CCIO
JTAGE N B = ‘1’
It is critical when using the JTAGENB feature that logic attached to the JTAG I/O pins not contend with a JTAG
programming system. The external logic must ignore any JTAG transactions performed by an external programming
system.
Lattice parallel port or USB download cables provide an output called ispEN. The ispEN signal can be attached to the
JTAGENB input to control the availability of the JTAG port. An alternate mechanism to control the JTAGENB input is to
use a shunt that can be installed or removed as required.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
28 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
6. Configuration Modes
The MachXO2 provides multiple options for loading the configuration SRAM from a non-volatile memory. The previous
section described the physical interface necessary to interact with the MachXO2 configuration logic. This section
focuses on describing the functionality of each of the different configuration modes. Descriptions of important settings
required in the Diamond Spreadsheet View are also discussed.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 29
MachXO2 Programming and Configuration User Guide
Technical Note
In all three cases, the UFM can only be erased by erasing the whole sector. It is your responsibility to restore
configuration data, EBR initialization data, and your implementation specific data. In other words, you need to read all
data in the UFM, merge your changes, erase the UFM, and write the new data back into the UFM.
Table 5.2 provides information about the amount of memory needed for MachXO2 configuration data by device
density. Select a SPI Flash that accepts 03 hex Read Opcodes. The MachXO2 is only able to use the 03 hex Read
Opcode.
MachXO2
MCLK
SPISO Configuration
SISPI
CSSPIN Logic
SPI PROM
C
Q SPI
D Controller
MachXO2
WISHBONE Logic
/CS
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
30 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
The MachXO2 begins retrieving configuration data from the SPI Flash when power is applied, a REFRESH command is
received, or the PROGRAMN pin is asserted and released. The MCLK/CCLK I/O takes on the Master Clock (MCLK)
function, and begins driving a nominal 2.08 MHz clock to the SPI Flash’s SCLK input. CSSPIN is asserted low, commands
are transmitted to the PROM over the SI/SISPI output, and data is read from the PROM on the SO/SPISO input pin.
When all of the configuration data is retrieved from the PROM the CSSPIN pin is deasserted, and the MSPI output pins
are tristated.
The MCLK frequency always starts downloading the configuration data at the nominal 2.08 MHz frequency. The
MCCLK_FREQ parameter, accessed using Spreadsheet View, can be used to increase the configuration frequency. The
configuration data in the PROM has some padding bits, and then the data altering the MCLK base frequency is read.
The MachXO2 reads the remaining configuration data bytes using the new MCLK frequency.
After the MachXO2 enters user mode the Master SPI configuration port pins tristate. This allows data transfers across
the SPI. There are two primary methods available for transferring data across the SPI bus. The first method available to
you is to enable the EFB in the MachXO2. Using IPexpress™ you instantiate the EFB, and you choose the features you
want active. One of the features available in the EFB is a SPI Master Controller. The SPI Master Controller in the EFB
attaches directly Master SPI configuration port pins. The controller provides a set of status, control, and data registers
for initiating SPI bus transactions. The registers are accessed using the internal WISHBONE data bus. Logic residing in
the programmable section of the MachXO2 can be created to perform transactions across the WISHBONE bridge to the
EFB, which in turn generate SPI bus transactions.
The second way to perform Master SPI configuration port transactions is to master them from the JTAG port. The
MachXO2 includes a JTAG to MSPI passthru circuit that allows the slave SPI Flash to be erased, programmed, and read.
The primary method for programming the attached SPI Flash is to use Diamond Programmer to transfer a configuration
data file from your personal computer. This is useful during board development and debug.
Note: To support JTAG to MSPI passthru programming mode, a 1 KΩ pull-up resister is required on MCLK.
Another way to program a SPI Flash using the JTAG port is to use the Lattice ispVME solution. ispVME is C code written
for an embedded microprocessor. The microprocessor reads a data file crafted by the Diamond Deployment Tool, and
runs the ispVME code. The firmware uses port I/O to drive the JTAG port of the MachXO2, which in turn passes the
data to the Master SPI port. Refer to the ispVME tool suite for information about updating an attached SPI Flash using a
microprocessor.
The advantage of using the JTAG port for programming the SPI Flash attached to the MachXO2 is that the MachXO2 is
permitted to be in the Feature Row HW Default Mode state. JTAG is able to program a device in Flash Mode Feature
Row or User Mode Feature Row state. In order to do so, the Master SPI port pins must be enabled. The passthru is an
integral part of the JTAG TAP system. Obviously, the JTAG port must be available in order for this method to succeed.
To set the MachXO2 for operation using the MSPI configuration mode you must:
Store the entire configuration data in an external SPI Flash
The data must start at offset 0x000000 within the PROM
Set the preferences as shown in Table 6.2
Enable JEDEC and Bitstream File creation in the Diamond Process Pane
Run the Export Files process to build your design
Table 6.2. Master SPI Configuration Software Settings
Preference Setting
MASTER_SPI_PORT ENABLE
CONFIGURATION EXTERNAL
The Export Files process generates both a JEDEC file and BIT file. It is important that both files be used. The JEDEC file
must be programmed into the MachXO2 in order to write the Feature Row. The JEDEC file enables the MSPI
configuration port.
The BIT file must be programmed into the external SPI Flash. There are several ways to get the data into the SPI Flash:
Diamond Programmer can transmit the SPI Flash data using a JTAG download cable
A microprocessor running ispVME
Automatic Test Equipment can program the SPI Flash using JTAG
Pre-programmed SPI Flash memories can be pre-assembled onto your printed-circuit board
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 31
MachXO2 Programming and Configuration User Guide
Technical Note
Once the MachXO2 Feature Row is programmed, and the SPI Flash contains your configuration data, you can test the
configuration. Assert the PROGRAMN, transmit a REFRESH command, or cycle power to the board, and the MachXO2
configures from the external SPI Flash.
VCCIO
INITN
Dual boot configuration mode typically requires two configuration data files. One of the two configuration data files is a
fail-safe image that is rarely, if ever, updated. The second configuration data file is a working image that is routinely
updated. The working image is stored in the Configuration Flash; the fail-safe image is stored in the external SPI
memory. One Diamond project can be used to create both the working and the fail-safe configuration data files.
Configure the Diamond project with an implementation named working, and an implementation named failsafe. Read
the Diamond Online Help for more information about using Diamond implementations.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
32 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
Diamond creates a JEDEC as well as a Bitstream file for the primary configuration data that is stored in the internal
Flash memory. A BIT file is created for the golden configuration data that is stored in the external SPI Flash. The golden
configuration data must be located in the external SPI Flash starting at address 0x010000. This differs from a single
image Master SPI Configuration Mode, which requires the configuration data be stored at offset 0x000000.
The following are the recommended processes for programming internal and external flash to use Dual Boot Mode:
Option A – Using background mode to program external flash:
Program MachXO2 internal flash (using Flash Programming Mode). Make sure SPI port enabled and persistent on.
Program the external SPI flash in background mode.
Refresh or power cycle.
Option B – Using offline mode to program external SPI flash:
Program the external SPI flash first (may be none-background mode).
Program MachXO2 internal flash (using Flash Programming Mode).
Refresh or power cycle.
To prevent the MachXO2 from using dual boot mode when using the User Master SPI controller, set the
MASTER_SPI_PORT preference to EFB_USER. This reserves the Master SPI configuration port pins and prevents dual-
boot.
In the Slave SPI mode, the MCLK/CCLK pin becomes CCLK (i.e. Configuration clock). Input data is read into the MachXO2
device on the SI pin at the rising edge of CCLK. Output data is valid on the SO pin at the falling edge of CCLK. The SN
acts as the chip select signal. When SN is high, the SSPI interface is deselected and the SO/SPISO pin is tristated.
Commands can be written into and data read from the MachXO2 when SN is asserted. The MachXO2 SSPI port only
accepts Mode 0 bus transactions to the Configuration Logic.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 33
MachXO2 Programming and Configuration User Guide
Technical Note
MachXO2
Flash Memory
CCLK
SI
SPI Configuration
SO
SN Controller Logic
μC WISHBONE
SPI Port
CLK
DI
DO MachXO2
Logic
CSN
The SSPI port is active when the MachXO2 is in Feature Row HW Default Mode state (that is, blank/erased). Diamond’s
default preference for the SLAVE_SPI_PORT is to DISABLE the port. Use the Spreadsheet View to ENABLE the
SLAVE_SPI_PORT preference in your design to keep the SSPI port active in user mode. Lattice recommends you keep a
secondary programming port active in the event the SSPI port is accidentally disabled.
The SSPI port is used to erase, program, and verify the Configuration Flash, User Flash Memory, and the Feature Row. It
is not capable of directly accessing the configuration SRAM. To prevent unintentional erasure of the Feature Row, it is
recommended the SSPI port be used to perform transparent updates of the Flash memory. The SSPI port can issue a
REFRESH command to make a newly programmed image active. The REFRESH command can be safely used when the
MachXO2 is using External or Dual Boot configuration mode because the REFRESH operation does not begin until SN is
deasserted.
Programming the MachXO2 using the SSPI port is complex. Lattice provides C source code called SSPIEmbedded to
insulate you from the complexity of programming the MachXO2. It is recommended that SSPIEmbedded be used when
you want to reprogram the MachXO2 Flash memory.
In addition to reprogramming the Flash memory the SSPI port can be used to access several status and control registers
in the MachXO2. A list of the available commands and information about the registers is described in Using User Flash
Memory and Hardened Control Functions in MachXO2 Devices (FPGA-TN-02162). Accessing the status registers is less
complex and does not require the use of the SSPIEmbedded code.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
34 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
The I2C Configuration port is available when the MachXO2 is in Feature Row HW Default Mode state (that is,
blank/erased). The default state set for the I2C_PORT in the Diamond design software is to place the I2C_PORT in the
DISABLE state. You must make sure the I2C_PORT is set to the ENABLE state to leave the I2C interface active in user
mode. Lattice recommends making a second configuration port available (such as JTAG) in order to recover from
erroneously disabling the I2C port.
Flash
Memory
Configuration
Logic
I2 C 2 I2 C
Master Interface
MachXO2
Logic
There are two hardened I2C controllers in a MachXO2 device, a primary and a secondary. The primary controller
provides an interface to the MachXO2 Configuration Logic, and access to Wishbone registers. Access to the Wishbone
registers is referred to as User Mode I2C. The primary I2C controller is the only one that permits access to the
Configuration Logic. The Secondary I2C controller is always a User Mode I2C controller.
When the MachXO2 is in Feature Row HW Default Mode state the I2C port is enabled, and you may interact with the
primary I2C controller. Whenever the I2C port is enabled access to the Configuration Logic is possible. Instantiate the
Embedded Function Block (EFB) to enable I2C port access to the Configuration Logic in User Mode. Moreover, when
instantiated, the EFB wb_clk_i input must be connected to a valid clock source of at least 7.5x the I2C bus rate (for
example, >3.0 MHz when I2C rate = 400 kHz).
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 35
MachXO2 Programming and Configuration User Guide
Technical Note
The Primary I2C controller provides access to the Configuration Logic when:
The MachXO2 is in Feature Row HW Default Mode state
The EFB is instantiated with wb_clk_i input connected to a valid clock source of at least 7.5x the I2C bus rate, and
the I2C port pins are in the ENABLE state
To enable the I2C pin ports, declare two bidirectional ports, e.g., "SCL", & "SDA", in your top module, and connect
these ports to EFB's I2C ports. The device will continue to operate on the I2C port when programmed with the
resulting bitstream. This allows the user to reprogram the device via I2C, even in user mode.
An external I2C master accesses the Configuration Logic using address 1000000 (7-bit mode) or 1111000000 (10- bit
mode) unless the EFB I2C base address has been modified. Use IPexpress, not Spreadsheet View, to modify the address
to which the Primary and Secondary I2C controllers respond. It is necessary to instantiate the EFB in order to change
the address. The address is shared by the Primary and Secondary I2C controllers.
Table 6.5 shows the address decoding used to access the I2C resources in the MachXO2.
Table 6.5. Slave Addresses for I2C Ports1
Slave Address I2C Function
yyyxxxxx00 Primary I2C Controller Configuration Logic address. Always responds to 7-bit or 10-bit addresses.
yyyxxxxx01 User Mode Primary I2C Controller address.
yyyxxxxx10 User Mode Secondary I2C Controller address.
yyyxxxxx11 Primary I2C Configuration Logic Reset. Always responds to 7-bit or 10-bit addresses.
Notes:
Although there are eight possible combinations of the reserved address bits 1111 XXX, only the four combinations 1111 0XX are
used for 10-bit addressing. The remaining four combinations 1111 1XX are reserved for future I2C-bus enhancements.
The Slave I2C addresses will ACK under all circumstances even if not all ports are configured to be active by the user.
The Primary I2C core can be used for accessing the User Flash Memory (UFM) and for programming the Configuration
Flash. However, the Primary I2C port cannot be used for both UFM/Configuration access and User functions in the same
design. The operation of the User Mode Primary and User Mode Secondary I2C controllers is described in Using User
Flash Memory and Hardened Control Functions in MachXO2 Devices (FPGA-TN-02162). Interacting with these I2C slave
devices is not covered in this document.
The fourth I2C resource in the MachXO2 is located at offset 3. In some instances, an I2C memory transaction to the
configuration logic may be interrupted or abandoned. It is possible for a command to be accepted by the configuration
logic that causes the configuration logic to respond with data. In the event that the I2C memory transaction is
interrupted or abandoned, the configuration logic continues to return the queued data. New incoming I2C commands
may be considered padding bytes or may be misinterpreted. Clear this condition by writing any value to offset 3. The
configuration logic command interpreter resets, any queued data is flushed, and subsequent I2C memory transactions
to the Configuration Logic operates correctly.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
36 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
Flash
Memory
Configuration
Logic
WISHBONE
Interface
MachXO2
Logic
The MachXO2 must be in user mode in order to access the WISHBONE interface. Accessing and updating the resources
made available by the configuration logic must be done in Transparent mode. Attempting accesses to the configuration
logic in offline mode causes a deadlock because the MachXO2 leaves user mode.
You can get more detailed information about the MachXO2 WISHBONE interface by reading Using User Flash Memory
and Hardened Control Functions in MachXO2 Devices (FPGA-TN-02162).
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 37
MachXO2 Programming and Configuration User Guide
Technical Note
The MachXO2 JTAG port is a valuable asset due to its flexibility. It provides the best capabilities for system and device
debug. Lattice recommends the JTAG port remain accessible in every MachXO2 design. Advantages for keeping the
JTAG port active include:
Multi-chain Architectures – The JTAG port is the only configuration and programming port that permits the
MachXO2 to be combined in a chain of other programmable logic.
Reveal Debug – The Lattice Reveal debug tool is an embeddable logic analyzer tool. It allows you to analyze the
logic inside the MachXO2 in the same fashion as an external logic analyzer permits analysis of board level logic.
Reveal access is only available through the MachXO2 JTAG port.
SRAM Readback – The JTAG port is the only sysCONFIG port able to directly access the MachXO2’s configuration
SRAM. It is occasionally necessary to perform failure analysis for SRAM based FPGAs. A key component to failure
analysis can involve reading the configuration SRAM. This kind of failure analysis is lost when the JTAG port is not
enabled.
Boundary Scan Testability – Board level connectivity testing performed using IEEE 1149.1 JTAG is a key capability
for assuring the quality of assembled printed-circuit-boards. Preserving the MachXO2 JTAG port is vital for
boundary scan testability. Lattice provides Boundary Scan Description Language files for the MachXO2 on the
Lattice website.
MachXO2
System Board
The example assumes that you have the golden image stored in Flash in order to initiate the system, and then used SPI
PROM as a resource for image updates without disturbing the system. Figure 7.3 shows the process flow for
performing this task.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
38 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
S ystem running
Assume MachXO2
Flash has been
programmed and
Program SPI PROM
1 running
with ne w pat tern
Halt sy s clk 6
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 39
MachXO2 Programming and Configuration User Guide
Technical Note
Figure 8.1. sysCONFIG Preferences in Global Preferences Tab, Diamond Spreadsheet View
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
40 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 41
MachXO2 Programming and Configuration User Guide
Technical Note
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
42 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
8.1.7. ENABLE_TRANSFR
The TransFR function used by the MachXO2 requires the configuration data loaded into the configuration SRAM, and
any future configuration data file loaded into the internal Flash memory have the ENABLE_TRANSFR set to the ENABLE
state. See the TransFR Operation section, and Minimizing System Interruption During Configuration Using TransFR
Technology (FPGA-TN-02025-37) for more information about using TransFR with the MachXO2.
8.2.1. COMPRESS_CONFIG
The COMPRESS_CONFIG preference alters the way JEDEC and BIT files are generated. The COMPRESS_CONFIG default
setting is to be ON.
JEDEC files, when they are built, are always compressed. The configuration time is slightly reduced when reading
configuration data from the external PROM and the Diamond tool creates a JEDEC file you can program into the
internal Flash memory.
8.2.2. CONFIGURATION
The CONFIGURATION preference allows you to control the Configuration Flash and UFM sectors. The CONFIGURATION
preference has four possible settings:
CFG – The CFG preference is the default mode for building configuration data. The configuration bitstream is
stored in the Configuration Flash and is not permitted to overflow into the UFM sector. The configuration data
includes EBR initialization data. The UFM sector is available for your use as general purpose Flash memory in user
mode.
CFG_EBRUFM – This preference creates configuration data that is stored in the Configuration Flash. EBR
initialization data is stored in the lowest page addresses of the UFM sector. The UFM sector is available in user
mode. You must restore the EBR initialization data when making changes to the UFM to guarantee correct
operation.
CFGUFM – This preference creates configuration data that is stored in the Configuration Flash. This mode differs
from CFG by allowing the configuration data to overflow into the UFM. The configuration data increases in size as
EBR initialization data is added to the design.
EXTERNAL – This preference generates configuration data that is stored in an external memory. The UFM sector is
available as general purpose Flash memory in user mode.
The CONFIGURATION preference defaults to the CFG state in the current release of the Diamond software. The
Diamond design software only generates JEDEC files when your entire design fits within the Configuration Flash
memory. The UFM is guaranteed to be available when the MachXO2 device enters user mode.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 43
MachXO2 Programming and Configuration User Guide
Technical Note
In the event the configuration data does not fit in the Configuration Flash memory, try using the CFG_EBRUFM
preference. This preference works well if your design has a significant amount of initialized EBR, and you still want
access to UFM pages to store data. Depending on the amount of initialized EBR the UFM may still have sufficient space
available for storing your data.
Use the CFGUFM option when the Configuration Flash is not large enough to store the configuration data, and you do
not need to use UFM for storing your own data. It is possible, in rare instances, for the size of the configuration data to
exceed the combined space of the Configuration Flash and UFM.
Use the EXTERNAL preference to build configuration data for use with Master SPI Configuration Mode. When the
configuration data exceeds the combined space available in the Configuration Flash and UFM it is necessary to switch
to EXTERNAL mode. EXTERNAL mode does not use any Configuration Flash or UFM resources. The UFM is available for
your use in user mode.
The MachXO2-256 device does not contain any UFM. The only configuration options available to this device are the
CFG and EXTERNAL modes.
8.2.3. USERCODE
The MachXO2 Configuration Flash sector contains a 32-bit register for storing a user-defined value. The default value
stored in the register is 0x00000000. Using the USERCODE preference you can assign any value to the register you
desire. Suggested uses include the configuration data version number, a manufacturing ID code, date of assembly, or
the JEDEC file checksum.
The format of the USERCODE field is controlled using the USERCODE_FORMAT preference. Data entry can be
performed in either Binary, Hex, or ASCII formats.
8.2.4. USERCODE_FORMAT
The USERCODE_FORMAT preference selects the format for the data field used to assign a value in the USERCODE
preference. The USERCODE_FORMAT has three options:
Binary – USERCODE is set using 32 1 or 0 characters.
Hex – USERCODE is set using eight hexadecimal digits (that is 0-9A-F)
ASCII – USERCODE is set using up to four ASCII characters
8.2.5. CUSTOM_IDCODE
The CUSTOM_IDCODE preference is used to assign a 32-bit register that resides in the Feature Row. The
CUSTOM_IDCODE field is only active when the MY_ASSP preference is in the ON state. The value assigned can be
entered in binary or hexadecimal, according to the CUSTOM_IDCODE_FORMAT preference. See the MY_ASSP section
for more information about how to assign a value to the CUSTOM_IDCODE preference.
8.2.6. CUSTOM_IDCODE_FORMAT
The CUSTOM_IDCODE_FORMAT preference selects the format for the data field used to assign a value in the
CUSTOM_IDCODE preference. The CUSTOM_IDCODE_FORMAT has two options:
Binary – CUSTOM_IDCODE is set using 32 1 or 0 characters.
Hex – CUSTOM_IDCODE is set using eight hexadecimal digits (that is 0-9A-F)
8.2.7. SHAREDEBRINIT
When set to ENABLE, this preference allows one copy of a unique memory initialization file to be stored in the Flash
memory. This copy of the initialization values can be shared among multiple EBRs. Doing so reduces the bitstream size
of the design and saves UFM space for other applications.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
44 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
8.2.8. MUX_CONFIGURATION_PORTS
The MUX_CONFIGURATION_PORTS is used in the event that all configuration ports are disabled. Disabling all of the
available configuration ports turns the MachXO2 into a write one time device. MUX_CONFIGURATION_PORTS confirms
the removal of all configuration ports. The control is only active when all of the configuration ports are set to the
ENABLE state. MUX_CONFIGURATION_PORTS set to the ENABLE state enables the JTAGENB input pin, permitting the
JTAG port pins to be multiplexed. Setting MUX_CONFIGURATION_PORTS to the ENABLE state causes the Diamond build
tools to honor the removal of all configuration ports. If the JTAGENB input pin is hard connected to GND on the PCB,
this allows the MachXO2 to become a write one time device. In other application scenarios, you can control the
JTAGENB to provide dynamic selection between the JTAG port and GPIO.
8.3.1. TRACEID
The MachXO2 introduces a new feature called TraceID. TraceID stamps each MachXO2 with a unique 64-bit ID. No two
MachXO2 devices has the same TraceID value even when they are loaded with the same configuration data. This differs
from a USERCODE which is present in the configuration data. Every device that receives the configuration data using a
USERCODE receives the same USERCODE value.
The TraceID is 64 bits long with the least significant 56 bits being immutable data. The 56 bits are a combination of the
wafer lot, the wafer number and the X/Y coordinates locating the die on the wafer. The most significant eight bits are
provided by you and are stored in the Feature Row. The TraceID is changed using the Diamond Spreadsheet View. You
enter a unique 8-bit binary value in the TraceID field and generate configuration data.
You can read more about the TraceID feature in Using TraceID in MachXO2 Devices (FPGA-TN-02027-1.8).
8.3.2. MY_ASSP
Every Lattice device has its own identification code identifying the device family, device density, and other parameters
(such as voltage, device stepping, and others.). The code is accessible from any MachXO2 configuration port. The value
stored in the IDCODE register allows you to uniquely identify a Lattice device.
The MY_ASSP preference permits you to change the value returned when the IDCODE is read from the FPGA. Set the
MY_ASSP preference to the ON state. Turning the MY_ASSP ON enables the CUSTOM_IDCODE preference.
8.3.3. CUSTOM_IDCODE
The CUSTOM_IDCODE is the value you assign to override the default IDCODE in the MachXO2 device. You are only
allowed to enter a 32-bit hexadecimal or binary value when the MY_ASSP preference is ON.
Overriding the IDCODE prevents the Lattice programming software from being able to identify the MachXO2 device,
and as a result, prevents Programmer from being able to directly program the MachXO2 device. It is necessary to
migrate to generating Serial Vector Format (SVF) files in order to program MY_ASSP enabled MachXO2 devices.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 45
MachXO2 Programming and Configuration User Guide
Technical Note
8.3.4. CONFIG_SECURE
When this preference set to ON, the read-back of the SRAM memory and the Flash memory are blocked using any of
the sysCONFIG ports (JTAG, SPI, I²C, WISHBONE). Note that all other functions using sysCONFIG ports (JTAG, SPI, I²C,
WISHBONE) are operational except read-back as mentioned earlier.
In MachXO2 devices, the read-back is also be blocked if UFM contains overflow configuration data. The MachXO2
device cannot be read back, nor can it be programmed without erasing. The device must be erased in order to reset the
security setting. The CONFIG_SECURE fuse and the Flash are erased in tandem. Once the security fuses are reset, the
device can be programmed again.
8.3.5. ONE_TIME_PROGRAM
The MachXO2 has One Time Programmable (OTP) fuses that can be used to prevent the on-chip memory from being
erased or programmed. The MachXO2 device has three OTP security fuses, one for each of the following memory
sectors: SRAM, Configuration Flash, and UFM. This preference provides options to set the OTP security for each
memory sector.
FLASH – The Configuration Flash cannot be erased or programmed.
FLASH_UFM – The Configuration Flash and UFM cannot be erased or programmed.
FLASH_UFM_SRAM – The Configuration Flash, UFM, and SRAM cannot be erased or programmed.
Once the ONE_TIME_PROGRAM preference is set for the Flash memory, the on-chip Flash memory cannot be erased or
programmed. The configuration data is prevented from further modification, but the SDM mode can still be used to
configure the device.
When the ONE_TIME_PROGRAM preference is set for the FLASH_UFM_SRAM memory, the device acts like an ASIC.
You are no longer able to reprogram the internal Flash or UFM, and the SRAM cannot be changed from the JTAG port.
Configuration of SRAM from on-chip Flash memory or external SPI Flash is still enabled.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
46 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 47
MachXO2 Programming and Configuration User Guide
Technical Note
Verilog
module START (STARTCLK);
input STARTCLK;
endmodule
begin
u1: START port map (STARTCLK =><clock name>);
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
48 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 49
MachXO2 Programming and Configuration User Guide
Technical Note
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
50 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 51
MachXO2 Programming and Configuration User Guide
Technical Note
*
NOTE Diamond_1.2_Production (92) JEDEC Compati bl e Fuse File.*
NOTE Copyri ght (C), 1992-2010, Latt ice Semiconductor Corporation.*
NOTE All Right s Reserv ed.*
NOTE DATE CR EATED:Fri Dec 02 14:50:08 2011*
NOTE DESIGN NAME:control_SoC_demo_impl1.ncd*
NOTE DEVICE NAME:LCMXO2-1200ZE-1CSBGA132ES*
NOTE TRACEID 0x84*
NOTE LVDS_72P M9*
NOTE LVDS_72N N10*
NOTE LVDS_68P P8*
NOTE LVDS_68N M8*
NOTE PIN ASSIGNMENTS*
NOTE PINS cap_btn1 : M10 : inout*
NOTE PINS LCD_COM0 : B14 : out*
NOTE PINS xout : N7 : out*
...
NOTE PINS xin : M5 : in*
NOTE PINS Icc_analog_cmp_p : P8 : in*
QP132*
QF343936*
G0*
F0*
L000000
1111111111111111101111011011001111111111111111110011101100000000000000000000000000000010000000000000000000000000001100000000011 0
0100001001010000100100000100100000001001111111110100011000000000000000000000000010111000111000000000000101001101000000000000000 0
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0
0000000000001000100010001000000000000100010000000000001000100000000000010001000000000100010001000100000010001000000100010000000 0
0100010001000100000010001000000000000000000100010000000000000000000000000000000000000000000010001000100100000000000001001000000 0
0000001001000000000000010010000000000100010001001000000010010000000100100000000001000100010010000000100100000000000000000001001 0
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0
...
0000000000000000000000000000000000000000101111010110101011111111111111111111111111111111111111111111111111111111111111110111001 0
0001000001000000000001011100000000000000000110000000000000000000011100100001000001010100000010100000000010000000000000010000100 1
1111111000000000000000000000000000000000000000001100001010000000000000000000000011001010111111101011101010111110111100010100010 0
0010001000000000000000000000000011000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111 1
*
NOTE EBR_INIT DATA*
L137984
1111111111111111111111111111111111110110000000000000000000000000000000000000000000011000000000001011001000010000000000001000000 0
0001111010001111010001111010001111010001111010001111010001111010001111010001111010001111010001111010001111010001111010001111010 0
0111101000111101000111101000111101000111101000111101000111101000111101000111101000111101000111101000111101000111101000111101000 1
...
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0
0010001000000000000000000000000000000000000000000000000000000000010111100000000000000000000000001111111111111111111111111111111 1
*
NOTE END CONFIG DATA*
L184832
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0
...
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0
*
NOTE TAG DATA*
L343808
0100010001000100000010001000000000000000000100010000000000000000000000000000000000000000000010001000100100000000000001001000000 0
0000001001000000000000010010000000000100010001001000000010010000000100100000000001000100010010000000100100000000000000000001001 0
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0
*
C5CC8*
NOTE FEATURE_ROW*
E0000000000000000000000000000000000100001000010000000000000000000
0000010000000000*
NOTE User Electronic Signature Dat a*
UHCAFEBABE*
6243
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
52 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
Start
Note:
To 'Check Device ID' over the I 2C configuration port,
Check No
the MachXO2 must be in Feature Row HW Default Mode state
De vice ID?
(that is, blank/erased), or in User Mode state with the EFB
instantiated and with the EFB 'wb_clk_i' input connected
to a valid clock source of at least 7.5x the I 2C bus rate. Yes
If the EFB is not ins tantiated (not recommended),
the I 2C configuration port 'Check Device ID' readback data Transmit Read ID
will be 0xFFFF. To temporarily work around this limitation, Command (0xE0)
the 'Check Device ID' step can be omitted, or moved to
after the 'Transmit Enable Configuration Interface
(Transparent or Offline Mode) Command'.
Read 32 ID Bits
ID No
Match? Stop
Yes
Yes Yes
Exit
Transmit Read Busy Transmit Read Busy
Flag (0xF0) and Read No No Flag (0xF0) and Read
B usy? Fail? Yes Fail? B usy?
Stat us Register Stat us Register
Command (0x3C) Command (0x3C)
No No
Yes Yes
Eras e Flash Eras e Flash
CF/UFM CF/UFM/FR
Command (0x0E) Command (0x0E)
Yes
B usy? Note: Do not use fixed delays for the Flash erase sequence
No
Transmit
Read Status Register
Command (0x3C)
Yes
Fail? Exit
No
1
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 53
MachXO2 Programming and Configuration User Guide
Technical Note
1
Program No
Configuration
Flash?
Yes
Transmit Reset
Configuration Address
(0x46) or Set Addres s
Command (0xB4)
Transmit PROGRAM
command and
128 Bits of Data
Check No Delay
B usy? 200 µs
Yes
Transmit
Read Busy Flag or
Read Status Register
Command
Yes
B usy?
No
No
Last Row?
Yes
Transmit Reset
UFM Address (0x46) Yes Program
or Set Addres s UFM?
Command (0xB4)
No
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
54 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
2
No Program
Usercode?
Yes
Check No Delay
B usy? 200 µs
Yes
Transmit Read Busy
Flag (0xF0) or Read
Stat us Register
Command (0x3C)
Yes
B usy?
No
Yes Clean
Fail?
Up
No
No Verify
Usercode?
Yes
Usercode No Clean
OK? Up
Yes
Verify No
Configuration
Flash?
Yes
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 55
MachXO2 Programming and Configuration User Guide
Technical Note
3
Trans mit Read (Continued from
Command with Pre vious Page)
Nu mber of Pages
(0x73)
No All Pages
Read?
Yes
Yes Verify
UFM?
Write
Program Yes Transparent No Feature No Program
Done Configuration? Done
Row?
Yes
Trans mit Write Feature
Row Command (0xE4)
Check No Delay
B usy? 200 µs
Yes
Trans mit Read Busy
Flag (0xF0) or Read
Status Register
Command (0x3C)
Yes
B usy?
No
Yes
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
56 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
4
Check No Delay
B usy? 200 µs
Yes
Transmit Read Busy
Flag (0xF0) or Read
Status Register
Command (0x3C)
Yes
B usy?
No
FEABITS No Clean
OK? Up
Transmit
Program
Program DONE
Done
Command (0x5E)
Check No Delay
B usy? 200 µs
Yes
Yes
B usy?
No
DONE No Clean
Set? Up
Yes
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 57
MachXO2 Programming and Configuration User Guide
Technical Note
5
Write No
Security
Bit?
Yes
Tran smit
Program SECURITY
(0xCE) or SECU RITY
PLU S Command (0xCF)
Check No Delay
Flags? 200 µs
Yes
Yes
B usy?
No
Yes
Exit Fail?
No
Program
OTP Fuses?
Yes
B usy?
No
Verify No
OTP Fuses?
Yes
OTP No
F uses OK? Clean Up
Yes
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
58 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
Exit
6
Transmit Disable
Configuration
Interface Command
(0x26)
No Offline
Mode?
Wait tREFRESH
No
Yes Refresh
Successful?
Notes: No
To 'Read Status Register' over the I 2C configuration port, the
MachXO2 must have the EFB instantiated and with the EFB
'wb_clk_i' input connected to a valid clock source of at least 7.5x Retry Count No
the I2C bus rate. If the EFB is not instantiated (not recommended),
Exceeded?
the I2C configuration port 'Read Status Register' readback data will
be 0xFFFF. To temporarily workaround this limitation, the 'Transmit
Read Status Register' step can be omitted. Yes
Refresh is successful if Status Register BUSY bit = 0, DONE bit = 1,
and Configuration Check Status bits = 000. See Using Hardened Clean
Control Functions in MachXO3 Devices Reference Guide (FPGA-TN- Done
Up
02064) for complete Read Status Register command details.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 59
MachXO2 Programming and Configuration User Guide
Technical Note
Clean Up
Yes
B usy?
No
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
60 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
Note:
ST -> I2C Start
SP -> I2C Stop Start
RE -> I2C Res tart
SL -> SPI SN Low
SH -> SPI SN High
ST
Transmit ENABLE
Configuration Interface
(Offline Mode) Command
(C60000 HEX)*Skip this
step for SPI [1]
SP
ST/SL
Transmit READ ID
Command (E0000000
HEX)
No
SP/SH
Stop
(Error) No ID Match?
Yes
ST/SL
1
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 61
MachXO2 Programming and Configuration User Guide
Technical Note
1
Transmit REFRESH
Command (790000 HEX)
to res et the device
SP/SH
ST/SL
Transmit
ENABLE
Configuration Interface
(Offline Mode) Command
(C60000 HEX)
to enable
SRAM Programming
Mode [2]
SP/SH
ST/SL
Transmit ERASE
Command
(0E010000 HEX)
to Erase SRAM
SP/SH
Wait 200 µs
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
62 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
2
Read
SRAM status
Register
(optional)
Yes
ST/SL
Transmit
READ_STATUS
Command
(3C000000 HEX)
to read status register
SP/SH
Read Status
register value
BUSY Flag HIGH? No FAIL Flag HIGH? No matches
expected
value?
Yes
Stop
Yes
(Error)
ST/SL
Transmit
LSC_BITSTREAM_BURS
T Command
(7A000000 HEX)
to configure SRAM
[RE] Transmit
Bitstream(.bit)
generated by
Diamond
(Compressed bitstream
is recommended
to reduce
configuration time)
3
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 63
MachXO2 Programming and Configuration User Guide
Technical Note
3
SP/SH
Check SRAM
Status Register?
(Optional)
Yes
ST/SL
Transmit
READ_STATUS
Command
(3C000000 HEX)
to read status register
Stop SP/SH
(Error)
Yes
No
Yes
4 4
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
64 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
4 4
Stop Verify USERCODE?
No Done Flag High? Yes
(Error) (optional)
Yes
ST/SL
Transmit
READ USERCODE
Command
(C0000000 HEX) No
[RE] Read
USERCODE
value
SP/SH
ST/SL
Transmit
DISABLE
Command
(260000 HEX)
SP/SH
ST/SL
Transmit NO-OP
Command
(FFFFFFFF HEX)
to exit
programming mode
SP/SH
Stop
(Success)
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 65
MachXO2 Programming and Configuration User Guide
Technical Note
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
66 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
Start
ST
Transmit EN ABLE_X
Configuration
Interface
(Transparent Mode)
Command
(74000000 HEX)
to enable SRAM
Programming Mode
*Skip this
step for SPI [1]
SP
ST/SL
Transmit READ_STATUS
Command
(3C000000 HEX)
to read
SRAM Status Register
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 67
MachXO2 Programming and Configuration User Guide
Technical Note
2
[RE] Read Status
Register Value
SP/SH
ST/SL
Transmit
DISABLE Command
(260000 Hex)
SP/SH
ST/SL
Transmit NO-OP
Command
(FFFFFFFF HEX)
SP/SH
Stop
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
68 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 69
MachXO2 Programming and Configuration User Guide
Technical Note
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
70 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
240 ns or 360 ns
mi n.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 71
MachXO2 Programming and Configuration User Guide
Technical Note
JTAG/SPI/I2C/WISHBONE CMD +
Tx Data OPS
JTAG/SPI/WISHBONE
RX Data1 P(n) P(n) P(n+1) P(n+2) P(n+3) P(m)
CMD + OPS = Read CFG or Read UFM command byte + 3 operand bytes.
Figure 10.8 shows a multiple page read sequence. The Read Page, or Read UFM Page command is transmitted to the
MachXO2. As can be seen in Figure 10.8, all interfaces return the page at the Page Address Pointer immediately. For
single-page read operations, all configuration ports are allowed to terminate the read immediately following the
transfer of the final byte of the first page. The I2C interface differs only in the Read Flash/Read UFM Flash operand
bytes.
Reading more than one page requires special handling. The multiple page read duplicates the page selected by the
Page Address Pointer. The result of this behavior is that the page count must be one greater than the desired number
of pages. For example, reading two pages requires the page count supplied in the Read Flash/Read UFM Flash
command to be assigned a value of 3. If the Page Address Pointer is 0000, the MachXO2 returns three pages, Page 0,
Page 0, and Page 1. A restriction must be observed when using the WISHBONE interface to read the configuration flash
or UFM. When reading 13 or more pages, the page count must be set to the maximum (16383 decimal or 0x3FFF). The
user logic is not required to read this number of pages and may safely truncate the read operation after the desired
number of pages have been read.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
72 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
References
MachXO2 Family Data Sheet (FPGA-DS-02056)
Using User Flash Memory and Hardened Control Functions in MachXO2 Devices (FPGA-TN-02162)
Using TraceID in MachXO2 Devices (FPGA-TN-02027-1.8)
Lattice Insights web page for Lattice Semiconductor training courses and learning plans
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 73
MachXO2 Programming and Configuration User Guide
Technical Note
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
74 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
Revision History
Revision 4.7, October 2024
Section Change Summary
All Made editorial fixes.
Disclaimers Updated the boilerplate.
Configuration Process and Flow Updated the Table 5.1. Memory Space Accessibility of Different Ports.
References Updated this section.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 75
MachXO2 Programming and Configuration User Guide
Technical Note
add the statement If the JTAGENB input pin is hard connected to GND on the PCB, this
allows the MachXO2 to become a write one time device. In other application scenarios,
you can control the JTAGENB to provide dynamic selection between the JTAG port and
GPIO.
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
76 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 77
MachXO2 Programming and Configuration User Guide
Technical Note
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
78 FPGA-TN-02155-4.7
MachXO2 Programming and Configuration User Guide
Technical Note
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-TN-02155-4.7 79
MachXO2 Programming and Configuration User Guide
Technical Note
© 2024 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
80 FPGA-TN-02155-4.7
www.latticesemi.com