VOCore Tutorial Gets You Started With Tiny Router

[Vadim] wrote up this short but sweet tutorial on getting started with the Vocore (tiny) OpenWRT-router-on-a-stamp. If you need more computing power than you can get with an ESP8266, and you want an open-source Linux-plus-Wifi solution in a square inch of board space, the Vocore looks pretty sweet.

We covered the Vocore a while ago. It has 28 GPIOs, all accessible from system calls in OpenWRT. It becomes much more computer-like if you add a dock that breaks out the USB and Ethernet functionality, but that also doubles the price.

IMG_5299_tnGetting started with a no-frills Linux box (chip?) can be intimidating. So it’s a good thing that [Vadim] details a first setup of the Vocore over WiFi and SSH, and then takes you through a button-and-LED style ‘Hello World’ application that makes simple use of the GPIOs.

He says he’s going to interface it eventually with a TI CC110 sub-gig radio unit, but that’s going to involve writing some drivers and will take him some time. We’d love to see how to connect peripherals, so we’re waiting with bated breath.

[Vadim] also helpfully included an un-bricking script for the Vocore, which restores the default firmware and gets you out of whatever hole you’ve managed to dig yourself into. Basically, you connect to the device over a USB-Serial adapter, run his script, and you should be set.

Any of you out there using a Vocore? Or other OpenWRT routers? Give [Vadim]’s tutorial a glance and let us know what you think.

SDR Tutorials From Michael Ossmann

If you’re just getting into software-defined radio (SDR) but you find some of the math and/or terminology a bit of hurdle, you could absolutely do worse than to check out these SDR tutorials by [Michael Ossmann]. While they’re aimed at people using his HackRF One tool (which we love), most of the tutorial videos are very generally applicable, and we realized that we hadn’t mentioned them explicitly before. Shame on us!

Ossmann focuses on SDR using the open-source GNURadio Companion GUI tool, which makes implementing a lot of cool SDR techniques as easy as dragging and dropping items into a flow diagram. If you want an overview of GNURadio or SDR in general, these videos are a must-watch.

In particular, we loved his entries on complex numbers and complex numbers in DSP because he goes through the whole rationale behind using imaginary numbers in radio work with a graphical presentation that helps add rationale to the otherwise slightly spooky math. Heck, watch these two even if you’re not interested in radio.

The newest entry, covering DSP filters includes a great hands-on introduction to finite impulse response (moving average) digital filters. We really like the practical, simulation-based approach presented in the video — it’s just perfect for a quick introduction.

So if you’re looking for a relatively painless way to get into SDR, grab yourself an RTL-SDR dongle, burn yourself a GNURadio Live DVD, and work through these videos.

Firmware Factory: Bit Fields Vs Shift And Mask

Working with embedded systems usually involves writing code which will interface with hardware. This often means working on the register level. It doesn’t matter if we’re talking about a UART, an analog to digital converter, an LCD controller, or some other gizmo. Sooner or later, you’re going to have to break out the datasheets and figure out how to talk to an external device. To succeed at this you must become a master of bit manipulation.

Hardware designers don’t like wasting space, so modes, settings and other small pieces of information are often stored as packed bits. Our processors usually access things a byte (or a word) at a time, so what is the best way to handle this? Like so many other topics in software engineering, there are multiple ways to skin this cat. In C (and its derivatives) there are two major options: shift and mask, and bit fields.

Continue reading “Firmware Factory: Bit Fields Vs Shift And Mask”

Designing A CPU In VHDL For FPGAs: OMG.

If you’ve been thinking about playing around with FPGAs and/or are interested in CPU design, [Domipheus] has started a blog post series that you should check out. Normally we’d wait until the whole series is done to post about it, but it’s looking so good, that we thought we’d share it with you while it’s still in progress. So far, there are five parts.

