Archive

Archive for February, 2011

Porting the LatticeMico32 to a Xilinx FPGA

February 28th, 2011 54 comments

I finally finished my work getting the LatticeMico32 ported to a Xilinx FPGA, namely the Spartan 6. I’ve used the ZTEX FPGA Module for development, as it contains a Spartan 6 XC6SLX25 – I wrote a short review about it here: http://blog.tkjelectronics.dk/2011/02/reviewguide-ztex-spartan-6-module/

I wrote a guide about how to port the LatticeMico32 to a Xilinx FPGA, including the C-code programming stage in the Lattice system. You can download the guide here:
http://tutorials.tkjelectronics.dk/Porting_the_LM32_to_a_Xilinx_FPGA.pdf

The LatticeMico32 is an open source soft core processor provided by Lattice. The Lattice system makes a complete set of Verilog files, which can be ported to any FPGA. I decided to port it to the Xilinx series.

The example in the guide just blinks some LEDs, but it is not just LED blinking made with Verilog or VHDL coding, it’s made with C-coding inside an Eclipse enviroment, then compiled to the LatticeMico32. In the video above I show my first example and experience with the LM32 on the Spartan 6 FPGA.

The project files used in the video above can be downloaded here:
But please note that I recommend following the guide first, instead of just downloading the project files. The project files can then be used as a reference, to check if you did it correctly!

Review/Guide: ZTEX Spartan 6 module

February 25th, 2011 3 comments

A couple of weeks ago I recieved a Spartan 6 module from ZTEX. In this blog post I will be reviewing this excellent FPGA board.

ZTEX Spartan 6 module


The ZTEX USB FPGA Module 1.11 contains not only the Spartan 6 FPGA. It contains:

  • Cypress CY7C68013A EZ-USB-Microcontroller
  • Xilinx Spartan 6 XC6SLX9 to XC6SLX25 FPGA (I’ve got the XC6SLX25)
  • 64 MByte DDR SDRAM
  • MicroSD socket
  • 128 Kbit EEPROM memory
  • 48MHz Clock for the FPGA (going out from the Cypress)

Spartan 6 module content


The first impression of the board is a nice design, it looks good and it feels good. The second great thing about the board, is that almost every pin on the FPGA has been brought out, and even also some of the Cypress microcontroller pins. It is also possible to customize the Cypress microcontroller firmware. There are also some connections between the FPGA and the Cypress microcontroller, which makes it possible to develop applications that uses both the FPGA and the Cypress microcontroller.
As the Cypress microntroller has a USB capability, it is also used to upload designs to the FPGA, but it can also be used in your own applications.

When I first got the board it was kind of difficult getting started. Though the ZTEX website contains a lot of documents, schematics and layout, and they have a nice Wiki, I kind of missed an easy “Getting Started” guide.
But after reading the Wiki a couple of times, I downloaded their Firmware/SDK package and got their FWLoader running. The FWLoader is a Java application used to communicate with the Onboard Cypress microcontroller over USB.

To communicate with the Cypress microcontroller, you can use their FWLoader, found in their ZTEX EZ-USB SDK. To begin with, you have to upload the firmware for the Cypress microcontroller, which takes care of programming the FPGA. To do so, you have to copy “standalone.ihx” to the java folder (inside the SDK), and then afterwards execute the following command.

java -cp FWLoader.jar FWLoader -c -uu standalone.ihx -ue standalone.ihx -ii

After executing this command, it was now possible to communicate with the Cypress microcontroller using the commands explained on their FWLoader Wiki page. I was able to upload my first bitfile to the FPGA using the following command.

java -cp FWLoader.jar FWLoader -uf <bit-fil>

In the video above you can see my first experience with the board, getting a couple of LEDs to blink. I’ve used the 48MHz Clock, prescaled it, and made a simple counter – it worked 🙂
So in total, it wasn’t that difficult to get it running. The things that was difficult, was figuring out how their FWLoader worked, and how I should upload new designs. Though their Wiki was a great help!

As the Spartan 6 has a lot of power, I am sure that this will be a well-used board, and I can already imagine getting the LatticeMico32, a 32-bit open soft core processor, to work on this.

Categories: FPGA, Guides, Reviews Tags:

Destroying electronics for new electronics

February 23rd, 2011 No comments

For a couple of weeks ago some of you might have noticed that I had published a video about me destroying an electronics board.

This was done as a part of an NXP contest, where you could get a free LPCXpresso board, by showing them how you would break your 8-/16-bit habbit!

LPCXpresso Board


Today I then recieved the board and it looks pretty promising. Can’t wait to get started testing it! If you haven’t seen the video, you can watch it here:

Categories: ARM, TKJ Electronics Tags:

WiFi Controlled RC Car with the Arduino

February 8th, 2011 134 comments

I haven’t been posting in a long time, but I just haven’t had time to do it. I have been playing around with many different projects, both Freelance projects and my own projects.
Then I thought it would be nice to post some pictures and a video about my latest project about my Hacked/Modded DACKO RC Car.

The WiFi Controlled RC Car


As you can see on the image, I have disassembled the car and then found the controller module. Then I found an RF chip/IC on the board (RX2), and I was lucky to be able to find the datasheet of that.

Closeup of the WiFi Controlled RC Car


Then I soldered some wires to the specific pins for the motor driver circuit, one pin for each direction (forward, backward, left and right).

Then I connected theese wires to the Arduino, made a test program where the Forward and Backward pins was PWM controlled, making it possible to change speed. The left and right pin should just be driven high to turn the wheels.

After some testing, I attached the WiShield WiFi module from Asynclabs, and then I started programming a socket application for the Arduino. I thought it would be fastest and easiest to use the TCP protocol directly, than serving a webpage. After some tests with Hercules SETUP Utility I made myself a controller application in Visual Basic .NET – and off we go!


After a couple of inquiries from people asking for the Arduino and Visual Basic .NET code for this project, I’ve decided to upload it.
You can download the complete project including the used WiShield library, the Arduino code and the VB.NET code, here: WiFi Controlled Car Project

Categories: Arduino Tags: