May 11, 2014

Example design for TB276 Altera Cyclone IV E FPGA board

This is an example design that defines the clock, led and button pins for the Canton-electronics TB276 board in one of my previous posts. It implements a small demo with the leds and buttons. Download the Verilog source code and project file from here: brd_test.qar. The .qar-file is an archive that can be extracted with Altera Quartus II.

How to build and download to the FPGA

1. Double click the .qar file to open it in Quartus II.

2. Press OK to extract the files and open the project.

3. Double click on Compile Design as illustrated below and wait for the compile to finish. It will take a few seconds.

Make sure that you have connected the power and the programming cable to the board. Make sure that the driver for the cable is installed. See my previous post for driver installation.



5. Hit the download button in the toolbar.

This will open the programmer window.

6. Press Hardware Setup to configure the programming cable.

7. Press Start to program the FPGA. Please note that this will program the FPGA directly and so the configuration is lost if power is cycled.

Here is a video of the result.

April 30, 2014

Ultimaker Cura slicer settings for RepRapPro Huxley

Here is how I configure Ultimaker Cura Slicer software for the RepRapPro Huxley 3D printer. The settings are for Cura 14.03 but will probably work for later versions also. The settings are for 1.75 mm PLA with 0.5 mm nozzle. When launching Cura a wizard will open.  I use these settings for my Huxley:

Step 1. RepaRap
Step 2. W=140,  D=140,  H=110, Nozzle = 0.5, Heated bed=yes, Bed center is (0,0,0) = no

Dowload my Cura profile from here.

In Cura load the file with: File -> Open profile...

I generate gcode files that i put on an SDCARD. I then use Pronterface to start the print.

Below are some screenshots of how is should look after loading the profile file.

Basic:


Advance:


End gcode. I have only changed the circled line:

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.

Hardware
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

Software
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:
http://edutechwiki.unige.ch/en/OpenScad_beginners_tutorial

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.