Archive for January, 2009

Designing the Milkymist warp engine

During the last days, I’ve been working on the warp engine for Milkymist. Warping is a computationally-intensive operation of the visualization rendering process which consists in taking the currently displayed picture and distorting it. This “distortion” can be of any kind – zooming, rotating, bumping, all at the same time, etc … and is configured by the MilkDrop preset.

The distorted picture has then some effects applied to it, waves and shapes are drawn to it, and the process repeats. This is basically how MilkDrop works.

The way warping is achieved is by using texture mapping on a triangle strip, which is done by your GPU when you run MilkDrop. Mathematically, this is a rather simple process, but when it comes to implementing it efficiently, it brings about long pipelines, precision problems and memory access issues. And CPUs, especially softcores, are way too slow for this task.

The new architecture is entirely based on the stream processing paradigm. Moving data around sometimes involves Verilog modules with nearly one hundred signals, but the resulting implementation should be very fast. Precision problems in linear interpolations are solved using Bresenham’s algorithm. Eventually, the warp engine launches pixel DMAs over the high-performance burst-oriented FML (Fast Memory Link) bus that has been designed as part of Milkymist.

sim_warper1

One last novelty is the use of  Verilator in the test bench. This free cycle-based simulator appears to be full of good ideas. Its main particularity is that it generates a C++ class that implements the behaviour of your IP core as if it was synthesized. This makes it a bit harder to use than other simulators, but brings about high performance and an easy connection of your simulated IP to the “outside world” – two key features when testing the warper engine where dozens of millions of transactions need to be simulated, and reading/writing to test images must be supported.

For smaller projects you can use Icarus Verilog and the GPL edition of CVer – two other good event-based simulators. With such tools, you can completely forget about Modelsim and other stuff with crazy licenses for most of your FPGA projects.

No Comments

DRAM data decay patterns

When debugging the VGA signal generator for Milkymist, I happened to set the framebuffer address to uninitialized memory, and on top of the random data I could see these strange blocks and bars patterns :

unrefreshed_dram

This is very similar to what can be seen here : http://citp.princeton.edu/memory/media/. I wonder what the reason is for DRAM chips to behave like this.

Ah, and now the Milkymist SoC has perfectly working video and memory controllers.

No Comments

The debug interface of a GSM BTS

Here is what you can get if you connect a serial terminal to a Siemens BS11 micro BTS :

bts

The communication parameters are common – 9600, 8N1. When it asks for a password, try “L3proc”. And if you’re wondering where to get those BTSes, you can try here :

http://bs11-abis.gnumonks.org/trac/wiki/BS11_Sales

For those unfamiliar with GSM internals, the Base Transceiver Station (BTS) is a device usually run by mobile phone operators which is like a radio-modem for communicating with the phones, which includes the radio transceiver, modulators and digital interface (E1).

3 Comments

Full Linux support for the Doro 225ipc VoIP phone

This driver allows you to use the keypad, the LCD and the buzzer (for ringtones) of the Doro 225ipc VoIP phone.
The driver is named “freshtel” because the device pops up as “Freshtel FT-102″ – so I bet it should work with all phones that use the same chipset.

This driver was made with usbsnoop and reverse engineering of the protocol.

It supports the USB IDs 6993:b001 – those are the same as the yealink driver from the kernel tree. Although the supported phones use a protocol close to that of Yealink ones, they are not compatible. Moreover, the LCD interface is different between those two phone models – Freshtel phones have a graphic LCD, whereas Yealink phones have a 7-segment display.

Applications that use the LCD still have to be developed.

Download latest release

4 Comments

Consumer-B-Gone

In mid-2008 I designed with Philippe from /tmp/lab the “Consumer-B-Gone” mobile phone ringtone.

Named after the popular TV-B-Gone, it allows you to control the anti-theft in-wheel brakes designed by Gatekeeper Systems. You can lock and unlock the wheels at your will by playing the appropriate ringtone close to the cart !

When you play the ringtone, the electromagnetic interference caused by the coil inside the speaker of your mobile phone reproduces the signal transmitted by the Gatekeeper Systems antenna. A good demonstration of induction laws, a good example of security systems going wrong, and the perfect tool for scaring the consumers away on no-shopping events !

Download lock ringtone

Download unlock ringtone

The French newspaper “Le Monde Diplomatique” has an article which speaks about the Consumer-B-Gone. Read it here, in French.

2 Comments

USB Logic Analyzer

I designed and built this board in mid 2007 as my very first FPGA (and soldering-intensive for that time) project. Its purpose was to sample a reasonable number of logic channels (24) at a high rate, and stream the data to a computer through high-speed USB 2.0. But as the board is FPGA-based, it can be used for any application requiring a high transfer rate (hundreds of MBit/s) with a computer.

The project has gained some popularity from DIY sites, but be sure to check out the “Erratum” section below. Feel free to contribute fixed PCB files and proper software and FPGA design.

Photo and screenshot

ula_top

