An Education on SoC using Verilog

[Bruce Land] is one of those rare individuals who has his own Hackaday tag. He and his students at Cornell have produced many projects over the years that have appeared on these pages, lately with FPGA-related projects. If you only know [Land] from projects, you are missing out. He posts lectures from many of his classes and recently added a series of new lectures about developing with a DE1 System on Chip (SoC) using an Altera Cyclone FPGA using Verilog. You can catch the ten lectures on YouTube.

The class material is different for 2017, so the content is fresh and relevant. The DE1-SOC has a dual ARM processor and boots Linux from an SD card. There are several labs and quite a bit of background material. The first lab involves driving a VGA monitor. Another is a hardware solver for ordinary differential equations.

Continue reading “An Education on SoC using Verilog”

Logic Analyzer on Chips

The Internet is full of low-speed logic analyzer designs that use a CPU. There are also quite a few FPGA-based designs. Both have advantages and disadvantages. FPGAs are fast and can handle lots of data at once. But CPUs often have more memory and it is simpler to perform I/O back to, say, a host computer. [Mohammad] sidestepped the choice. He built a logic analyzer that resides partly on an FPGA and partly on an ARM processor.

In fact, his rationale was to replace built-in FPGA logic analyzers like Chipscope and SignalTap. These are made to coexist with your FPGA design, but [Mohammad] found they had limitations. They also eat up die space you might want for your own design, so by necessity, they probably don’t have much memory.

The system can capture and display 32-bit signals on a 640×480 VGA monitor in real-time. The system also has a USB mouse interface which is used to zoom and scroll the display. You can see a video of the thing in operation, below.

Continue reading “Logic Analyzer on Chips”

Cornell Students Have Your Back

Back problems are some of the most common injuries among office workers and other jobs of a white-collar nature. These are injuries that develop over a long period of time and are often caused by poor posture or bad ergonomics. Some of the electrical engineering students at Cornell recognized this problem and used their senior design project to address this issue. [Rohit Jha], [Amanda Pustis], and [Erissa Irani] designed and built a posture correcting device that alerts the wearer whenever their spine isn’t in the ideal position.

The device fits into a tight-fitting shirt. The sensor itself is a flex sensor from Sparkfun which can detect deflections. This data is then read by a PIC32 microcontroller. Feedback for the wearer is done by a vibration motor and a TFT display with a push button. Of course, they didn’t just wire everything up and call it a day; there was a lot of biology research that went into this. The students worked to determine the most ideal posture for a typical person, the best place to put the sensor, and the best type of feedback to send out for a comfortable user experience.

We’re always excited to see the senior design projects from university students. They often push the boundaries of conventional thinking, and that’s exactly the skill that next generation of engineers will need. Be sure to check out the video of the project below, and if you want to see more of this semester’s other projects, we have you covered there tooContinue reading “Cornell Students Have Your Back”

Gravity Simulations With An FPGA

Gravity can be a difficult thing to simulate effectively on a traditional CPU. The amount of calculation required increases exponentially with the number of particles in the simulation. This is an application perfect for parallel processing.

For their final project in ECE5760 at Cornell, [Mark Eiding] and [Brian Curless] decided to use an FPGA to rapidly process gravitational calculations. This allows them to simulate a thousand particles at up to 10 frames per second. With every particle having an attraction to every other, this works out to an astonishing 1 million inverse-square calculations per frame!

The team used an Altera DE2-115 development board to build the project. General operation is run by a Nios II processor, which handles the VGA display, loads initial conditions and controls memory. The FPGA is used as an accelerator for the gravity calculations, and lends the additional benefit of requiring less memory access operations as it runs all operations in parallel.

This project is a great example of how FPGAs can be used to create serious processing muscle for massively parallel tasks. Check out this great article on sorting with FPGAs that delves deeper into the subject. Video after the break.

Continue reading “Gravity Simulations With An FPGA”

Sorting Resistors with 3D Printing and a PIC

If you aren’t old enough to remember programming FORTRAN on punched cards, you might be surprised that while a standard card had 80 characters, FORTRAN programs only used 72 characters per card. The reason for this was simple: keypunches could automatically put a sequence number in the last 8 characters. Why do you care? If you drop your box of cards walking across the quad, you can use a machine to sort on those last 8 characters and put the deck back in the right order.

These days, that’s not a real problem. However, we have spilled one of those little parts boxes — you know the ones with the little trays. We aren’t likely to separate out the resistors again. Instead, we’ll just treasure hunt for the value we want when we need one.

[Brian Gross], [Nathan Lambert], and [Alex Parkhurst] are a bit more industrious. For their final project in [Bruce Land’s] class at Cornell, they built a 3D-printed resistor sorting machine. A PIC processor feeds a resistor from a hopper, measures it, and places it in the correct bin, based on its value. Who doesn’t want that? You can see a video demonstration, below.

Continue reading “Sorting Resistors with 3D Printing and a PIC”

Mag Lev Without The Train (But With An FPGA)

It always surprises us that magnetic levitation seems to have two main purposes: trains and toys. It is reasonably inexpensive to get floating Bluetooth speakers, globes, or just floating platforms for display. The idea is reasonably simple, especially if you only care about levitation in two dimensions. You let an electromagnet pull the levitating object (which is, of course, ferrous). A sensor detects when the object is at a certain height and shuts off the magnet. The object falls, which turns the magnet back on, repeating the process. If you do it right, the object will reach equilibrium and hover near the sensor.

Some students at Cornell University decided to implement the control loop to produce levitation using an Altera FPGA. An inductive sensor determined the position of an iron ball. The device uses a standard proportional integral derivative (PID) control loop. The control loop and PWM generation occur in the FPGA hardware. You can see a video of their result, below.

Continue reading “Mag Lev Without The Train (But With An FPGA)”

Recreating Chiptunes In Verilog

The semester is wrapping up at Cornell, and that means it’s time for the final projects from [Bruce Land]’s lab. Every year we see some very cool projects, and this year is no exception. For their project, [Andre] and [Scott] implemented the audio processing unit (APU) of the Nintendo Entertainment System (NES). This is the classic chiptune sound that regaled a generation with 8-bit sounds that aren’t really eight bits, with the help of a 6502 CPU that isn’t really a 6502 CPU.

Unlike the contemporaneous MOS 6581 SID, which is basically an analog synthesizer on a chip, the APU in the NES is extraordinarily spartan. There are two pulse wave channels, a triangle wave channel, a random noise channel, and the very rarely used delta modulation channel (DMC) used to play very low quality audio samples. This is a re-implementation of the NES APU for a university lab; it is very understandable that [Andre] and [Scott] didn’t implement the rarely used DMC.

Everything about the circuitry of the NES is well documented, so [Andre] and [Scott] had a great wiki for their research. At the highest level, the APU runs on a 894kHz clock and controls three channels through dedicated registers. These outputs are fed through a mixer, which the guys scaled and combined into a 16-bit output played through a Wolfson WM8731 audio codec.

After implementing the NES APU, [Andre] and [Scott] added an SD card reader that can read the Nintendo Sound Format – the standard distribution format for NES chiptunes – and emulated a 6502 to control the registers. The result is a relatively simple device that plays NES chiptunes with amazing accuracy. The sound files on the project report sound like the real thing, but this is entirely emulated on modern hardware.