Forum Discussion
Altera_Forum
Honored Contributor
13 years ago --- Quote Start --- I try to explain better: now i program the fpga by using usb jtag cable and .jic file from quartus tool. --- Quote End --- Ok, so that provides a mechanism to program the EPCS device for the first time. This is required, since your microcontroller can only access the EPCS interface via the FPGA. --- Quote Start --- what i want: .sof file ---> microcontroller ---> FPGA(SPI) ----> EPCS4 --- Quote End --- If your microcontroller was connected to the FPGA via the microcontroller SPI port, then you could have connected the microcontroller SPI to the EPCS pins, and then just issued SPI commands. --- Quote Start --- micro is connetted to fpga by 16 I/O ports and not to epcs. The goal of the micro is to fill FPGA registers with binary format sof file. The only way to write the epcs is with the dedicated pins of fpga (Dclk, CS, ASDI, DATA). I don't know where to start... :cry: --- Quote End --- You have several options; 1) Connect the EPCS pins to some of your 16 I/O ports and then bit-bang the SPI transactions. 2) Use the 16 I/O pins to create a bus interface to the FPGA. For example, create a microcontroller external bus to Avalon-MM master. You can then create a system in your FPGA with an Avalon-MM mapped slave for programming the EPCS device, eg., an SPI controller that connects to the EPCS device. Your microcontroller would then access registers in your FPGA system to program the EPCS device. Option (1) is obviously the simplest. Option (2) might make sense if the designer of the board had planned for the micrcontroller to access the FPGA as a memory mapped device, eg., the 16 I/O pins might be able to be configured as an 8-bit external bus with read/write controls and a wait-state handshake. Without knowing more about the design, its hard to say. Bottom-line is that your microcontroller can program the EPCS device, but only after the FPGA has been configured from the EPCS. This means you probably want to look into having a "safe" image in the EPCS device that the microcontroller never overwrites. The remote update function can probably be used to implement the safe image. Cheers, Dave