Embedded Keyboard Project, Part 6

Since my last post, our team has completed the final project. On Monday, we conducted the final demo, and just today, we submitted the lab report. Here is the final layout of the keyboard:

IMG_0049

Completed keyboard project

As you could see, my lab partner Whitney did a fine job organizing all the electronics, securing them to the keyboard. He made a nifty stand for the LCD display using plastic risers and hot glue. As you can see, we’re now using a Seeeduino board instead of the Arduino board — which is for the most part the same circuit, except it has a few added features and a slightly different board design. Also, note the use of the infrared optoelectronic distance sensor on the lower left side of the board. We decided to make the circuit a little more complex, so we added what is known as a D-beam, and it is used in a lot of Roland synthesizers, for instance, the Lucina AX-09 (video — WARNING: click only if you can handle extremely cheesy product infomercials). We implemented the D-beam using a Sharp 2Y0A21 distance sensing device, and we freed up an analog input on the keyboard controller for the analog sensor signal. We programmed the keyboard to process the same range of pitch bend as the Roland model in the video clip I posted above, which is about a whole step of range. The analog data coming from the sensor is really noisy, so it adds kind of like a chorus effect to the sound quality which we really couldn’t filter out very well.

We reconfigured the entire keyboard to run off of USB power, which is 5 volts, 2.5 watts. The entire circuit ended up only running off of 1.2 watts. We could probably cut down on power even more, especially with the LCD, which consumed a half a watt.

Since our synthesizer output standard MIDI out, it was compatible with another group’s project, which was designing the actual synthesis. In the following video, I used our project as a keyboard interface to their synthesizer using our MIDI output. Here is a video I shot of us connecting our projects together:

Note: Video was deleted at some point. In process of trying to find it again…

The overall cost of all the circuit components is just short of $100, which is more than the original keyboard was worth. We actually probably had the cheapest circuit out of all the groups. If we had more time, ideas I had for further developing our design would be to add a recording / playback feature, which I could very easily do with an SRAM chip, integrating the controls into the LCD menu. Since we ended up getting the synthesizer chip working in serial mode, all the parallel signals could be freed up to drive an SRAM chip. Here are the files that we created for our project:

final_presentation.ppt – Class presentation (Microsoft PowerPoint)
final_report.pdf – Final lab report (Adobe Acrobat)
source_code.zip – Project source code (zipped)

Some of the other groups in the class ended up creating really cool embedded projects. Perhaps the most expensive project implemented was a series of robots which implemented swarm intelligence. The robots would scan an area for a target of a specific color, and when it found the target, it would wirelessly broadcast a message the other robots that it found the target, and emit infrared radiation in all directions. The other robots would then turn and locate the robot, and move in towards it. Here are some photos I took of their project:

IMG_0095 IMG_0106
IMG_0108
Another cool project was one group that worked with a touch-screen LCD, which had applications which allowed you to draw pictures, play music, and operate a remote-controlled toy car. Here are some images of their project:

IMG_0115 IMG_0119
Another group designed an automatic plant watering system, which allows you to automatically water your plants when it senses the soil is too dry. You can also monitor if your plants are being watered on Twitter. I thought this was a really creative design idea.

IMG_0099
Also notice the very creative white-board artwork. Over the weekend, there was an art competition in the lab. Here are some examples of peoples’ creativity:

IMG_0100 IMG_0124
IMG_0092 IMG_0096
Notice that sleep is a common theme in the artwork. No doubt, many groups had to pull overnighters this weekend on their projects, and sleep deprivation seems to be a common theme in classes like this. Working on these projects, you completely lose perspective of time, and can easily spend over 10 hours on a project in one sitting. Well, continuing on with the artwork… One group decided to take their artwork a little further and etch their artwork onto a circuit board.

IMG_0121 IMG_0122
And here is my team’s artwork, which my lab partner drew. It isn’t nearly as creative, simply because we didn’t have to spend overnighters in the lab this weekend, since we had our entire circuit working last Monday and completed on Friday.

