Author Topic: How to use MachXO2 breakout board to configure an FPGA on a custom board?  (Read 3372 times)

0 Members and 1 Guest are viewing this topic.

Offline matbobTopic starter

  • Contributor
  • Posts: 23
  • Country: ca
Hello All,

I have a Lattice MachXO2-7000HE breakout board with me. I would like to know whether anyone has tried to configure a Lattice FPGA on a custom board using the MachXO2 breakout board. I want to use the FT2232H USB-JTAG interface on the breakout board to configure an FPGA on a board designed myself.

I see that the JTAG pins from the FT2232H chip are hard-wired to the on-board FPGA. I can desolder the resistors R5 to R8 from the board and solder wires from the output of the FT2232H chip to my board and configure it, but I do not want to modify the breakout board.

I am thinking of grounding the INITn (pin 110) of the on-baord FPGA so that it never comes out of the initialization process after power-up. I hope that the JTAG pins of the on-board FPGA will be floating or weakly pulled-up down in this condition. Then I can use the JTAG header J1 on the board directly as a JTAG programming port for my custom board.

Any suggestions on this? I am not able to try this out yet because my custom board is under development. I do not want to spend money on another JTAG programming cable.

Thank you.
« Last Edit: January 06, 2019, 05:45:38 am by matbob »
 

Offline ale500

  • Frequent Contributor
  • **
  • Posts: 415
I regularly use a breakout board with a MachXO2-1200 (the previous version of the one you have) to program some of my custom boards (with either a MachXO2-1200 or a -7000). I did cut two of traces going to to the header J1 (TDI and TDO). And then use all the signals from the header (J1) to program the other FPGA. I did put two jumpers on the prototyping area which are to be closed when I want to use the on board FPGA, so TDI and TDO are routed to/from the FT2232 to the FPGA. Haven't used those yet, I populated some of the headers with pins in a very silly way and thus I cannot really use the board for much test :(.
A while ago I ordered (via aliexpress) a FT2232H breakout board, reprogrammed it to act as a HW-USBN-2B and used it for some other lattice FPGAs. It is relatively cheap and works without a hiccup.
 
The following users thanked this post: matbob

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3246
  • Country: ca
Why not to install FT232H on the FPGA board you're making?
 
The following users thanked this post: matbob

Offline Berni

  • Super Contributor
  • ***
  • Posts: 5024
  • Country: si
Yep i also modified one of these boards into a Lattice JTAG programmer for programing any prototype boards using Lattice chips. Works great

I don't have it here right now to see what exactly i did, but you can get the schematic for it to easily find out yourself. From memory i think i had to remove a few resistors to disconnect the FPGA on the dev board and run a few wires to make the JTAG header on this board work in reverse (Its normally used for having an external JTAG programmer access the onboard FPGA, but with a few mod wires can be made to connect a external FPGA to the onboard FTDI programmer chip)

You could also build your own using the FTDI chip but you must also strip off the configuration image so that it presents itself to the PC in a way that the Lattice software recognizes it, a blank unprogrammed FTDI chip wont work.

But given how cheep these boards are its just easier to do a 5 minute mod to this board. It might be worth making your own if you are building a production setup and need to program 20 boards simultaneously. If you are going to spend so much time on designing the test jigs and everything you might as well also design in the simple little programmer rather than buying 20 of these boards and modding them only to connect everything with a giant mess of cables in the end.
 
The following users thanked this post: matbob

Offline matbobTopic starter

  • Contributor
  • Posts: 23
  • Country: ca
Hi ale500, NorthGuy and Berni,

Thanks for your comments.

@ale500: I did consider this option but I do not want to cut any tracks. I think only the TDO track needs to be cut because this is an output pin of the FPGA. Just curious, can we cut the TDI track alone and form a daisy chained connection of two FPGAs? Will Diamond Programmer detect both the FPGAs?

@NorthGuy: I want to make a low cost board. I will be making a few hundreds of these boards.

@Berni: As I mentioned before, I do not want to modify the breakout board. About making a FT2232 programmer, I think buying a FT2232 module and reconfiguring the EEPROM would be easy and cheap.

I am presently in Canada, and I rely mainly on Digikey and Mouser. The cheapest FT232H (not FT2232H) board I could find is the one from Adafruit for about $24 (CAD). I am not sure whether I would be successful in using FT232H rather than FT2232H. Based on my limited search in various forums, I am not able to find any success stories using FT232H. The MachXO2 board is about $47 (CAD). I already own one and I would buy one more of this if I can use this to configure an FPGA outside the board. Then I will have a backup board as well.

I would like to know the status of the JTAG pins when the INITn pin is grounded upon power up. If all of them are high-impedance (at least the TDO pin), then I need not do any modification on the breakout board. The INITn pin is available directly on the J2 header and I can ground it very easily.
 

Online PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1846
  • Country: au
...
I am thinking of grounding the INITn (pin 110) of the on-baord FPGA so that it never comes out of the initialization process after power-up. I hope that the JTAG pins of the on-board FPGA will be floating or weakly pulled-up down in this condition. Then I can use the JTAG header J1 on the board directly as a JTAG programming port for my custom board.

Any suggestions on this?

Works as you expect.
ie Isolate the breakout FPGA, and keep the leads short, and a 100R or similar series R can help reduce ringing, and reduce any contention effects.
 

Offline Berni

  • Super Contributor
  • ***
  • Posts: 5024
  • Country: si
I turned mine into a programmer by removing resistors and i tend to leave resistors on one of the pads but rotated 180° so i keep the resistor on the board. If i want to turn it back into a dev board i simply remove the bodge wires and turn the few resistors back around 180 and solder down the other pin. But i instead just ordered another board to use as a devboard since i always need a JTAG programmer around for flashing boards i made using Lattice FPGAs.

