Altera EPM3032 CPLD Guide Tour Please. - Page 1
Forum section: electronics / general

author: Mechatrommer
author_rank: Super Contributor
timestamp: May 24, 2011, 10:01:10 am
content: today i received a bunch of components that i ordered. included is 1 piece of Altera EPM3032 as pictured. The reason i bought it because1) i want to learn a new thing and embrace CPLD and FPGA.2) since the seller sell this, i grab one just to distribute the shipping cost (lesser for each item) beside the other main components that intended to buy.but the truth is, i have zero knowledge on this, no programmer no software no nothing, except this single chip. last time i google to find how to program this thing, i dont have a clear direction. iirc there is a device called fireblaster to program it. and about the software, i have no clue. please guide me on where to find the IDE, programmer, guides, notes, pdfs etc. i hope i can build a diy programmer for it instead of having to order from other place. thanx.

author: deephaven
author_rank: Frequent Contributor
timestamp: May 24, 2011, 12:30:38 pm
content: That is opening quite a big can of wormsIf you go on to the Altera website you will be able to find data sheets for the chip. These will also tell you what options you have for programming it.The software you need to run is available free of charge from their website, it is called Quatus. Be advised that it is BIG - several Gigabytes!The software will allow you to enter a circuit design in various ways including VHDL and Block definition. The advantage of the latter is that you can enter the circuit as though it was made from individual chips, you can add familiar looking gates, counters, adders etc. If you're mind is more 'software' inclined then VHDL might suite you better as it is a bit like software!You can program the chip using Altera's Byteblaster (parallel port interface) or USB Blaster (USB port interface). You can get second sourced versions of these which are cheaper. Alternatively you could make your own JTAG programmer, but this will be a lot of work to work out the file format it needs. Maybe someone has done this already?I think Altera chips are great and most of my designs use various sizes of them. The one you have is very small, but they can get very big AND eye-wateringly expensive for the high-end ones!

author: Mechatrommer
author_rank: Super Contributor
timestamp: May 25, 2011, 09:57:10 am
content: right! i downloaded the 700++ MB file just to find out its the service pack that the other main installer/program need to be installed, what a waste of BW. i think i should downloaded the "web edition" but it doesnt sound good to me... "web"? dependency? so before i download the 2-8 GB filehttps://www.altera.com/download/software/quartus-ii-wei need to ask, which one? Quartus II Web Edition V11 2.7GB or ACDS v11.0 Windows DVD (ISO) 5.9GB. what the difference of the two? this will be a hell! of downloading!

author: deephaven
author_rank: Frequent Contributor
timestamp: May 25, 2011, 10:17:12 am
content: I would actually recommend gettting V9.1 Web Edition. I am trying to find the link to where you can download that from and I'll get back to you with it.The reason for suggesting that version is it's the version I currently use and it is the last one to use 'Classic' timing analysis. This is very easy to use and means you can verify your design by simulating it. On later versions they use a new timing analysis system which is harder work to use.

author: deephaven
author_rank: Frequent Contributor
timestamp: May 25, 2011, 10:35:47 am
content: OK, I would suggest downloading this 1.7 GB (!) fileftp://ftp.altera.com/outgoing/release/91sp1_quartus_windows.exeor go to the directoryftp://ftp.altera.com/outgoing/release/and click on the appropriate link.The connection is usually slow so you have to be a bit patient.

author: Mechatrommer
author_rank: Super Contributor
timestamp: May 25, 2011, 11:36:04 am
content: Quote from: deephaven on May 25, 2011, 10:35:47 amthanx for the link deephaven. looking at the naming convention, i think the 91sp1 is another service pack upgrade, i think the main software is 91_quartus_free.exe (1.5GB) or 91_quartus_windows.exe (2.9GB) still confused with the naming.since i've downloaded the 10.1sp1, to avoid wasting the bytes, how about downloading the10.1_quartus_windows.exe (1.3GB)?(or 10.1_quartus_free_windows.exe 3.2GB? damned confusing! free version is alot bigger than normal version 10.1_quartus_windows.exe!) maybe i can get away with new timing analysis, i dont know, who knows? since i never get the feeling of it. i dont even know what timing analysis is, nvm, i'll figure it out.

author: joelby
author_rank: Frequent Contributor
timestamp: May 26, 2011, 02:40:56 am
content: Don't worry about the 'Web' name - this just mean that it's the free edition (see also Xilinx Webpack). I have a suspicion that they were named during the 'Web' craze about ten years ago and haven't managed to shake it. It has nothing to do with the Web.

author: deephaven
author_rank: Frequent Contributor
timestamp: May 26, 2011, 07:51:14 am
content: Quote from: Mechatrommer on May 25, 2011, 11:36:04 amI can't say with 100% certainty which is the file containing the full install but logically I would guess it's the biggest! As I said before 9.1 gives you a very easy to use waveform editor and it also means it would be easy for me to send you an example project to get going. . If you to decidedto run with V10.1 you could still use my example but it would update the files to be compatible with V10.1.

author: joelby
author_rank: Frequent Contributor
timestamp: May 26, 2011, 07:53:55 am
content: It seems a bit like the world has moved away from waveform editors and on to pure HDL test benches - for moderately complicated designs, this is a very good thing!

author: Mechatrommer
author_rank: Super Contributor
timestamp: May 26, 2011, 09:11:06 am
content: its because i've downloaded 10.1 sp1 earlier, so i guess i would like to continue and try ver10.1... i believe the project should be cross-version. downloading 10.1_quartus_windows.exe (1.3GB) from last night, about 12 hours already, 56% completion, running at 25KBps. i got warning i'm reaching my bw limit before thing going very slow (5-10KBps). hope for the best, the clock is ticking

author: deephaven
author_rank: Frequent Contributor
timestamp: May 26, 2011, 09:48:56 am
content: Quote from: joelby on May 26, 2011, 07:53:55 amI don't usually try to simulate the whole project. If there is a tricky section, I will make a new project of that and get it debugged.

author: Mechatrommer
author_rank: Super Contributor
timestamp: June 19, 2011, 02:55:43 pm
content: hi again. i've found a cheap study kit for my cpld.... i think. its within my budget, but i have to make sure i dont get the wrong item. what i need is only capable to program the cpld (epm3032) from pc. the 1st one (item #1) included all the byte blaster "dongle", study/dev kit and 1 more extra altera cpld. the item #2 is the byte blaster alone, but i've seen it before somewhere. i prefer #1 since its all in one, but the funny thing is its cheaper than #2 which is programmer alone. i hope any suggestions from members here. thanx.Ebay Item #1: Altera CPLD Develope Studying Tool + Atmel ISP downloadEbay Item #2: Altera USB Blaster FPGA CPLD fully Compatable download

author: Neganur
author_rank: Unknown
timestamp: June 19, 2011, 09:56:45 pm
content: The programmer of the first link seems to be RS232 while the other is USB.I don't know anything about either of these so I can't recommend anything. I prefer USB programmers though since I always encounter trouble with Windows and the old serial port type programmers.

author: mkissin
author_rank: Regular Contributor
timestamp: June 19, 2011, 11:14:03 pm
content: If you were considering buying a standalone USB byteblaster, don't get one off of ebay. For the same cost you could get the proper Terasic one, ->http://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=&No=46Also, if you wanted to play with CPLDs rather than FPGAs, I'd consider the Terasic Max II Micro kit. It comes with a lot of tutorial information, and has the programmer built in (plus, you can actually use it as a standalone USB Blaster) ->http://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=64&No=215

author: Mechatrommer
author_rank: Super Contributor
timestamp: June 19, 2011, 11:38:04 pm
content: that terasic site, is damned slow from here, i'll try later.

author: A-sic Enginerd
author_rank: Regular Contributor
timestamp: June 20, 2011, 04:54:37 pm
content: Just my $0.02,since it appears you really don't know what you have, and are running into questions and issues with what's the best way to program it, etc. I would advise pulling down the datasheet for the part and learn about it first. Even that may be complicated. It's been a while since I've dealt with Altera parts, but used to be if you wanted a good rundown of the architecture of the "family" there was a book / datasheet that gave the overall picture. Then for the specific parts there was a separate datasheet, but this time it focused just on what made that part unique in the family. (things like pin counts, I/O types, cell counts, etc.).Then once you understand just what you have in your hand, that might help you resolve what and how to get the tools you need to work with the part.On deephaven's comment about VHDL (or Verilog, etc.) being more like software. Eeeeek! That's when people like me always cringe. Yes it is like software in syntax. But that's where it needs to end. A lot of newbies get themselves into trouble when they start writing RTL code with a software mindset then don't understand when it doesn't work the way they want, and that's IF it synthesizes. Please, save yourself much grief and always be thinking in terms of hardware even though you might have something on the screen that looks like software.

author: Mechatrommer
author_rank: Super Contributor
timestamp: June 20, 2011, 05:31:08 pm
content: thanx a-sic for the advice. the datasheet has been a good bedtime story for me, i read about the macrocells etc but still have no clue on how to program that, maybe i should work harder next time. i just try to shot blind here with hope that by learning this small cpld, i'll get better picture of what and how this thing work. yes i read its not as simple as a procedural software programming, i imagine its more like brain's neurons working together to get the output simultaneously, thats the interesting subject i'm looking forward to investigate. and i believe i should start small with this 44 pins (just few macrocells) cpld, and its just happen i bought it from a seller which i bought other stuffs from. i need a direction, and this seller gave me one, simply put, i just dont know whats going to happen. just give it a try who knows the luck is on my side.

author: joelby
author_rank: Frequent Contributor
timestamp: June 21, 2011, 02:13:20 am
content: I personally think it's a bit difficult to fully comprehend macrocells, LUTs, slices, and everything else without having an understanding and some experience of what you'd actually use a CPLD for. Buy a well-supported CPLD development board that comes with an introductory tutorial (flashing LEDs, etc.), which will help you to start to learn the tools and workflow. Then you can start following more generic HDL guides.Once you're getting dangerous with HDL, it's time to start learning how the device is constructed so that you can optimise your design for the architecture, if you need to.

author: A-sic Enginerd
author_rank: Regular Contributor
timestamp: June 21, 2011, 09:05:49 pm
content: Quote from: joelby on June 21, 2011, 02:13:20 amyep, like - avoid latches.That was a brutally hard learned lesson during the one lab project in college. Still have nightmares about that one.

author: Mechatrommer
author_rank: Super Contributor
timestamp: June 22, 2011, 09:53:33 am
content: Quote from: A-sic Enginerd on June 21, 2011, 09:05:49 pmi will be looking forward to it! could be enjoyable! i get used to that kind of experienceanything hard learned will be hard sticked in our brain.

author: jahonen
author_rank: Super Contributor
timestamp: June 22, 2011, 10:05:21 am
content: Another thing to avoid is using of unsynchronized signals in synchronous logic, it can create bizarre behavior (metastable events) of your carefully designed logic and drive you crazy. You have been warnedThat means if you have something like a state machine in your design, and you want to bring external inputs from outside to your system, then you must first synchronize these inputs using the clock which runs your state machine. In practice, this is just 2-3 DFFs in series before feeding the signal into the state machine. But it still is easy to forgot.I have been designing with VHDL and FPGAs for some time now, and I still seem to struggle sometimes with this.Regards,Janne

author: Rufus
author_rank: Super Contributor
timestamp: June 22, 2011, 10:35:08 am
content: Quote from: jahonen on June 22, 2011, 10:05:21 amDepends on the circuit but the chances of you experiencing a metastable state that makes a difference are very low, likely thousands if not millions of times less likely than experiencing a race condition on unsynchronized signals.

author: jahonen
author_rank: Super Contributor
timestamp: June 22, 2011, 11:49:14 am
content: Quote from: Rufus on June 22, 2011, 10:35:08 amYes, I actually meant something like that, but wrote only the metastable for some reason, whereas timing violation would have been more generic term. Usually the effect is in complex circuit that if a 0->1 transitioning unsynchronized signal is used in clocked registers is that part of the registers will register '0' on transition (new value not registered), some will register '1' and perhaps some will experience a metastable state.Finally in case someone wonders, in contrast to a MCU this is not relevant issue with MCU since all asynchronous ports should be properly synchronized by the chip designer. With digital logic, it is important thing. So bottom line is that one should obey the setup and hold timing requirements, and all will be fineRegards,Janne

author: A-sic Enginerd
author_rank: Regular Contributor
timestamp: June 22, 2011, 05:18:39 pm
content: Some years ago I attended a trade show. IVF maybe? Anyway, took a little seminar on how to optimize designs for FPGA's. They gave a list of the Ten Commandments for digital designers. I'll have to see if I can find that. It's all pretty much second nature to me know so not sure I could do a good job of breaking them out, but it's good stuff like:- thou shalt not use asynchronous inputs- thou shalt not gate clocks- thou shalt not use latches- thou shalt provide default states for FSMsetc.Oh, and those that sometimes struggle with synchronizing your inputs.....yeah, that's a more complex subject than most novice's realize. I have read (and could probably even write one at this point) 20 page white papers on the subject. It's not a trivial thing so don't be frustrated thinking it should be so obvious.

author: Mechatrommer
author_rank: Super Contributor
timestamp: June 29, 2011, 03:29:57 pm
content: ok maybe i forgot to ask earlier. whats the difference cpld and fpga? iirc i read about fpga we have to load the firmware from flash each time startup, cpld got its own memory. i maybe mistaken. but what about difference in architecture, or when to use cpld and when more appropriate to use fpga?

author: jahonen
author_rank: Super Contributor
timestamp: June 29, 2011, 04:58:42 pm
content: Quote from: Mechatrommer on June 29, 2011, 03:29:57 pmThe logic cells (containing LUTs) of a CPLD are some form of non-volatile memory, whereas a typical FPGA uses SRAM.CPLD's are generally smaller (and cheaper) and used thus for glue logic etc., whereas FPGA's can be huge in comparison, and largest of them are used to build ASIC prototypes (reduced speed, of course, but still much faster than simulation).Regards,Janne

