Build an AM Radio Transmitter from a CPLD

[Alex Lao] has been playing around with the CPLD-like parts of a PSoC. Which is to say, he’s been implementing simple logic functions “in hardware” in software. And after getting started with the chip by getting accustomed to the different clock sources, he built a simple AM radio that transmits at 24 MHz.

The device that [Alex] is learning on is a Cypress PSoC 5LP, or more specifically their (cheap) prototyping kit for the part. The chip itself is an ARM microprocessor core with a CPLD and some analog tidbits onboard to make interfacing the micro with the outside world a lot easier. [Alex] doesn’t even mess around with the microprocessor, he’s interested in learning the CPLD side of things.

PRS-CircuitHe starts off with a 24 MHz carrier and a 1 kHz tone signal, and combines them with a logical AND function. When the tone is on, the carrier plays through; that’s AM radio at its most elemental. Everything is logic (square waves) so it’s a messy radio signal, but it’ll get the job done.

Adding a multiplexer up front allows [Alex] to play two tones over his “radio” station. Not bad for some simple logic, and a fantastic Hello World project for a CPLD. We can’t wait to see what [Alex] is up to next!

If you’re interested in getting your feet wet with either CPLDs in general or a CPLD + micro system like Cypress’s, the development kit that [Alex] is using looks like a cheap and painless way to start. (Relatively speaking — PSoCs are a step or two up a steep learning curve from the simpler 8-bit micros or an Arduino.) Hackaday’s own [Bil Herd] has a video on getting started with another member of the Cypres PSoC family, so you should also check that out.

Programmable Logic: Build Yourself a CPLD Module

A Complex Programmable Logic Device (CPLD) is a great piece of hardware to have in your repertoire. As its name implies, you can program these chips to serve the logic functions you need. This might be replacing an obsolete chip, or maybe just a way to learn and try different techniques. What better way to learn than to get your hands on a CPLD and give it a try?

I created a CPLD module with the intent of being able to plug it into lots of things including solderless breadboards, but I screwed up. It seems that the plugin space available on a solderless breadboard is 1.1”, I had made the footprint 1” wide leaving no room for a row of wires on both sides. Duh.

But let me back up and show more about what I’m doing , I wanted to make a programmable piece of logic that could be built as a kit one could easily solder at home, could be programmed in-circuit, and could work at 3.3 or 5 volts.

Image5bTo implement an easily solderable kit I went with an older CPLD part that also has 3.3v and 5v versions that will maintain its programming regardless of power. The logic itself is a CPLD IC from the Altera Max family with two versions that fit the board with either 32 or 64 macrocells. A macrocell is the basic logic building block and it is programmed with logic “terms” and then interconnected to other macrocells through a programmable interconnect.

Continue reading “Programmable Logic: Build Yourself a CPLD Module”

Hackaday Prize Entry: An Open Source Graphics Card

For last year’s Hackaday Prize, [PK] tried to build a video card for microcontrollers and headless Linux systems. It was only 640×480 resolution VGA, but the entire project was designed around a CPLD communicating with a microcontroller over SPI. This prize entry was, by [PK]’s own admission, a failure. It was late, but now he’s had an entire year to perfect his design. That means he can enter version two of his VGATonic in The Hackaday Prize.

The VGATonic version 2 uses a Xilinx XC95144XL CPLD for the VGA timing, and an ATTiny 2313a to read the SPI bus. Video memory is four megabits of static RAM. That’ls pretty much all you need for the most basic VGA graphics card, and all of this is packed onto a 3×3 inch PCB.

You can do a lot with 640×480 8-bit graphics running at 25FPS. In the video below, [PK] has a ‘hello world’ of sorts, Doom, running on a Raspberry Pi 2 with his SPI graphics card. Yes, it’s a graphics card for the Raspberry Pi, and it looks really good.

Further refinements of the design will include some primitive graphics routines. Not OpenGL or anything fancy, just something to reduce the number of writes on the SPI bus. It’s a great project, and perfect if you want to add video out to an Intel Galileo or other microcontroller project. [PK] has a video demo, you can check that out below.

The 2015 Hackaday Prize is sponsored by:

Continue reading “Hackaday Prize Entry: An Open Source Graphics Card”

Hackaday Prize Entry: Very, Very Small Logic

Despite the existence of FPGAs and CPLDs, there’s still a necessity for very small programmable logic devices. GALs, PALs, and other old tech just won’t cut it, though, and so we are left with a new generation of programmable devices that aren’t microcontrollers or CPUs. The GreenPAC from Silego fill this niche quite nicely, with the ability to implement counters, ADCs, logic glue, level shifting, and comparators in a single chip. For any homebrew electronics tinkerer, these devices have one very obvious problem: they’re really, really small. The smallest GreenPAC device has 12 pins stuffed into a 1.6 x 1.6mm QFN package. You’re not hand soldering this thing.

For [Nick Johnson]’s Hackaday Prize entry, he’s taking these small programmable logic chips and making it easy to create your own custom ICs. Basically, it’s a breakout board for GreenPAC devices that stuffs these tiny chips onto a much more reasonable DIP package.

Breakouts aren’t enough, and to program these small chips, [Nick] is also building a board based on an ARM microcontroller. With USB input, a way to generate the 7.5V used for programming, and a breadboard friendly format, this programmer will tell these tiny chips what to do.

Not many people are building stuff with PALs and GALs anymore, but there are still a lot of work that can be done with small programmable chips. There’s certainly a place for tiny programmable logic chips like this, and anything that gets them in to the hands of more people is okay in our book.