As far as i know you can chain program them just fine from Lattice Diamond.
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15299
  • Country: fr
Yeah, frankly, using an FT232H or FT2232H breakout board will be simpler and you won't have to butcher a MachXO2 dev board.
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3246
  • Country: ca
I am presently in Canada, and I rely mainly on Digikey and Mouser. The cheapest FT232H (not FT2232H) board I could find is the one from Adafruit for about $24 (CAD). I am not sure whether I would be successful in using FT232H rather than FT2232H. Based on my limited search in various forums, I am not able to find any success stories using FT232H.

I used FT232H with Xilinx FPGA. It is practically 1/2 of FT2232H. FT chips doesn't have any internal storage, so they requires external EEPROM. In Xilinx's case, it so happened that you Xilinx's tools will only work if there's a secret Key in the EEPROM. Looks like you can buy the key for $10 US per chip, but nobody knows how. Huh? You can certainly copy the EEPROM, but I'm sure in Xilinx case this would be illegal. So, it took me the whole two days to write my own bitstream uploader and programmer for the configuration PROM. But in the end, it works fine. I'm putting it on the board. In addition to EEPROM, the FT chip requires oscillator, few descrete elements and USB connector. Overall it's about $7-8 CAD if I recall correctly. Since PCBs are very cheap, you can build your own FT232H board for not much more than this. If you want to save every last cent, this is the way to go.

 


Offline matbobTopic starter

  • Contributor
  • Posts: 23
  • Country: ca
Re: How to use MachXO2 breakout board to configure an FPGA on a custom board?
« Reply #10 on: January 08, 2019, 05:01:41 pm »
Quote
I would like to know the status of the JTAG pins when the INITn pin is grounded upon power up. If all of them are high-impedance (at least the TDO pin), then I need not do any modification on the breakout board. The INITn pin is available directly on the J2 header and I can ground it very easily.

I will try this and post the result. I have ordered a new breakout board and the FPGA chips. Waiting for them to arrive.
 

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: How to use MachXO2 breakout board to configure an FPGA on a custom board?
« Reply #11 on: January 08, 2019, 05:16:50 pm »
A while ago I ordered (via aliexpress) a FT2232H breakout board, reprogrammed it to act as a HW-USBN-2B and used it for some other lattice FPGAs. It is relatively cheap and works without a hiccup.

i have the FT2232H board direct from FTDI. How do you reprogram it to work as the Lattice programmer?
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15299
  • Country: fr
Re: How to use MachXO2 breakout board to configure an FPGA on a custom board?
« Reply #12 on: January 08, 2019, 05:28:38 pm »
A while ago I ordered (via aliexpress) a FT2232H breakout board, reprogrammed it to act as a HW-USBN-2B and used it for some other lattice FPGAs. It is relatively cheap and works without a hiccup.

i have the FT2232H board direct from FTDI. How do you reprogram it to work as the Lattice programmer?

I uploaded a config file to program the EEPROM there: https://www.eevblog.com/forum/microcontrollers/wich-programmer-for-machxo2-fpgas/msg1395844/#msg1395844
 

Offline matbobTopic starter

  • Contributor
  • Posts: 23
  • Country: ca
Re: How to use MachXO2 breakout board to configure an FPGA on a custom board?
« Reply #13 on: January 09, 2019, 03:24:43 am »
Hello All,

    I tired out the method I posted, keeping the INITn pin low from power-up, but it did not work. The Lattice Diamond Programmer was still detecting the on-board FPGA (Mach XO2 7000HE) upon scanning. The FPGA even loaded the configuration from flash memory and started executing which should not happen according to the datasheet (Figure 1. Configuration Flow in the MachXO2 Programming and Configuration Usage Guide). According to the datasheet, if the INITn pin is kept low, the FPGA should not come out of the initialization process. I wonder what is happening.

    Next I tried my luck by controlling the JTAG port using the JTAGENB pin. It worked! I programmed the on-board FPGA with these settings: JTAG_PORT: DISABLE and MUX_CONFIGURATION_PORTS:ENABLE (settings available in Spreadsheet View->Global Preferences). Once I configured the on-board FPGA with these settings, keeping the JTAGENB pin (pin 120) low made the JTAG pins general purpose I/O. Now when I did the JTAG scan, the on-board FPGA was not detected. But when I pulled JTAGENB pin high and initiated a JTAG scan, the on-board FPGA was detected. With the JTAGENB pin low, I connected my custom board to the breakout board through the JTAG header and I initiated the JTAG scan and guess what, the FPGA on my board was detected! So the idea is to disable the JTAG port of the FPGA in the breakout board by pulling the JTAGENB pin low.

    You do not need any hardware modification on the breakout board with this method.
 

Offline Berni

  • Super Contributor
  • ***
  • Posts: 5024
  • Country: si
Re: How to use MachXO2 breakout board to configure an FPGA on a custom board?
« Reply #14 on: January 09, 2019, 06:01:38 pm »
Ah neat trick there.

I don't really mind hacking and bodging my dev boards. Its what the boards are made for.
 

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: How to use MachXO2 breakout board to configure an FPGA on a custom board?
« Reply #15 on: January 09, 2019, 08:59:06 pm »
A while ago I ordered (via aliexpress) a FT2232H breakout board, reprogrammed it to act as a HW-USBN-2B and used it for some other lattice FPGAs. It is relatively cheap and works without a hiccup.

i have the FT2232H board direct from FTDI. How do you reprogram it to work as the Lattice programmer?

I uploaded a config file to program the EEPROM there: https://www.eevblog.com/forum/microcontrollers/wich-programmer-for-machxo2-fpgas/msg1395844/#msg1395844

Thanks, I will do that. (I have the Lattice programmer, too, but it's nice to have more than one lying around ...)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf