Mike Field/Hamster has got an important update to the last article we posted (Intelligent I2C Controller Project) that we thought we’d share. You can view the full rundown in two parts over at All Programmable Planet, and there are also project resources via Hamsterworks and on the Gadget Factory forums. Check out what’s new since we last posted:
The biggest modification was the adding of a “MASTERACK” instruction, which acts as a prefix to the “READ” opcode, thereby allowing more than one word to be read per I2C transaction. I have also reduced the overall size of the code to under 160 slices. I was hoping to show off the interesting bits of this project, but I’ve been unable to find anything very interesting in it to type about! What I think is interesting, however, is how you can use it.
The Hamster man, Mike Field has a new project up that is an intelligent I2C controller. It is a small programmable controller that makes it quick and easy to talk to I2C devices. The controller has a single I2C bus, 16 binary inputs, 16 binary outputs and writes I2C data to 32 8-bit registers.
The project is up over at Mike’s site Hamsterworks (there are a wealth of other Papilio-related projects and tutorials at the site too, if you’ve never checked it out). Let’s look at a quick overview, as excerpted from Mike’s project page:
My Intelligent I2C controller is not a full micro-controller, but a simple programmable state machine, using about the same FPGA resources as a Picoblaze processor. It has a simple assembler-like language of 15 instructions, and the page includes a single file ‘c’ assembler written using only the standard C library (avoiding trying to find flex and yacc for Windows). Advantages over more generic controllers such as a Picoblaze is that is is designed especially for configuring and accessing I2C devices, where as the Picoblaze will need either a software I2C implementation or an added I2C peripheral.
On the Hamsterworks project page, there’s a great example using the I2C Intelligent Controller to read data from a 3d compass sensor, complete with code.
Hey there folks! There have been several questions on the forums recently about how to add some additional serial ports on the ZPUino, so Jack has put up a great tutorial over on the ZPUino documentation regarding this subject. I popped the video in above so you can take a look-see!
We found a great vid of Pitfall designer David Crane giving a talk about designing and writing the Activision-published game for the Atari 2600 all the way back in the early 1980s. This video is from the 2011 GDC (Game Developers Conference). In it, David gives a great deconstruction of the development process for writing games within the suffocating constraints of retro hardware. It’s a bit long, but if you have the time to watch it’s worth it.
From the related article over at Hackaday:
This was a developer’s panel so you can bet the video… digs deep into coding challenges. Frame buffer? No way! The 2600 could only pump out 160 pixels at once; a single TV scan line. The programs were hopelessly synced with the TV refresh rate, and were even limited on how many things could be drawn within a single scan line. For us the most interesting part is near the end when [David] describes how the set of game screens are nothing more than a pseudo-random number generator with a carefully chosen seed. But then again, the recollection of hand optimizating the code to fit a 6k game on a 4k ROM is equally compelling.
So, this all brings to mind something that Papilio users can have some fun with on the Arcade MegaWing – we have Atari 2600 code ready and waiting for you to dive into! Papilio user Retromaster has got some 2600 code up and running – please note that it is experimental code and has not been published, but it should be a good starting point nonetheless.
You can find the Atari 2600 code at the link below. This is Retromaster’s A2601 HDL code that re-creates an Atari 2600 that Pitfall can be run on. Don’t be shy, give it a whirl! It’s always a nice, nostalgic trip down memory lane every time I load up one of these retro classics!
Howdy, hacker types! What’s new, you ask? Well, I’m happy to say there’s a cool little development coming your way called ZAP IDE.
What’s ZAP IDE you ask? Why, it’s the first version of the ZAP (ZPUino Arduino Papilio) Soft Processor IDE, that’s what! It’s basically ZPUino and AVR8, all in one. How about more of the nuts and bolts? Let’s ask Jack:
The ZAP IDE puts the AVR8 and the ZPUino Soft Processors together in the latest and greatest Arduino IDE (1.5.2) and makes using either one super easy. We’ve cleaned up all of the source code for both the ZAP IDE and the ZPUino HDL and pulled it all together with new documentation. The goal is to make the ZPUino extremely useful for anyone who uses a Papilio, whether you are just starting or an old hat. This is a new beginning for Soft Processors on the Papilio and the first step in making Open Source System on Chip designs as easy as using an Arduino.
New Features:
All soft processors together in one release, the ZPUino and AVR8 together and a framework for any future Soft Processors.
ZPUino board types are associated with their corresponding bit file. Just select, “Burn Bootloader” and the ZPUino version you need is loaded to your Papilio board. No more searching the website and trying to figure out what ZPUino bit file you need.
Code Examples built in that are specific to what Soft Processor you are using.
ZPUino code examples specify what kind of board type/ZPUino variant is required. Just select the required board type, burn the bootloader, and run the code.
You can find more on the ZAP IDE topic by checking out the ZAP IDE forum thread. You can find more on the release notes and join in the discussion there!
Ahh, springtime. The sun is out, there’s a fresh breeze blowing, the scent of blooming flowers is in the air, birds are chirping, etc. etc. And the final FPGA projects from the spring 2013 semester keep coming in!
Today we’ve got a great one from Cornell University student Tian Gao, built using an Altera DE2 FPGA and some fancy hand-detection tech. Tian’s got the Altera FPGA capturing a video signal and detecting a player’s hand skin color. Tian says,
The system tracks their hand movements and looks for the user moving their hands forward and back by determining how tall the skin colored object is over time. The goal here is to prevent the falling tetris like blocks from falling by rapidly pushing and pulling on them.
[The project is] divided into three parts: video signal decoding, hand detection and game playing. The camera provides a standard NTSC signal for FPGA and the FPGA has a hardware decoder which generates a serial digital signal. Altera has provided a solution to decode it to RGB system and display it on VGA screen. For hand detection, I first detect skin in YCbCr scale, then I track the hand by an iteration algorithm. The game is the similar as the original tetris, with the difference in width and height of the screen. Also you can’t move or rotate the block, you can just eliminate it.
He calls his game creation Anti Tetris. Tian has documented the entire project here if you’d like to read up on the finer points of his efforts. This is some good work, and looks like it might actually be a bit of fun to play!
Hackers, are you ready for the first Gadget Factory Hacker Challenge? Do you want to win a $40.00 gift card to spend on anything your heart desires at the GF Store? Here’s the deal: YOU design and implement a way to make the Ethernet module pictured above work with your Papilio board. You WIN a $40.00 gift card to the store! Simple enough.
Ethernet functionality. It has long been a requested feature for the Papilio FPGA dev boards. And the Gadget Factory community has what it takes, so let’s make this happen! In the first (of hopefully many) Hacker Challenges, the community of Papilio users and developers are going to put our heads together to hack this module and make the results open to the community.
The Challenge:
(No purchase required) You must hack a way for the ENC28J60 used in this module to work with any and all Papilio FPGA boards.
Post your working code (Arduino code and a library for the Arduino IDE, or VHDL code) to the Hacker Challenge thread on the forums.
Must be repeatable so every Papilio user can benefit – embrace the open-sourceyness!
The Reward:
Designs that are repeatable, work with both the Papilio board and the Ethernet module will win one of three $40.00 gift cards to the Gadget Factory Store.
So, the three of you that make the most meaningful contributions to the design will get a gift card! Those contributions can be:
Post your working code (Arduino code and a library for the Arduino IDE, or VHDL code)
Write documentation
Make improvements to documentation or code
The endgame here is to create a design that anyone with a Papilio and this particular Ethernet module could use successfully for their own projects. In the true spirit of open source, when we put our heads together as a community, we all win!
Here is a simple little project that you can use to control a DC motor with some pretty tight precision from your FPGA board. This could be useful for some of your projects!
Chris over at Pyroelectro has all the tutorial goodness you’ll need to get one of these up and running. He gives a brief overview:
The goal of this project is to build a simple one input, one output system that will control a motor. The control input will come from a trimpot and the FPGA or CPLD’s job will be to use the input to create the proper duty cycle PWM output to the DC motor controller.
The project combines the creation of a PWM output from the FPGA and using dynamic analog input using an A-to-D converter, yielding the ability to control your DC motor. The project page explains in detail how to use a FPGA or CPLD to take input from one device and then output appropriate signals to a motor controller IC, which gives us precise control over the DC motor’s speed and direction. So check it out!
Gadget Factory is a community focused on making affordable and fun Open Source Hardware.
Feel free to browse through the Open Source Hardware in the store, talk about hardware ideas in the forum, or learn more about our existing projects in the wikis.
Before you leave us remember to subscribe to the blog to keep up to date about new hardware, give-aways, and contests.