The 2015 Hackaday Prize is sponsored by:

New Part Day: Modern PALs

Back in the bad old days, if you needed a little bit of custom logic you would whip out a tiny chip known as a PAL. A Programmable Logic Array is just what it sounds like and is the forerunner of modern, unsolderable CPLDs and FPGAs.

PALs and GALs have died off, left to the wastes of the Jameco warehouse, and now it seems the only programmable logic you can buy are huge, 100-pin monstrosities. [Nick] at Arachnid Labs was working on his Tsunami signal generator when a user asked if they could add just one more feature: a programmable divider to count 256 iterations of a clock. This is the perfect application for dumb logic, but if you’re looking for a part that’s not recommended for new designs, you only need to look to old programmable logic.

Enter the Greenpak. [Nick] had a dev kit for these ‘modern PALs’ sitting around and decided to give it a go. They’re small – they max out at 20 pins – but there are a few features that make it a little more interesting than a simple array of AND and OR gates. The Greenpak3 features analog comparators, look-up tables, RC oscillators, counters, and GPIO that will work well enough as circuit glue. They also work at 5V, something you’re just not going to find in more complex programmable logic.

These tiny chips are programmed in a graphical IDE, but the datasheet (PDF) includes full documentation for the bitstream; someone needs to write a Verilog or VHDL compiler for it soon. The one downside with these chips is that they’re tiny; 0.4mm pitch QFN packages. If you can solder that, you’re too good at soldering.

Hacklet 28 – Programmable Logic Hacks

FPGAs, CPLDs, PALs, and GALs, Oh My! This week’s Hacklet focuses on some of the best Programmable Logic projects on! Programmable logic devices tend to have a steep learning curve.  Not only is a new hacker learning complex parts, but there are entire new languages to learn – like VHDL or Verilog. Taking the plunge and jumping in to programmable logic is well worth it though. High-speed projects which would be impossible with microcontrollers are suddenly within reach!

fpga-hdmiA great example of this is [Tom McLeod’s] Cheap FPGA-based HDMI Experimenting Board. [Tom’s] goal was to create a board which could output 720p video via HDMI at a reasonable frame rate. He’s using a Xilinx Spartan 6 chip to do it, along with a handful of support components. The images will be stored on an SD card. [Tom] is hoping to do some video with the setup as well, but he has yet to see if the chip will be fast enough to handle video decoding while generating the HDMI data stream. [Tom] has been quiet on this project for a few months – so we’re hoping that either he will see this post and send an update, or that someone will pick up his source files and continue the project!

ardufpgaNext up is our own [technolomaniac] with his Arduino-Compatible FPGA Shield. Starting out with FPGAs can be difficult. [Technolomaniac] has made it a bit easier with this shield. Originally started as a project on .io and now available in The Hackaday Store, the shield features a Xilinx Spartan 6 FPGA. [Technolomaniac] made power and interfacing easy by including regulators and level shifters to keep the sensitive FPGA happy. Not sure where to start? Check out [Mike Szczys’] Spartan-6 FPGA Hello World! [Mike] takes us from installing Xilinx’s free tool chain to getting a “hello world” led blinker running!

lander3Still interested in learning about Programmable Logic, but not sure where to go? Check out [Bruce Land’s] Teaching FPGA parallel computing. Actually, check out everything [Bruce] has done on – the man is a living legend, and a wealth of information on electronics and embedded systems. Being a professor of engineering at New York’s Cornell University doesn’t hurt either! In Teaching FPGA parallel computing, [Bruce] links to Cornell’s ECE 5760 class, which he instructs. The class uses an Altera/Terasic DE2 FPGA board to demonstrate parallel computing using programmable logic devices. Note that [Bruce] teaches this class using Verilog, so all you seasoned VHDL folks still can learn something new!


chamFinally, we have [Michael A. Morris] with Chameleon. Chameleon is an Arduino compatible FPGA board with a Xilinx Spartan 3A FPGA on-board. [Michael] designed Chameleon for two major purposes:  soft-core processors, and intelligent serial communications interface. On the processor side Chameleon really shines. [Michael] has implemented a 6502 core in his design. This means that it would be right at home as the core of a retrocomputing project. [Michael] is still hard at work on Chameleon, he’s recently gotten fig-FORTH 1.0 running! Nice work [Michael]!

Want more programmable logic goodness? Check out our Programmable Logic List!

That about wraps things up for this episode of The Hacklet! As always, see you next week. Same hack time, same hack channel, bringing you the best of!

Direct Digital Synthesis (DDS) Explained by [Bil Herd]

One of the acronyms you may hear thrown around is DDS which stands for Direct Digital Synthesis. DDS can be as simple as taking a digital value — a collection of ones and zeroes — and processing it through a Digital to Analog Converter (DAC) circuit. For example, if the digital source is the output of a counter that counts up to a maximum value and resets then the output of the DAC would be a ramp (analog signal) that increases in voltage until it resets back to its starting voltage.

This concept can be very useful for creating signals for use in a project or as a poor-man’s version of a signal or function generator. With this in mind I set out here to demonstrate some basic waveforms using programmable logic for flexibility, and a small collection of resistors to act as a cheap DAC. In the end I will also demonstrate an off-the-shelf and inexpensive DDS chip that can be used with any of the popular micro-controller boards available that support SPI serial communication.

All of the topics covered in the video are also discussed further after the break.

Continue reading “Direct Digital Synthesis (DDS) Explained by [Bil Herd]”