author: Mechatrommer
author_rank: Super Contributor
timestamp: June 30, 2011, 04:02:19 am
content: have someone tried this?http://cgi.ebay.com.my/NEW-USB-BLASTER-CABLE-CPLD-FPGA-JTAG-Programmer-Altera-/220793849096?pt=LH_DefaultDomain_0&hash=item336856c508cheaper thanhttp://cgi.ebay.com.my/Altera-FPGA-CPLD-USB-Blaster-programmer-JTAG-cable-/280506472755?pt=LH_DefaultDomain_0&hash=item414f7d1933

author: Mechatrommer
author_rank: Super Contributor
timestamp: July 11, 2011, 06:49:33 pm
content: i certainly need to come back to this thread (and the other thread) to study later. just got my programmer(s).thanks everybody for input so far. i'll update when i got something programmed.

author: Mechatrommer
author_rank: Super Contributor
timestamp: November 30, 2011, 02:31:35 pm
content: now you see, it been 6 months or so since i bought it. but sadly i never have time to play with it yet. Quartus 10.1 installed and idling. so since i'm still a complete idiot in this, but i wanna test and see something out of it. can someone give my quick, simple and easy step how to program a fpga/cpld from quartus using this china made programmer? can someone give very simple dummy hex file for this? i just want to do "blind programming" with whatever program out there and see how the fpga works.my main concern if this (above picture) programmer can actually work with quartus. and as an intro to fpga. i have here, Altera Cyclone II ep2c5t144c8n and epm3032alc44-10. i wish i can get help like, ok this is the hex, open quartus, click this button and that, connect your programmer to pc and fpga to this pin and that pin and open the hex and click upload button. power up fpga, probe using dso. is there such thing? just a simple thing for dummies. any links will be appreciated, thank you.

author: jahonen
author_rank: Super Contributor
timestamp: November 30, 2011, 03:04:56 pm
content: Why don't just connect the USB blaster and check if it requests correct drivers (they are in Quartus installation subdirectory).And then, try connecting the USB blaster to the evaluation board JTAG connector and then choosing from Quartus programmer mode JTAG, and with the evaluation board powered up, click on scan chain button, it should find the device in question if everything works ok.Regards,Janne

author: Balaur
author_rank: Unknown
timestamp: November 30, 2011, 04:20:50 pm
content: Hello,As Janne said, please try to verify if/how Quartus is able to interact with the programmer.You can use the full Quartus suite or just thestand-alone programmer.Then, did you look in the CD provided with the evaluation board? Maybe they provided some kind of a programming bit file that it's able to exercise the board features (leds, display, motors, sensors). This is a first sanity check that will help you to check the board functionalities.Most likely, this file could be a Tabular Text File (.ttf), a Raw Binary Format (.rbf), a JAM STAPL file (.jam or .jbc) or a hex file (.hexout).The next step could be to generate your own configuration file containing the design of your choice. To do this, there is no easy way; you simply need to be familiar with all this FPGA stuff. That comes after some kind of microelectronic design course. You'll need to invest time in this.As an indication, please search on the CD an example design. If a programming file is provided, you will also have the source files (+ Quartus project or whatever) that could be used to re-generate the programming file. I would do that to familiarize with the Quartus flow as a first step.Then, the second step is to prepare a template/empty design project that is configured to work with your device and board; i.e. the device pins are correctly assigned to the board schematic signals, there is a top level module with the required I/Os to the board and with some luck, the signals are initialized to safe values. Then, I will use that template to set a signal to "1" or whatever in order to light up a led.Cheers,Dan

author: Mechatrommer
author_rank: Super Contributor
timestamp: November 30, 2011, 05:00:17 pm
content: Quote from: jahonen on November 30, 2011, 03:04:56 pmexactly what i need. thanks Janne. now looking for hex fileQuote from: Balaur on November 30, 2011, 04:20:50 pmno cd no nothing. just the board and the blaster i was buying from China for $30 or something. luckily there's JTAG mark on the board so i know where to connect right away. from Janne's advice, i managed to get it detected, so far (as in the picture) thanks for the link on standalone programmer. i'll look into that.Quote from: Balaur on November 30, 2011, 04:20:50 pmnow thats deep! i'll ask again next timethanks anyway for the advice Dan i appreciate it.

author: jahonen
author_rank: Super Contributor
timestamp: November 30, 2011, 07:31:56 pm
content: Is there at least a board schematic available? Otherwise, it will be quite difficult to find out the pin mapping.Regards,Janne

author: Mechatrommer
author_rank: Super Contributor
timestamp: November 30, 2011, 09:44:13 pm
content: i dont think decoding the board will be much of a trouble. the biggest challenge is finding time meditating on the datasheet and the IDE. i dont even think its entitled to be called a development board. but from my pic dev kit experience, i dont think i'm going to need an fpga dev board eitherfor now, i think.