(Thanks PCB-POOL for providing the circuit board)

ula_detect_win

Description

The board uses a small Altera Cyclone II FPGA (EP2C5T144C7N) and a NET2272 USB controller from NetChip (this part is a bit hard to find, I got mine from Mouser Electronics). The FPGA was programmed with a mix of VHDL and schematic diagrams, and includes a minimal USB protocol handler entirely in hardware (no softcore processor was used).

The board can be self- or USB- powered. The 5V from USB is converted to 3.3V (used by the NET2272 and FPGA I/O) by a LTC3411 switching regulator and to 1.2V by another LTC3411 regulator (used by the FPGA core). The 3.3V supply is also converted to 2.5V by a linear regulator, and used to supply parts of the NET2272.

The board is equipped with three connectors :

  • one 10-pin connector on top of the board is for JTAG configuration of the FPGA. Its pinout is the same as on Altera development boards, so you can directly use Altera Byteblaster cables for instance.
  • one 10-pin connector on the bottom is for connecting a serial FPGA configuration device
  • one 26-pin connector on the bottom is for connecting the probes (or whatever device you fancy ;-)

Erratum

  • The software and the FPGA code are badly designed
  • The switching regulators need additional 100nF decoupling capacitors close to their input pins, or they can go unstable. IN EVERY CASE, DOUBLE-CHECK POWER SUPPLY VOLTAGES BEFORE SOLDERING THE FPGA AND THE NET2272 !
  • The wiring of the USB plug is incorrect, pin 5 is GND (not shield) and pin 4 can be left unconnected.
  • Bit 16 of the NET2272 bus is not connected to the FPGA (the NET2272 can operate in 8-bit mode anyway, but it’s slower).

SMD soldering

Some people think that soldering small SMD parts such as TQFPs require lots of equipment. The board depicted above was entirely soldered by hand using an off-the-shelf soldering iron and a bit of inexpensive solder wick. A TQFP-144 can be soldered in about 10 minutes with very little equipment !

  • For SMD parts with a low pin count (ie. resistors, capacitors, small SOICs…) first make a solder ball on one of the PCB pads. Then heat it with the iron while plunging one pin of the part in the melted solder ball, with a pair of tweezers. Remove the soldering iron. You don’t care if the solder is not good, its only purpose is to prevent the part from moving. Then, solder the other end of the component (be careful not to heat too much, not only you may damage the component but also you risk melting the first solder holding it), and rework the first solder.
    Dont’t mess around with SMD glue, it’s a complete waste of time and money compared to this technique.
  • For SMD parts with a lot of small pins (ie. TQFPs, uMAXs, …) you would go mad trying to solder each pin individually while avoiding short-circuits (and not heating the part too much !). First, prevent the part from moving using approximately the same technique as before : place the part very precisely using your hand or a pair of tweezers, then make a drop of solder on a couple of neighbouring pins (you don’t care if you short them). Double check all pins are correctly placed on their corresponding PCB pads – it will be very difficult to correct an error afterwards. If they are not, melt the solder and carefully move the part. Once the part is correctly placed, make solder bumps on all pins, shorting them all together. Then, using solder wick, remove the excess solder which should go away easily, leaving just enough solder on each pin. Remove the solder residues this method leaves all around (nail polish dissolvent and a toothbrush work as good as flux cleaners, and is a lot cheaper. But get one without acetone, as it can damage some plastics). Visually inspect the connections (if they are short circuits, it is often easier to add a lot of solder over the shorted pins then to remove it using the wick)

Downloads

Schematics (PDF)

PCB layout (PDF)

Altium Designer files

Sample driver

Sample FPGA design

4 Comments

Vacuum tube experiments

Between 2001 and 2005 I did some experiments with old vacuum tubes. You can find cheap or even free tubes and tube equipment in flea markets, dumpsters, amateur radio fairs, etc.

I now have a couple of very old radios which work :

Ondia 185 (1938), my oldest one :

ondia_185

Peugeot P47 (1947) :

peugeot_p47

Reela Radio Prestige 5 bandes (unknown year) :

reela_prestige5

Sonneclair Superlux (1953) :

sonneclair_superlux_exterieur

I even have schematics for two radios close to this one :

superluxselection_ii

Socradel Houlgate (1958), with impressive reception quality :

socradel_houlgate

Aréso (???) :

areso

Radiola RA40A (1950) :

radiola_ra40a

I also built some equipement : two MW radio transmitters which were not very successful (and blew up a couple of parts), and a good audio amplifier, made up exclusively from scavenged parts. Tubes used are 12AT7/ECC81 as preamplifier, EL86 as power amplifier (with A-class automatic cathode bias), and 6X4 as rectifier. “Magic eye” tube moving with music (for the fun) is an EM81. The output audio transformer is from a radio that was beyond repair and that I took away for parts (I did not check impedances, just plugged it in, and it worked). And the high voltage electrolytic capacitors from an industrial motor control system :)

tubeamp1 tubeamp2 tubeamp3

No Comments