Lattice MachXO2 JTAG Programming? - Page 1
Forum section: electronics / beginners

author: TheAdmiralty
author_rank: Contributor
timestamp: February 23, 2017, 11:09:34 pm
content: Evening, everyone!Just a quick question for anyone who's implemented a Lattice MachXO2 for any reason. I understand that Diamond supports programming via an FT2232. I've never used one of these chips before, and have been referencing Lattice's breakout board schematics and obviously the datasheet quite a bit, but am still wondering about a couple things before I have a board fabricated:I don't see any connections to either JTAGENB or PROGRAMn on these breakout boards, other than to external GPIOs, but it sounds to me like both of them need to be pulled in some direction to have the FPGA hold for reprogramming of the internal flash. Can anyone clarify the purpose of these two pins?The FT2232 sounds like it will need configured with FTDI's FT_PROG. Is there anything exactly that needs dumped to the external EEPROM to have the chip be usable by Diamond for JTAG programming?Or for that matter, does anyone have any experience with a single-chip FPGA of this class (specifically the XO2-4000) that is relatively easy to get working with minimal supporting circuitry?Much appreciated!

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: February 23, 2017, 11:32:58 pm
content: Quote from: TheAdmiralty on February 23, 2017, 11:09:34 pmJTAGEN is only used after you've programmed the fuse to allow the JTAG pins to be shared with other functions ( handy on the 32 pin part), where JTAGEN selects between JTAG and I/O functions. It is not needed otherwise.I don't recall what PROGRAMn is used for but I don't think it needs anything doing with it in normal usage - see the Lattice configuration docs for more info.QuoteI don't remember - try with the default config and see what happens. I think I may have an EEPROM dump of the chip on the XO2 eval board.QuoteThe XO2 series is very easy to use - the HC parts have an internal core regulator, so there isn't any supporting circuitry apart from a 3.3v regulator, and a header with connections to TCK,TMS,TDI and TDO. I'd stick a pullup or pulldown on TCK to stop spurious clocking but that's it. It even has an internal oscillator if you don't need anything too accurate.The only reason to use the other types is when you care a lot about power consumption or need to run everything at a low voltage.

author: TheAdmiralty
author_rank: Contributor
timestamp: February 24, 2017, 12:04:51 am
content: Sounds great - thanks for the information! Yep, that's why I'm going with Lattice for this one - I just don't have the time to deal with learning how to stick down something like one of Xilinx's chips with everything it would need externally. I've got a board laid out with an LCMXO2-7000HC in a quad flatpack right now, just wanted some opinions before I throw money at having it prototyped.Ah, that helps make sense of the datasheet timing diagrams. Looks like I'll leave them NC as-is then. I don't have one of the breakout boards on-hand or I'd dump it myself, but even with all their public reference designs I can't find anything from Lattice on the EEPROM; from threads in the past, it sounds like it would only be needed for Channel B on the 2232, but I'll give it a shot and see how it goes.I haven't even looked at Altera's lineup since they were bought by Intel; it sounds like the MAX10 series is similar to Lattice's XO2, but Lattice seems to make everything so simple with programming support that I don't really have a reason to investigate further.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: February 24, 2017, 12:12:46 am
content: Attatched is the FT_Prog template file for the FT2232H - it does have a custom device name but I don't know if the Lattice software needs it. I was messing around to see if I could get an FT232H cable to work (and failed).

author: TheAdmiralty
author_rank: Contributor
timestamp: February 24, 2017, 08:19:13 pm
content: Thanks, I'll take a look at it. That's pretty much the goal here, too - I'm working on doing signal processing on an array of sensors, and really don't want to shell out $200 for a Lattice-branded cable if at all possible. I've read about doing synchronous bit-banging of JTAG out from an FT232R, too, but since the 2232 is officially supported I doubt it's worth the time it would take to get working.I've just been thumbing through Intel/Altera's datasheets, and am thinking of just making a JTAG programmer block that I can export as a DXF and slap down whenever I need something programmed like a CPLD or whatnot. That's an issue for another day... I'll have to shopping for the best software out there right now to do the job, too.