Author Topic: Lattice FPGA programmer  (Read 6544 times)

0 Members and 1 Guest are viewing this topic.

Offline MitiTopic starter

  • Super Contributor
  • ***
  • Posts: 1355
  • Country: ca
Lattice FPGA programmer
« on: March 22, 2024, 02:30:51 pm »
Lattice HW-USBN-2B is $340 CAD at Mouser. R U kidding me? What are you using to program Lattice?

Cheers,
Miti
Fear does not stop death, it stops life.
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11720
  • Country: us
    • Personal site
Re: Lattice FPGA programmer
« Reply #1 on: March 22, 2024, 03:43:07 pm »
Generic one from AliExpress for $25.
Alex
 

Offline MitiTopic starter

  • Super Contributor
  • ***
  • Posts: 1355
  • Country: ca
Re: Lattice FPGA programmer
« Reply #2 on: March 22, 2024, 06:17:10 pm »
May I ask for a known good model number / item from Ali?
Fear does not stop death, it stops life.
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11720
  • Country: us
    • Personal site
Re: Lattice FPGA programmer
« Reply #3 on: March 22, 2024, 06:24:30 pm »
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 labels https://www.aliexpress.us/item/3256802957528698.html and https://www.aliexpress.us/item/2255800151545453.html

I have something that looks like that. It works for basic programming without any issues.
Alex
 
The following users thanked this post: Miti

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15252
  • Country: fr
Re: Lattice FPGA programmer
« Reply #4 on: March 22, 2024, 09:21:38 pm »
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.
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11720
  • Country: us
    • Personal site
Re: Lattice FPGA programmer
« Reply #5 on: March 22, 2024, 09:47:28 pm »
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.
« Last Edit: March 22, 2024, 09:50:40 pm by ataradov »
Alex
 

Offline MitiTopic starter

  • Super Contributor
  • ***
  • Posts: 1355
  • Country: ca
Re: Lattice FPGA programmer
« Reply #6 on: March 23, 2024, 02:01:15 pm »
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.

I have the  FT232HQ but, as Alex said, would it be detected by the programmer?

Cheers,
Miti
Fear does not stop death, it stops life.
 

Offline mon2

  • Frequent Contributor
  • **
  • Posts: 484
  • Country: ca
Re: Lattice FPGA programmer
« Reply #7 on: March 24, 2024, 02:53:59 pm »
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.
 
The following users thanked this post: Miti, paf

Offline dukelec

  • Contributor
  • Posts: 19
  • Country: cn
    • Duke Blog
Re: Lattice FPGA programmer
« Reply #8 on: March 27, 2024, 02:24:56 am »
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
 
The following users thanked this post: Miti

Offline dragon5

  • Contributor
  • Posts: 10
  • Country: no
Re: Lattice FPGA programmer
« Reply #9 on: June 26, 2024, 10:09:10 pm »
If I am not wrong one can create a FTDI programmer from any FT2232HQ breakout board with correctly connecting the pins and using
Code: [Select]
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->TCK
ADBUS1->TDI
ADBUS2->TDO
ADBUS3->TMS
ACBUS0->RS232 RX (SCL)
BDBUS1->RS232 TX (SDA 1/2)
BDBUS2->SDA 2/2

Obviously 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.
 

Offline dragon5

  • Contributor
  • Posts: 10
  • Country: no
Re: Lattice FPGA programmer
« Reply #10 on: June 27, 2024, 11:14:32 am »
Can anyone confirm Lattice HW-USBN-2B is based on FT2232H though?
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15252
  • Country: fr
Re: Lattice FPGA programmer
« Reply #11 on: June 27, 2024, 11:50:24 pm »
Can anyone confirm Lattice HW-USBN-2B is based on FT2232H though?

Yes it is.
You can get convinced following this link: https://www.latticesemi.com/Products/DevelopmentBoardsAndKits/ProgrammingCablesforPCs
Download 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: [Select]
<Chip_Details>
    <Type>FT2232H</Type>
  </Chip_Details>
 

Offline dragon5

  • Contributor
  • Posts: 10
  • Country: no
Re: Lattice FPGA programmer
« Reply #12 on: June 28, 2024, 11:12:38 am »
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.
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11720
  • Country: us
    • Personal site
Re: Lattice FPGA programmer
« Reply #13 on: June 28, 2024, 01:55:55 pm »
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.
« Last Edit: June 28, 2024, 02:00:11 pm by ataradov »
Alex
 

Offline tycz

  • Regular Contributor
  • *
  • Posts: 104
Re: Lattice FPGA programmer
« Reply #14 on: June 28, 2024, 03:06:37 pm »
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.
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11720
  • Country: us
    • Personal site
Re: Lattice FPGA programmer
« Reply #15 on: June 28, 2024, 03:21:28 pm »
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.
« Last Edit: June 28, 2024, 03:26:20 pm by ataradov »
Alex
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15252
  • Country: fr
Re: Lattice FPGA programmer
« Reply #16 on: June 29, 2024, 10:28:46 pm »
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.
 

Offline pityokas

  • Contributor
  • Posts: 18
  • Country: ro
Re: Lattice FPGA programmer
« Reply #17 on: July 10, 2024, 05:28:24 pm »
Hi @ataradov, can yo post a picture from bottom side too?
I want to draw the HW-USB-2A schematic, my progress so far:
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11720
  • Country: us
    • Personal site
Re: Lattice FPGA programmer
« Reply #18 on: July 10, 2024, 05:37:19 pm »
Sure. There is mostly a ground plane on the back side.
Alex
 
The following users thanked this post: pityokas

Offline pityokas

  • Contributor
  • Posts: 18
  • Country: ro
Re: Lattice FPGA programmer
« Reply #19 on: July 10, 2024, 07:51:49 pm »
Thanks, there is.
I hope it's correct,I don't want to make (yet), just wanted the schematic.
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11720
  • Country: us
    • Personal site
Re: Lattice FPGA programmer
« Reply #20 on: July 10, 2024, 07:54:38 pm »
Is it worth making it if they are $25 shipped? And that comes with a nice plastic case and the cables.
Alex
 

Offline pityokas

  • Contributor
  • Posts: 18
  • Country: ro
Re: Lattice FPGA programmer
« Reply #21 on: July 10, 2024, 08:06:48 pm »
Yes, because I like to solder and make my pcb-s (then use once or never).  :)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf