Lattice FPGA programmer  - Page 1
Forum section: electronics / general

author: Miti
author_rank: Super Contributor
timestamp: March 22, 2024, 02:30:51 pm
content: Lattice HW-USBN-2B is $340 CAD at Mouser. R U kidding me? What are you using to program Lattice?Cheers,Miti

author: ataradov
author_rank: Super Contributor
timestamp: March 22, 2024, 03:43:07 pm
content: Generic one from AliExpress for $25.

author: Miti
author_rank: Super Contributor
timestamp: March 22, 2024, 06:17:10 pm
content: May I ask for a known good model number / item from Ali?

author: ataradov
author_rank: Super Contributor
timestamp: March 22, 2024, 06:24:30 pm
content: I think there is only one model that multiple sellers sell. It is hard to tell for sure. Here are a couple variants of the labelshttps://www.aliexpress.us/item/3256802957528698.htmlandhttps://www.aliexpress.us/item/2255800151545453.htmlI have something that looks like that. It works for basic programming without any issues.

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 22, 2024, 09:21:38 pm
content: Well FPGA vendor tools are always expensive. But this used to be significantly cheaper than this (about half that price?) - prices of dev tools have literally exploded at Lattice in the past few years. Their dev boards are also about twice what they used to be, or more.All that's needed for Lattice programming is any FTDI-based JTAG programmer, something FT2232H-based will work fine.

author: ataradov
author_rank: Super Contributor
timestamp: March 22, 2024, 09:47:28 pm
content: That programmer is not anything special, it is just a typical cy7c68013a and a couple level shifters. But it is nice to have a tool in a plastic case clearly labeled and readily recognized by the IDE. For $25 it is a good deal. $340 is a rippoff, but I also have no idea what "B" in the " HW-USBN-2B" means. It may be some significant improvement.On a quick check, it looks like it adds I2C interface, but no other features that I can see.

author: Miti
author_rank: Super Contributor
timestamp: March 23, 2024, 02:01:15 pm
content: Quote from: SiliconWizard on March 22, 2024, 09:21:38 pmI have the FT232HQ but, as Alex said, would it be detected by the programmer?Cheers,Miti

author: mon2
author_rank: Frequent Contributor
timestamp: March 24, 2024, 02:53:59 pm
content: Agree with the above comments. If you study some of the official kits by Lattice, one at least contains the FT2232H controller. Respectively, this is desirable so that you can make use of the existing toolchain (JTAG) for quick programming. JTAG on its own is not a complex spec and even a $ 0.10 micro can bit-bang out out the timing to reflash the internal flash or SRAM contents. However, for initial development, remain with a proven foundation.Also, do review SZFPGA.COM who offers a mix of FPGA tools. While not the lowest cost, they do have quality and unique kits. We purchased a batch of the ones for the GOWIN FPGA targets. Support is not poor but not the best. They will share fpga project files after a confirmation of the purchase. We did purchase their version of the Gowin FPGA programmer and it is working well to reflash our Gowin devices using the official Gowin toolchain. They also support Lattice and XILINX I believe.Our interest is to create a low cost JTAG tool for under $1 for end-user field upgrades. To us, the U2X by Gowin is overpriced.

author: dukelec
author_rank: Contributor
timestamp: March 27, 2024, 02:24:56 am
content: FT232H also supported, but should modify something, please have a look at:(Translate to English by your browser first.)https://github.com/dukelec/cdpga/blob/master/cdpga_b/readme_zh.md

author: dragon5
author_rank: Contributor
timestamp: June 26, 2024, 10:09:10 pm
content: If I am not wrong one can create a FTDI programmer from any FT2232HQ breakout board with correctly connecting the pins and usingCode:ftdi_eeprom --read-eeprom ...ftdi_eeprom --flash-eeprom ...to copy correct configuration and reconnect the USB cable. From that point on the FTDI chip should be recognized by the software according to the loaded configuration and if the pins are wired correctly it should work as any other board with that configuration.for example the MachXO3-9400_Dev_Board_User_Guide_FPGA-EB-02004.pdf (page 40 ) has a onboard JTAG with the following connections.ADBUS0->TCKADBUS1->TDIADBUS2->TDOADBUS3->TMSACBUS0->RS232 RX (SCL)BDBUS1->RS232 TX (SDA 1/2)BDBUS2->SDA 2/2Obviously this does not have some of the pins on a HW-USBN-2B (ISPEN/PROG, DONE, TRST).Probably these pins are not needed in simple designs ... like they are not in the MachXO3-9400_Dev_Board where only the TDO, TDI,TMS and TCK are connected to the 8 pin external JTAG connector.So the question is where can one download the eeprom configuration and what is the correct pin connection for a HW-USBN-2B.