minispartan6In Part One, [Domipheus] goes through his rationale and plans for the CPU. If you’re at all interested in following along, this post is a must-read. The summary, though, is that he’s aiming to make a stripped-down 16-bit processor on a Spartan 6+ FPGA with basic arithmetic and control flow, and write an assembler for it.

In Part Two, [Domipheus] goes over the nitty-gritty of getting VHDL code rendered and uploaded to the FPGA, and as an example builds up the CPU’s eight registers. If you’re new to FPGAs, pay special attention to the test bench code at the end of the post. Xilinx’s ISE package makes building a test suite for your FPGA code pretty easy, and given the eventual complexity of the system, it’s a great idea to have tests set up for each stage. Testing will be a recurring theme throughout the rest of the posts.

In Part Three, [Domipheus] works through his choices for the instruction set and starts writes up the instruction set decoder. In Part Four, we get to see an ALU and the jump commands are implemented. Part Five builds up a bare-bones control unit and connects the decoder, ALU, and registers together to do some math and count up.

pipe

We can’t wait for further installments. If you’re interested in this sort of thing, and are following [Domipheus]’s progress, be sure to let him know: we gotta keep him working.

Of course, this isn’t the first time anyone’s built a soft-CPU in an FPGA. (The OMG was added mostly to go along with the other TLAs.) Here’s a tiny one, a big one, and a bizarre one.

Using A Voltage Regulator As A Constant Current Source

[Afroman] contacted us to share his new video on the LM317. The humble LM317 adjustable voltage regulator is everywhere. From wifi routers, to high spec lab equipment. Given a noisy input and a variable load, a voltage regulator will give a nice clean, stable output voltage. We’ve covered the basic operation and usage of the LM317 many times. But even the most common of parts can be used in new and interesting ways.

In his video [Afroman] describes how the LM317 can be used to regulate current rather than voltage to provide a constant current source under varying load. This can useful for a number of applications including driving LEDs and laser diodes. While this circuit may not be as efficient as an LED driver module or a switching solution the LM317 is cheap and readily available. [Afroman] also describes how the circuit works in detail allowing us to enjoy this ubiquitous part in this slightly unusual application.

Continue reading “Using A Voltage Regulator As A Constant Current Source”

How To Directly Program An Inexpensive ESP8266 WiFi Module

The ESP8266 is the answer to “I want something with Wifi.” Surprisingly, there are a number of engineers and hobbyists who have not heard of this chip or have heard of it but don’t really understand what it is. It’s basically the answer to everything IoT to so many engineering problems that have plagued the hobbyist and commercial world alike.

The chip is a processor with integrated RAM, some ROM, and a WiFi radio, and the only external components you will need are 4 capacitors, a crystal and an external flash! It’s CHEAP, like $4/ea cheap! Or $5 if you want it on a nice, convenient carrier board that includes all these components. The power consumption is reasonable (~200mA)1, the range is insane ~300m2 without directional equipment, and a PCB trace antenna and ~4km if you want to be ridiculous.

One place thing that more people need to know about is how to program directly for this chip. Too many times projects use it as a crutch via the AT commands. Read on and find out how to hello world with just this chip.

Continue reading “How To Directly Program An Inexpensive ESP8266 WiFi Module”

baby holding IC chip

Ask Hackaday: Your Very First Microcontroller

Necessity is the mother of invention. It is also true that invention necessitates learning new things. And such was the case on the stormy Tuesday morning our story begins.  Distant echos of thunder reverberated in the small 8 x 16 workshop, drawing my attention to the surge suppressor powering my bench.  With only a few vacation days left, my goal of finishing the hacked dancing Santa Claus toy was far from complete. It was for a Secret Santa gift, and I wanted to impress. The Santa moved from side to side as it sang a song. I wanted to replace the song with a custom MP3 track. In 2008, MP3 players were cheap and ripe for hacking. They could readily be picked up at local thrift shops, and I had picked up a few. It soon became clear, however, that I would need a microcontroller to make it do what I wanted it to do.

Continue reading “Ask Hackaday: Your Very First Microcontroller”