April 22, 2014

Low cost Altera FPGA board

After using Xilinx FPGAs for many years I decide that it was time to take a look at Altera. I googled for a suitable low cost development board that would work with the free version of the Altera tools. Most boards are quite expensive but there are less expensive alternatives. I found a promising board from a vendor in China called Canton-electronics for only ~$40 this also includes a JTAG cable. I couldn't  resist from buying it. Two weeks later it arrived. My first tests show that the board and the cable works fine. I will post more details when I have tested it more thoroughly.

Board: TB276
Download cable: Altera USB Blaster
Bundle with board and cable ~$40 from Canton-electronics.

Board specs
FPGA: Altera Cyclone IV E 4EP4CE6E22C8N
Flash chip: EPCS4, 4Mbit
Onboard oscillator: 25MHz
10 LEDs
2 Buttons

FPGA specs
Device: Altera Cyclone IV E 4EP4CE6E22C8N
Number of logic elements: 6272 LE
Number of IO pins: 92
Embedded memory: 270 Kbits
Embedded Multiplier 9-bit: 30 instances (18-bit: 15 instances)
Embedded PLLs: 2 instances
Serial Transceivers: None

Altera Quartus II Web Edition (free version) download from: www.altera.com

Installing cable drivers
The USB-Blaster driver needs to be manual installed in the device manager. You find them here after installing Quartus II: C:\altera\13.1\quartus\drivers\usb-blaster

Programming the flash
If you want the FPGA to start with your configuration you need to program the EPCS4 flash chip. Here is a guide how to do this: http://retroramblings.net/?p=622

August 31, 2013

Tutorial: Create a 3D Printable cube with OpenSCAD

Download, install and launch OpenSCAD.

Type "cube(10);" in the edit box to the left.

In the menu select:
Design-> Compile and Render (CGAL) or press F6

and then:
Design-> Export as .STL

Give your file a suitable name e.g." my_cube.stl"

Print the file on your 3D Printer by loading the .stl file in you printer software.

Here is a good source to learn more about OpenSCAD:

August 1, 2013

[SWE] BankID hänger webbläsaren

BankID is an electronic identification and signings system used only by Swedish banks and governmental agencies therefore this post is in Swedish.

Jag har på senare tid haft stora problem med mitt BankID som använder kortläsare. Det som händer är att webläsaren hänger sig när man ska logga in och det blir bara ett vitt fönster. Det händer både i Firefox och Internet Explorer. Det verkar oftast hända när man byter användare.

Lösningen verkar vara att stoppa den process som kör BankID. Gör så här. Stäng ner webbläsaren och öppna aktivitetshanteraren (ctrl+alt+del). Välj processer och letaupp "Personal.exe" och avsluta den. Starta sen webbläsaren på nytt och logga in.

June 13, 2013

Random numbers with Arduino

I was looking for a good random numbers function for Arduino. Here is a summary of what i found so far.

Pseudo-random algorithm

An algorithm that produce a sequence of numbers. It will generate the same sequence every time it is used. The built in Arduino library uses this method.

Sampling an unconnected analog input

The TrueRandom library used this approach. Seems to producing more 0s than 1s.

Independent Counter

The probably_random libray uses two counters with independent sources. Seems promising.

TRNG (True Random Number Generator) module

The Atmel SAM3X8E on Arduino DUE has a dedicated block for random numbers. There is a library available for this: advancedFunctions.

May 17, 2013

Electronics Home Lab

I have built my home lab inside a computer cabinet (IKEA Husar). It has a pull-out keyboard shelf that I use it as an extension of the workspace when the doors are open. My inspiration came from a friend that had built his lab in a two door closet. The main idea is to have a workspace that can be closed when not used and to be able to resume my work later. I have used this lab for nearly ten years and I am still happy with it!

In the upper part of the cabinet I keep commonly used tools and instruments. On the top shelf are two PSUs, a signal generator, assortment boxes with components, the SMD component kit and shelf trays with cables and small tools. On the lower shelves are things like multimeter, callipers and a power drill. At the bottom is the work space with a soldering station. On the left wall are screwdrivers, wrenches and pliers. To the left are cables hanging on hooks.The thing hanging under the shelf is an old radio scanner. You can also see a small vise hanging on the front of the workspace.

The lower part of the cabinet is used for storage of less commoly used things and toolboxes. To easily find what I looking for I use stackable clear plastic boxes.

When the doors are closed it blends nicely in to the rest of the apartment so that the muggles don't find it ;-)

May 7, 2013

Follow me on Twitter

I will start post my blog updates and other interesting things on twitter. My user name is @pthalin.  Follow me by clicking the Follow button to the right on top of this page.

April 26, 2013

Stop motion with Pentax K5 and Arduino

Sebastian Setz has created an Arduino library that can emulate an IR remote for a system camera. It supports all major brands. I created a sketch that takes a picture when i push a button. I used it to create a stop motion movie where it is important not to move the camera between shots. This library could also be used to make time laps shots where the camera takes pictures at a defined interval.

Below you can see my set up for the stop motion. To make a video of the jpg images i used MakeAVI.

Here is the video.