author: dragon5
author_rank: Contributor
timestamp: June 27, 2024, 11:14:32 am
content: Can anyone confirm Lattice HW-USBN-2B is based on FT2232H though?

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 27, 2024, 11:50:24 pm
content: Quote from: dragon5 on June 27, 2024, 11:14:32 amYes it is.You can get convinced following this link:https://www.latticesemi.com/Products/DevelopmentBoardsAndKits/ProgrammingCablesforPCsDownload the 'HW-USBN-2B Firmware' archive. (It's very small.)Open it.Extract and look at the 'HW-USBN-2B.xml' file, which is actually a config file for FT_Prog, the tool that allows one to program the EEPROM of FTDI chips to configure them.It contains the following tag:Code:<Chip_Details><Type>FT2232H</Type></Chip_Details>

author: dragon5
author_rank: Contributor
timestamp: June 28, 2024, 11:12:38 am
content: OK. But in the documentation they also make it clear there is a Lattice MachXO2 FPGA: LCMXO2-1200HC-4MG132I and Lattice Power Manager II: ispPAC-POWR607-01SN32I part of the HW-USBN-2B with option of upgrading their firmware too. Without a schematic it is difficult to say if one can use another FT2232H based breakout board with Diamond Programmer. Most likely not. Unless some confirmed usecases that work are reported I think there is absolutely no evidence yet one can do something useful replacing the EEPROM record only.

author: ataradov
author_rank: Super Contributor
timestamp: June 28, 2024, 01:55:55 pm
content: No Idea what is in the official cable, but just in case, here is the photo of the clone one.The big IC is a clone of Cypress CY7C68013A. EEPROM is 2 Kbit, so it is only used to stored the VID:PID, which are 1134:8001 for this device. The other two ICs are buffers/level shifters. That's all. The actual firmware is uploaded by Diamond every time debugger is attached.This can be made from cheap CY7C68013A breakout boards for sure. But why bother if the full cable in the plastic case costs not much more.

author: tycz
author_rank: Regular Contributor
timestamp: June 28, 2024, 03:06:37 pm
content: Here's what's inside my clone HW-USBN-2B that I bought a few years ago (ignore the modification). I remember it was a lot more expensive than the HW-USBN-2A clone I had bought previously. Not sure what's in there exactly as most of the part numbers have been scratched off.

author: ataradov
author_rank: Super Contributor
timestamp: June 28, 2024, 03:21:28 pm
content: This design is obviously faster, since there is no way you are getting 30 MHz TCK from CY7C68013A. I assume this uses FTDI in an actual parallel mode and FPGA does the serial work.At the same time, FTDI is used by itself on the kits, so the IDE is smart enough to distinguish those two cases. And somehow it also supports CY7C68013A-based designs. I guess it just considers Cypress designs to be 2A and FTDI designs 2B with some logic do select on-board version.TCK speed for programming does not matter that much. But if you are using Reveal analyzer, then using faster tools may make a difference. I have not used Reval myself, but I have used SignalTap and Chipscope with knock-off tools and it was fine, so I don't know if that even matters that much.

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 29, 2024, 10:28:46 pm
content: Yes, the OP is probably overthinking it. A FT2232H or even FT232H (single channel) is all that's need to program a Lattice FPGA via JTAG, at the least anything same or more recent than the MachXO2 (can't say for sure for their very old stuff). Guaranteed to work 100%, and recognized by Lattice software tools without an issue.

author: pityokas
author_rank: Contributor
timestamp: July 10, 2024, 05:28:24 pm
content: Hi @ataradov, can yo post a picture from bottom side too?I want to draw the HW-USB-2A schematic, my progress so far:

author: ataradov
author_rank: Super Contributor
timestamp: July 10, 2024, 05:37:19 pm
content: Sure. There is mostly a ground plane on the back side.

author: pityokas
author_rank: Contributor
timestamp: July 10, 2024, 07:51:49 pm
content: Thanks, there is.I hope it's correct,I don't want to make (yet), just wanted the schematic.

author: ataradov
author_rank: Super Contributor
timestamp: July 10, 2024, 07:54:38 pm
content: Is it worth making it if they are $25 shipped? And that comes with a nice plastic case and the cables.

author: pityokas
author_rank: Contributor
timestamp: July 10, 2024, 08:06:48 pm
content: Yes, because I like to solder and make my pcb-s (then use once or never).