IMG_0125
One of the most amusing pieces of art in the embedded classroom is the “Wall of Death”, which is a hodgepodge of broken microcontrollers, comic strips, and student artwork.

IMG_0105
There were some other cool projects created this quarter, some which worked others that didn’t. Dr. Peckol usually publishes all of our embedded projects on his web page. Our projects should be up and running on his site within a week or two. You could visit our class project showcase here (if it is even up yet). More photographs can be found on my Flickr page.

Embedded Keyboard Project, Part 4

Hello, this is just another update on our keyboard project. I feel we got a *LOT* done since the last time I posted. The project is now going very smoothly, and we feel we are meeting our schedule very well. I feel like we are around 80% done. Anyway, I wanted to share with you the following recording:

Okay, I guess that’s not my best recording yet, but after a few frustrating days of trying to get our ATSAM2195 Atmel synthesizer chip to work, we finally were able to produce sound output. This note was our first recording of the sound output off the chip.

Our final project circuitry actually fits on only one breadboard. We have a pic microcontroller, which has the task of reading all the key states, and generating NOTE ON and NOTE OFF commands to the synthesizer chip whenever a key changes value. The commands are then converted to MIDI messages, and sent to the ATSAM2195 synth chip.

Final project layout

In the image above, you can see our entire final project, minus the Arduino and LCD display, and minus the audio amplifier my lab partner built for this occasion. We decided to switch to parallel mode communication with the synthesizer chip, simply because we felt it was a bit easier to get going. Anyway, here is a quick and dirty c file we wrote for the PIC18LF4525, with which we were able to communicate with the synth chip:

midi_output_parallel.c

Next we need to integrate all the code for the keyboard controller, so actual key events on the keyboard trigger MIDI commands.

What I spent most of my time on lately was creating drivers for the Crystalfontz CFA533-YYH-KL LCD screen, which is a 2-row 16-character LCD display with 6 navigation buttons. We’re having an Ardueno Duemilanove control the LCD through a RS-232 connection. The navigation menu allows configuration of various things such as instrument, master volume levels, reverb, and chorus. We uploaded a list of the 128 different instrument sounds incorporated on the synthesizer chip.

We also incorporated commands to save current settings into the Arduino’s EEPROM, and restore to default settings. The settings are coordinated with the keyboard controller via I²C connection.

Testbench for LCD display controller

The I²C communication ended up not being straight forward, since I had trouble getting the Wire.h Arduino library to trigger interrupts in the PIC controller when the Arduino is asking for a byte of data. I ended up writing my own Master I²C drivers, which pretty much bit-bang the SCL and SDA signals. Using my library, I was able to get the Arduino talking quite nicely with the PIC controller.

Our current code files for the LCD display and menu drivers are as follows:

  • arduino_module.pde – Arduino project main file
  • common.h – Shared constants between keyboard controller and LCD driver
  • eeprom_driver.cpp
  • eeprom_driver.h
  • i2c_driver.cpp
  • i2c_driver.h
  • lcd_driver.cpp
  • lcd_driver.h
  • menu_items.h – List of items in the LCD menu

Download: arduino.zip

As of now, the LCD driver is mostly complete, besides some later proof-reading. Also, I can think of a few more features I would like to incorporate if I find the time such as transposition, and I want to change some things about how the menu is displayed.

Anyway, next time I post, the project might be completely done, perhaps just over the 3-day weekend. I have just one more week to work on this project, during which time I’ll be finishing the final project, preparing a 20-minute presentation on the project, writing one of Dr. Peckol’s typically long lab reports, and conducting a demo of our design.

Embedded Keyboard Project, Part 3

Today, I put several hours into the embedded project. My lab partner extended the 15-wire band by soldering on longer wires, then running the wires outside of the keyboard case, where they’re much easier to access in a bread board.
In the picture, the black wires are for the key matrix rows, and the red wires are for the key matrix columns. We also broke out controls for the power switch on the keyboard and for the two speakers, and we think we probably will try to incorporate them into our design.
After probing the 15-wire keyboard bus, we determined the overall schematic for the keyboard matrix:
This matrix design is exactly as I had speculated in an earlier post. I got keyboard drivers working, which as of now, detects when any of the keys have changed state, and which keys changed. The driver works by driving one of the rows high and the others low, then reading in the columns. This happens repeatedly for each of the seven rows. The old values of the columns are saved and compared to the new values, and when a change is detected, that is when we process a key change, and send MIDI commands to the Atmel synthesizer chip. Here is a PIC16F877a microprocessor wired up:
As you could see, we found we needed pull-down resistors for the column pins. We found without them, we got misread key strokes, since the voltage on the column pins wasn’t falling fast enough. We speculate the diodes introduce capacitance to the column pin nodes. We found 10 kΩ resistors are small enough to discharge the nodes in time for the next read.
The keyboard driver is currently written to toggle the LED on or off every time a key event is detected. The idea is, you press down one key, the LED turns on; press down another key, it turns off; release a key, it turns on again; etc. The current drivers for the keyboard controller can be found using the following links:
After pounding around for a while, we’re now pretty certain that every key event is being processed correctly, since after all keys are released, the LED always ends up in the off state.
Pressing down one key turns on the LED
As of now, we’re still using a PIC16F processor, which runs off a supply voltage of at least 4 volts. Our synthesizer chip runs off of 3.3 volts, and we don’t really want to deal with level shifters, voltage regulators, or use multiple logic supply voltages. So we requested some free PIC18LF samples from Microchip, which should be arriving early next, which can run off of a 3.3 volt power supply. Once those arrive, we could begin to try to send key commands to the synthesizer chip.
So I feel the project is falling together pretty well so far. Next week, we will begin trying to interface the ATSAM2195 chip, and we’re really hoping that we figure it out fairly quickly. As of now, I think all the soldering and modifications to the keyboard are complete. Just out of curiosity, I’m thinking about having my blood lead levels tested.

Embedded Keyboard Project, Part 2

For my Embedded capstone project, we ordered and are us using the ATSAM2195 Atmel synthesizer chip. This chip comes in a 44-pin QFN (quad flat no leads) package, and with this chip, you input MIDI commands using 31,250-baud serial communication, and the chip simply provides the output analog signal. The chip is only 7 mm × 7 mm × 0.9 mm large, and the pins on the chip are only 0.3 mm wide, making it is virtually impossible to use a soldering iron to attach the chip to a PCB.

Three ATSAM2195 synth chips

Since we were prototyping on a breadboard, we had to order an adapter, which converts a QFN-44 case to a DIP-44 (dual in-line package) case. Searching online, I found a kit with adapters, a stencil, alcoholic wipes, a tube of solder paste, plastic tab, tin headers, and a header spacer.

QFN-44 to DIP-44 adapter kit

The first step of the process is to apply the solder paste to the minuscule pin plates on the adapter. To do this, we taped the QFN-44 stencil to the PCB, then wiped a layer of solder paste over the holes using the plastic tab.



If we were lucky, when the stencil is taken off, the PCB would then look something like this, where each pad had just the right amount of solder paste on it, and there were no solder past bridges between pads.


The next step which required perhaps the finest motor skills was placing the QFN package on the PCB, without smudging the solder paste, and aligning the pins just right.


Once we felt the chip was aligned squarely on the pads, the next step was to start our ‘reflow oven’. Actually, it’s more of a ‘reflow skillet’. Strangely enough, the Electrical Engineering department at the University of Washington doesn’t have any tools for PCB printing, so we had to think of something else. So we found a tutorial on SparkFun for using an iron skillet for doing reflow. So we got the exact same model skillet as used in the tutorial, from Target, and put it to work.

Our reflow skillet

