Solution:
The LatticeXP2 device has an extensive set of programming modes. This is because the LatticeXP2 family combines an SRAM-based FPGA fabric with on-chip non-volatile Flash. So, you can can either program the on-chip flash or the SRAM cells.
The available configuration modes are :
- Slave SPI
- Master SPI
- ispJTAG (1149.1 interface) or popularly known as JTAG programming mode.
- SDM (Self download mode)
It is important to note that the above programming modes cannot be used for every case.
- Slave SPI mode: This mode can be used to program the on-chip flash only.This mode is particularly used when an external CPU uses SPI protocol to program the device. The external CPU drives the clock and the FPGA receives the clock, so the FPGA is in slave mode.
- Master SPI mode: This mode can be used to configure the SRAM memory only. In this mode, the device gets bitstream (configuration data) form the external SPI flash device which is in slave mode.
- JTAG mode: This mode can be used program the on-chip flash and to configure the SRAM memory.
- SDM: This mode is internal to the device. In this mode, the configuration data stored in the on-chip flash memory downloads in the SRAM memory, and thus the device configures itself,without the help of any external device. All you need to do is to program the on-chip flash once, and from the next power cycle, the device will configure itself from the configuration data stored in the on-chip flash.
The FAQ serves as quick introduction to the topic. You must read
Technical Note 1141, LatticeXP2 sysCONFIG Usage Guide for all details.