Tuesday, June 16, 2015

Any Replacement For Altera EPCQ Devices?

I previously wrote an article “Any Replacement For Altera EPCS Devices?” in year 2006.  I hope it has helped a lot of engineers out there.  This article serves the same purpose.  I just want to raise the same awareness here especially if this is your very first time using Altera FPGAs.  You can confidently replace the expensive EPCQ devices with N25Q serial flash from Micron.  The price difference is really huge!  Look at price table below.  I don’t even need to elaborate more.  Prices are quotated from Digikey or Newark website as of today.
Altera Part Number
Price (USD$)
Micron Part Number
Price (USD$)

Besides the cost difference, there is a huge advantage by using N25Q128 or N25Q064.  Their packages are both SOIC-8 whereas EPCQ64 and EPCQ128 are only available in SOIC-16 packages as of today.  This could save you some board space!

I personally had tested N25Q128A13ESE40E and N25Q256A13EF840E on hardware to configure Altera FPGAs in both Active Serial x4 and Active Serial x1 modes.  It works fine.  No issue for the Quartus II software programmer to program the POF files into these N25Q devices, too.

Friday, February 28, 2014

Function '__builtin_stwio' could not be resolved

If you are using Eclipse IDE for Altera NIOS II C++ firmware development, you will probably be annoyed by the following two reported semantic error messages when you are using IOWR() and IORD() macros from the io.h:
Function '__builtin_stwio' could not be resolved for IOWR() functions in the C++ code.
Function '__builtin_ldwio' could not be resolved for IORD() function in the C++ code.

Anyway, you will still be able to load and run the firmware program in the hardware successfully and everything is working as expected.

These two error messages (builtin stwio could not be resolved and builtin ldwio could not be resolved) are however do not appear if you convert your C++ code to C code. 

But you want to write your code in C++.  The question is how to remove the two reported semantic error messages above because they are very annoying and they keep distracting you from the actual error messages?

Simple.  Go to the Windows in main menu bar.  Select Preferences.  On the left-hand column, expand C/C++.  Select Code Analysis.  Scroll down a bit on the right-hand column.  Look for the option Function cannot be resolved.  Then, it is up to you to change this setting.  You can uncheck the option for Function cannot be resolved.  Or, you can just change it to Info or Warning from the drop-down list.

Important reminder, after applying the change of the setting, don’t forget to close the Eclipse IDE and reopen it.  I noticed that without restarting the Eclipse IDE, the new setting is not effective.  After restarting the Eclipse IDE, you will notice that the two semantic error messages above are no longer reported as error.

Labels: , , , , , ,

Monday, October 21, 2013

Cyclone V needs Windows 64-bit

Seeing Cyclone V architecture is almost like a dream comes true, at least for me.  If you told me that this will be the Cyclone V architecture ten years ago, I would laugh at you right away, “Are you sure you are not talking about Stratix?”

By the way, your fear is true, Quartus II compilation for Cyclone V FPGA device requires Windows 64-bit OS.  I had tried to compile a few designs targeting Cyclone V FPGA using a 32-bit Windows 7 Professional laptop with 4Gbytes memory, it all ended with failure due to out of memory.  In fact, one of the designs was a relatively small design with around 1800 logic elements using the smallest Cyclone V GX device 5CGXFC3BF7F23C8.

Anyway, this is not a nightmare.  You just need to plan ahead by preparing yourself a PC with Windows 64-bit OS if you are serious in using any Cyclone V device in your new design. 

Well, compiling a simple 32-bit counter won’t crash, though.


Wednesday, April 14, 2010

Quartus II 9.1 and NIOS II 9.1 on Windows 7

I am sharing my personal experience here. I have been using Quartus II 9.1 and NIOS II IDE 9.1 on Windows 7 since they were released. Now, I am using Quartus II 9.1 SP2 and NIOS II IDE 9.1 SP2.

A lot of users were asking questions the compatibility of these softwares on Windows 7.
Quartus II 9.1 and its SOPC builder seem to work fine on Windows 7 since the first day they are installed.

It is the NIOS II IDE 9.1 that really bothered me. Most of the time when you build a project, it will report error messages like two examples below. The success rate is only 20%.

Example 1:
make -s all includes
3 [main] ? (3732) c:\altera\91\quartus\bin\cygwin\bin\make.exe: *** fatal error - couldn't allocate heap, Win32 error 487, base 0x9E0000, top 0xB30000, reserve_size 1372160, allocsize 1376256, page_const 4096
2 [main] make 7588 fork: child -1 - died waiting for longjmp before initialization, retry 0, exit code 0x100, errno 11
make: vfork: Resource temporarily unavailable

Example 2:
make -s all includes
3 [main] ? (4980) c:\altera\91\quartus\bin\cygwin\bin\make.exe: *** fatal error - couldn't allocate heap, Win32 error 487, base 0x970000, top 0xA40000, reserve_size 847872, allocsize 851968, page_const 4096
2 [main] make 1972 fork: child -1 - died waiting for longjmp before initialization, retry 0, exit code 0x100, errno 11
make[1]: /cygdrive/c/altera/91/nios2eds/components/altera_hal/build/ fork: Resource temporarily unavailable
3 [main] ? (6092) c:\altera\91\quartus\bin\cygwin\bin\make.exe: *** fatal error - couldn't allocate heap, Win32 error 487, base 0x970000, top 0xA60000, reserve_size 978944, allocsize 983040, page_const 4096
8408744 [main] make 1972 fork: child -1 - died waiting for longjmp before initialization, retry 0, exit code 0x100, errno 11
make[1]: /cygdrive/c/altera/91/nios2eds/components/altera_hal/build/ fork: Resource temporarily unavailable
make[1]: *** No rule to make target `/bin/gtf/', needed by `system_description/../obj/'. Stop.
make: *** [system_project] Error 2
Build completed in 40.947 seconds

Some says it is related to the Norton Antivirus software. Yes, my PC is installed with Norton Antivirus software. But I observed that it happened to Windows 7 PC which is not installed with Norton Antivirus software, as well. Turning off the Norton Antivirus software does slightly help to increase the probability that the project is successfully built, from 20% to about 40%.

Anyway, I found some tricks which can make your life easier if you are using Nios II IDE 9.1 on Windows7.

Under your Quartus II folder, go to bin->cygwin->bin folder, select the following files in the list below and then right-click and choose Properties. Under the Compatibility tab, check Run this program in compatibility mode for:” and choose “Windows XP (Service Pack 2)”. Check “Run this program as an administrator”, as well.
Here is the list of files that you can select to change their compatibility mode under the Quartus II->bin->cygwin->bin folder:
1. Make.exe
2. Sh.exe
3. Echo.exe
4. Cygstart.exe
5. MakeInfo.exe
6. Perl.exe

7. Collect2.exe (under nios2eds\bin\nios2-gnutools\ H-i686-pc-cygwin\libexec\gcc\nios2-elf\3.4.6)
8. Nios2-elf-g++.exe (under nios2eds\bin\nios2-gnutools\ H-i686-pc-cygwin\bin)

By doing the steps mentioned above, the success rate of building a project in NIOS II IDE 9.1 will be increased to above 90%.

Friday, October 03, 2008

When your Altera USB-Blaster is not working ...

When your USB-Blaster is not working and you have verified that it is neither USB Driver issue nor PCs issue nor USB cables issue, there is no need to feel disappointed, frustrated and throw away the USB Blaster which worth USD$300 market value yet.

There is still hope to salvage your USB Blaster. You can try to replace both the MAXIM low-voltage level translator parts (part number: MAX3378E) on the small USB-Blaster board. Usually, I found that both the MAXIM parts need to be replaced when I came across a bad USB-Blaster. Their reference designators on the small USB-Blaster board are labeled U2 and U5, respectively.

Alternatively, if you can’t find the MAXIM parts, you can use Texas Instruments 4-bit bidirectional voltage-level translator with part number TXS0104EPWRG4. It works equally fine and slightly cheaper, too.

Thursday, September 06, 2007

Thick Film Resistor vs Thin Film Resistor

If you are a system designer, you probably always find that there are two kinds of chip resistor, which are thick film resistor and thin film resistor. The question is, what is the difference between thick film resistor and thin film resistor?

Found this site that explains the difference.

Saturday, March 31, 2007

Cyclone series continues ...

Finally, Altera launched Cyclone III, after a couple of months lauching Stratix III. Of course, success stories should be continued... That's why we still see Cyclone III and Stratix III today.

To be honest, I anticipated improvement on the Cyclone III logic elements architecture compared with Cyclone II, such as implementing a 5-input LUT in a logic element. Nonetheless, other improved features are pretty interesting, too. I am particularly excited with M9K, PLL reconfiguration and improved I/O element.

The cost is an important factor when you are evaluating a new device. However, the cost factor is never mentioned in the data sheet or handbook. I am referring to Digikey for cost comparison among all the Cyclone series families. EP3C25 is chosen as benchmark as it is the only Cyclone III FPGA available now. The Cyclone II and Cyclone FPGAs that come closest to this density are EP2C20 and EP1C20, respectively. No doubt, from the table below, Cyclone III is certainly worth considered if you have a new design to start with a low-cost FPGA. At a slightly lower price, you can get a higher performance, same density and twice internal memory size for Cyclone III FPGA, compared with Cyclone II and Cyclone I.

Cyclone series








Low power consumption seems to be the highlight for Cyclone III in the Altera marketing slides. Unfortunately, that doesn’t interest me too much as I am not working very much on the portable designs. Anyway, I still hope to use 65-nm Cyclone III and Stratix III parts for my new coming designs.

Saturday, October 14, 2006

Can PLL self-locked without "External" input?

I was busy working on something and suddenly a crazy idea came up.

Can a PLL lock itself if I connect a PLL output clock to the PLL input clock on a PCB and both the PLL multiplication and division value is set to 1? I expected the answer is no, of course. But the curiosity kills sometimes. So, I went ahead and did the simple test.

I was using a Cyclone II device. Surprisingly, I saw the PLL locked output signal went high. However, the output signal frequency wasn't the expected frequency (10MHz). I probed at the PLL output clock (which was also connected to the PLL input clock signal), it showed about 420kHz.

So, what is the conclusion of this story? Nothing.

Saturday, September 02, 2006

Lattice Now Blogs!

Insteresting! Lattice now blogs! A lots of non-confidential-but-technical information out there!
It is always nice to see a FPGA vendor takes initiative to provide a platform for their knowledgable engineers to share their experience and knowledge. The good thing is that the knowledge shared is not only limited to Lattice products but all the vendors FPGA.
I know it is not easy for the writers as they now have one more repeatitive task in their long to-do list besides their daily jobs. Anyway, I hope they continue doing this! Bravo to all the writers!

Tuesday, August 01, 2006

Embed Tclet in Your HTML

Since started this blog, I found out that I need to study a minimum amount of HTML to display my writing correctly. Besides, I can have more control writing in "HTML mode" compared with "Compose mode". For an example, you can't just type the symbol "<" in your blog message, instead, you need to type "&lt;" to display "<" in your blog. Don't get me wrong, I am not trying to show off my HTML skills. In fact, I only have very basic and minimum knowledge about HTML.

Anyway, if I am not wrong (considering myself not a webmaster), it seems like HTML alone doesn't have the ability to let you do real-time programming stuff on your web browser, such as Mozilla Firefox or Internet Explorer. However, it can be done using a plugin.

There are many different types of plugins out there, but I choose to use Tcl applet or Tclet since I did some study on this language before. (If you've never heard of the Tcl/Tk language before, you can visit here.) I don't know how to embed a Tclet properly in blogspot. However, I manage to do it on another free site. This Tclet in this free site is to display all the gray code counter results in sequence after you have entered the number of bits your gray code counter is. I don't know how useful it is to you, but it is useful to me because I always forget how the gray code counter increments. Bear in mind that if you are a first-time user or viewer, you need to download and install the Tcl Web Browser Plugin for free. And, of course, it is SAFE to be installed in your PC. If you haven't installed it yet, you will see a blank square instead of the picture on the left side here.

It will be a bit long for me to describe how to embed Tclet in your HTML code here. The best source is the reference book that I show in here. Of course, you can look at the HTML code in the example above. Plenty of funky Tclet examples can also be easily found on web if you are interested to see others. Hope you like it.