After a few minutes, the solder will melt and turn shiny, and after that, we removed the PCB, and inspected for bridges and continuity.

After reflow

The final step is to solder the header pins on, which is the easiest part. The header pin spacer is used to ensure the header pins are the correct distance apart, so it will easily fit into the solderless breadboard.


Abofe, we show the chip connected up to the bread board. The oscillator is there just for show, since unfortunately, the ATSAM2195 chip runs off of a 3.3 volt 9.6 MHz oscillator, but I’ve been finding it impossible to find one in a DIL package, so we’re sticking to the function generator until we find one. Below is another one we made, just for backup.


So, right now we’re crossing our fingers that the chips actually work, and they’re connected correctly. If using the chip is as straight forward as I hope it is, we should be making music with it by early next week. As of now, I’ve been working on drivers for the keyboard interface, which we’re going to implement on the PIC16F877a microcontroller. My other lab partner is writing display drivers for an Arduino Duemilanove (don’t ask me to pronounce that) for a hierarchical menu on an LCD screen. The idea is that the Arduino will be used as the user interface to set MIDI options, such as reverb, volume, instrumentation, etc…, and hand the options over to the PIC, which outputs the MIDI commands to the synth chip.

On a completely different topic, here is a C programming challenge I found online published by the company RapLeaf, and it took me around three hours to figure it out. I thought I would throw it out, because I found it fun to think through, and maybe some of my readers who are programmers would like a little bit of a challenge. They’re looking for programmers that are good at solving problems like this. I’ll be interviewing with them this coming Saturday since they liked my solution, although just for fun. It looks like their positions are geared heavily towards Computer Science majors, which I’m not.

Embedded Keyboard Project, Part 1

Hello,
This is the first of a series of posts detailing our EE 478 final project, which is to create a MIDI instrument. The idea is to dismantle an electronic keyboard, and rewire all the keys in order to make our own keyboard instrument. I’m feeling more free to publicize my work on this project, since my lab professor Dr. Peckol publishes our work on the class web site for future classes to use as reference, anyway (link).
For this project, we’re creating a 49-key digital keyboard instrument. The keyboard is equipped with an LCD screen interface which shows a navigation menu, and is navigated with pushbuttons. The navigation menu allows the user to change musical settings, such as instrument, reverb, chorus and volume. The system is designed to be low-power and low-cost. We are running all components in the system on a 3.5 Volt supply (except for the external speakers). The 49 key musical keyboard input is controlled by a PIC microcontroller, which converts the keyboard input into MIDI serial data that is sent to a synthesizer chip. The microcontroller is also responsible for interfacing with LCD and pushbuttons for musical configuration settings.
Today, we made our first leap into the project by purchasing a used 49-key MD-500 ‘Optumus’ Radio Shack keyboard on Craigslist for $20.
As you can see, the keyboard is equipped with all sorts of features, including a MIDI recorder / playback feature, metronome, prerecorded songs, auto-rhythms, MIDI-out, and more. For our project, we are creating our own features, so all of that stuff is going to be removed.
After taking apart the keyboard, here is what is in the inside:
As you can see, there are five visible main sections. There are the two speakers, which we may not end up using. There is the panel for all the buttons, which we won’t need either. On top of that, there is the LED screen for the front panel, which is not useful. The keyboard is powered by a battery pack, which we probably won’t use. There is the keyboard section (bottom), which has groups of 8 diodes, each for a section of eight keys. Total, there are 49 diodes on this board. Connected to this board through the large gray ribbon is the ‘mother board’ for the keyboard.

The ribbon consists of 15 wires, connecting the 49 keys to the keyboard controller. I needed a soldering iron to completely remove the mother board to see the circuitry on it, but by peeking under, here was what was uncovered:
As you could see, the keyboard wires feed into a 38-pin DIP adapter, which feeds into some mysterious ball of black glue. What’s under this black glue is probably the keyboard controller / MIDI synthesizer.
Hmmm… 15 wires and 49 keys… how does that work? Well, I found an informative site online, for creating a simple keyboard controller with the PIC16F877A microcontroller, which we now have quite a bit of familiarity with:

(Credits for this diagram go to Thomas Scarff, Lecturer at Dublin Institute of Technology, School of Electronic and Communications Engineering)
The circuitry in the keyboard is probably very similar to the image above. The keys are arranged as a matrix with rows and columns. On the keyboard I got, the notes are probably grouped by rows of 8, not 16. The keyboard controller polls only one of the rows of eight keys at a time by asserting high one of the row selector pins (pins 34 through 40 in the image). When a row is selected, the values of the notes on the row will appear on the column pins for the keyboard controller (pins 2-9, and 19-30 in the image). For 49 keys, you need 7 columns of notes to select out the individual row of eight notes (49 / 8 = 7, rounded up). Doing the math, 8 rows + 7 columns = 15, which accounts for all the wires in the ribbon. Our next step is to figure out which wire corresponds to which row or column on the key matrix.
The keyboard controller continuously loops through all the rows of keys and collects data on the state of all the keys. When one key is noticed to have changed, a on or off key event will be triggered, depending on the new state of the key.
Well, that’s all for now, I will continue to give updates as our project progresses.

Spring Quarter, 2010

Hello, friends and family,

It’s mid-quarter now, and it’s my last quarter at the University of Washington. There will be a department celebration on Friday, June 11, at 7:00 in Kane Hall, room 130. You need a ticket to get in, and I’m allowed to give out 3 of them; there might possibly be more available in the future. The University Graduation is on Saturday, June 12. If you want a ticket, let me know, and I’ll try to get one for you. More details could be found here: http://uwgraduation.com/.

Lately, I’ve been sprucing up my résumé and cover letter, and I’ve been looking into all sorts of employment opportunities. I’m trying to find somewhere preferably in the area. Sometime this Summer, I may be heading down to Belize to intern for Innovatia, my uncle’s company, during which time I will be put on interesting projects, hopefully to build up an eye-catching résumé for when I return.

This quarter, I’m only taking one engineering class, EE 478, which is the capstone course for embedded computing systems. It’s been proving enough of a workload, especially since one of my lab partners decided he didn’t want to come to class or participate in group meetings. So I’ve been working hard to keep up with only one lab partner; but we’ve been pulling along alright. EE 478 does have a reputation as being one of the most time-consuming classes at the University of Washington. It even has its own Facebook page! My professor Dr. Peckol is known for his high expectations, especially on his lab reports, which tend to average around 50 pages each. Overall, in the four classes I’ve taken with Dr. Peckol, I must have written well over 500 pages of lab report; and more still to come!

Me

This past week, we had due a project to design a microcontroller-based scanning and imaging system to be mounted on a probe to be used for extra-planetary exploration. This probe has three cameras and a 2-Kbyte SRAM partitioned into two buffers. When one buffer is full, the contents are uploaded to a ‘mother ship’, then transmitted to an Earth data collection center. This lab was just an introduction to the PIC16F877a microcontroller, and to synchronous and asynchronous communication, namely I2C and RS-232 (which you wouldn’t use for space exploration). Anyway, after pulling some overnighters, we got our circuit working perfectly. Besides that, we Here is what it looks like:

I’ve learned in the past week that troubleshooting the PIC could be at times time consuming. A couple times during this project, we narrowed down to problems to lines of code that look perfectly normal, but cause the PIC to crash for some reason. The PIC controller has a lot of quirks that if you’re not familiar with them, could lead you to pull your hair out wondering why the processor keeps crashing. The most time consuming problem we faced is when we discovered that the breadboard we were using at the time was broken, and wasn’t connecting things together properly.

The last few weeks of class, I’m going to be working on the EE 478 final project, which entails creating a fairly complex embedded system. My lab partner and I are thinking about using one of the Amtel synth chips (particularly, the ATSAM2195) to create a musical instrument. I was thinking about tearing apart a cheap keyboard, and then designing the system that generates MIDI inputs for the chip. We’re in the planning phase right now, but there’s many ways we’re planning to increase the complexity of the system if we so desire. These projects tend to cost people around $200 to $300 for parts.

Anyway, I’ll try to blog more often when something pops to mind. Take care.

Update

I just happened to notice that my blog was horribly updated, and my last post was from back in August. Last year I took a web programming class to motivate me to create a really decked out web page, but it only taught me that it’s way too time consuming and too much effort. So here I am, using Blogger.com still.

I’m now on Skype, which seems like a really nifty online phone service. If you want, you can reach me with my user name, jfeucht82, and I’ll try to leave it on as much as possible. My philosophy is that I should pay as little on telephone communication as humanly possible. If you’ve ever tried calling me, you’ve probably noticed that I rarely carry my phone on me wherever I go, and I respond to email a lot faster than I do via telephone. I currently own the cheapest AT&T pay-as-you-go phones I could possibly get, and it’s malfunctioning because the ringer doesn’t work anymore for some reason.

I was just looking through my online degree audit (or a listing of classes you still need to graduate), and I figured if I take the right classes, I might be able to graduate the end of Spring Quarter in June. I’ve been following mostly the program requirements of VLSI (Very Large Scale Integrated) Circuits, although the final courses I would need for that program aren’t offered until the Summer or Fall quarter. On the other hand, I could take two engineering courses next quarter, and be done with the program requirements for Embedded Computing Systems, which is another field I have quite a bit of interest in. And I kind of want to exhaust the funds in my GI bill before I get out of the University of Washington, and I have funds to cover me through Fall Quarter this year, if I take classes over the summer.

So that’s something I’m going to have to start thinking about. I’ve been prettying up my résumé and cover letter for possible internships and jobs coming up, and I have some career fairs to attend…

This quarter, I’m taking two engineering courses, and a writing course (I have to take two technical writing courses). I’m also taking my first 400-level UW course, E E 471 Computer Design and Organization. This class seems like it’s going to be quite a bit of work. We’re learning how to design our own microprocessor using Verilog, which is a computer language designed specifically for modeling digital circuits. Over the course of four lab assignments, we will design critical components of the processor. The class pretty much deals with figuring out how a processor processes machine code, and how all the components in a processor interact with each other.

The other engineering course I’m taking is E E 332 Devices and Circuits II, which is a continuation of an engineering class I took last quarter. This class deals primarily with designing circuits with BJTs (Bipolar Junction Transistors), which are pretty much electronic parts that amplify signals. Our final design project is to design and build an audio amplifier.

Anyway, that’s all I have to say for now. Sometime in the near future, I might come up with something that’s actually interesting to talk about and blog about it, but as for now, if you’re too bored, you can check out my AC to DC in my previous post and marvel at how incredibly interesting it is.

An AC to DC Converter

In one of my classes, E E 331 Devices and Circuits I, our final project was to build an AC to DC converter. Our design specifications were to take a 10 Vpp 60 Hz DC input from a center-tap transformer and have an adjustable 10 V to 20 V DC output. It was expected to have output noise of maximum 100 mV, and able to deliver 1 mA current for all voltage settings. Also, we were graded on how cheap the circuit was to build.

Above is a block diagram of our design. The circuit works by rectifying an AC input, creating a high frequency square wave, and using that wave to drive a boost converter to amplify the rectified input signal to a level dictated by a differential amplifier you could control using a potentiometer.

And above is the circuit schematic as viewed in PSPICE schematic and simulation software. The circuit was designed mostly on computer, then built later when the simulated circuit met specifications. The square wave was provided by a 555 timer, and the differential amplifier was built using a LM741 operational amplifier. The amplifier compares the voltage at the anode of a 5 V zener diode with the output voltage, and increases its output voltage when the output voltage falls too low, and decreases its output when the output voltage gets too high. This feedback system maintains a constant output voltage, which is calibrated using a network of resisters to operate within the specified range.

Above is the circuit built on a breadboard. The total cost of all the electrical components is a little under $8. Our design had barely any noise in the output, and it met all performance requirements within a narrow error margin.

End of Summer Quarter

Hello, friends and family!

It’s been several months since I last posted. This summer has been pretty laden with school work. This quarter I took two classes, E E 271 Digital Circuits and Systems, and IND E Probability and Statistics for Engineers. This is the second time I’m taking a Statistics class; the first I took at Pierce Unfortunately, the credits didn’t transfer for the course. The courses were pretty much the same material, except for that the one I just took uses a little bit more advanced mathematics…

For the past two weeks, I have been spending long hours and late nights working on a final project for my engineering class. The project is to design and build a game using digital logic. We were given a list of 9 different project ideas (or you could create your own). Here is the description for the particular game we chose:

This game involves dealing with some disgruntled chemistry and aero students who have teamed up and have taken over Bagley Hall. The are dropping balloons filled with synthetic and noxious scents…raspberry, strawberry, eau de skunk, greasy hamburger, cold pizza, Budweiser, oops InBev, …oh retched…, on the people passing below. Your mission is to stop this olfactory attack as quickly as possible.

This game is played on a 4 by 4 grid. Balloons are randomly loaded at the top of the grid and fall to the bottom. You can move a paddle left or right to block the balloons and thus prevent them from bombarding the folks below. If 3 balloons hit, the scent police haul you off to work in a paper company for the summer.

My instructor, Dr. Peckol, obviously has a really dry sense of humor. Anyway, my lab partner and I decided to build the project on an 8 by 8 grid, since there were compact dual color 8 by 8 LED (light-emitting diode) Matrices available at the UW parts store. The biggest challenge of the project was figuring out how to get the LED Matrix to work. Here is a schematic of the LED Matrix taken from the data sheet:

Since most of my readers aren’t familiar with electronics, all of the triangle/line things are diodes, meaning that current can only flow in the direction of the arrow. When you apply a positive voltage to any column, and ground any row, current is allowed to flow through the diode at the intersection between the selected row and column. The problem is, how do you get two lights on at the same time that aren’t in the same row or column? If you applied voltage to two of the rows and grounded two of the columns, you will have four LEDs shining, not two.

The trick to using an LED matrix is only having one column on at any time, and cycling through the columns at high frequency. The human eye can only notice a flicker of up to 50 Hz, and due to one of the properties of the human eye known as persistence of vision., an LED needs to be on for only nanoseconds in a 50 Hz cycle in order to appear as though it is continuously on. In our project, we have up to three objects on the screen during the course of the game, although the column and row display drivers cycle through displaying only one object on the screen at any given instance. We built a 555 Timer circuit outputting a pulse of 6.9 kHz, which is used to cycle through the objects on the screen.

Here is a block diagram of our game design:

The larger components of the circuit, including the Control, Sequencer, Row Driver and Column Drivers, were written in structural Verilog (programming language), then written onto generic array logic (GAL) chips. The random bit generator is a 3-bit linear feedback shift register, which is a common method for generating pseudo-random numbers. Here is a photo of the final circuit:

Well, I won’t go too much deeper into all that boring electronics and stuff… I could go on for 26 pages (that’s how long our lab report ended up being). Here it is in action!

There is one glitch in the final version I discovered last minute that I think is an easy fix… Once in a while, a balloon skips a row. I think this is because the clock signal to the Sequencer module has a race condition.

Anyway, that was my project. Digital Circuits is really a fun class. I get a month-long Summer break, so I think I’ll do some hiking trips and some other fun things. Next quarter, I’m taking E E 331 Devices and Circuits I, E E 361 Applied, and Electromagnetics, and AMATH 301 A, Beginning Scientific Computing. It’s not going to be an easy quarter! 🙁