Wednesday, October 20, 2010

Eagle switches to XML

Last week a rumor started spreading about Eagle, the popular schematic capture and PCB drawing package used by thousands of electronics enthusiasts, switching to a text-based file format. We at Elektor asked CadSoft, the editor of Eagle, about this rumour and got it confirmed. Somewhere in the hopefully near future Eagle will start using an XML-based file format for storing its drawings. The reason for this change is, according to CadSoft, that the binary format has reached its limits.

I find this reason a bit strange. Why would a text format be more flexible than a binary format? I mean, text is just limited binary, right?

Of course a text-based format is human readable, which is an advantage when trying to debug a broken file. But will this help in real life with a multi-megabyte sized file? (BTW, I have never yet had to debug a PCB file.)
A text-based format will be cross-platform as it avoids byte ordering issues, a good thing. Using XML is probably a good idea too, because it is a well known format and many tools & libraries for fiddling with XML files are readily available.
For the user a text-based format is interesting as it may help speed up certain repetitive tasks like net labeling or copying blocks. Users will start writing utilities for manipulating Eagle files.

Will they? Probably. They always do.

But Eagle already offers a powerful scripting language that lets you do lots of things without learning the file format first, so why bother? By writing a script you can already export everything yourself to a human readable format. And that is exactly what RS did for DesignSpark, the competitor of Eagle Freemium by Farnell (who bought CadSoft some time ago). RS offers scripts that allow you to export Eagle files as ASCII data. This is what it looks like:


(fileUnits IN)
(library Library_1
(padStyleDef "Oval1"
(holeDiam 0.0314961)
(padShape (layerNumRef 1) (padShapeType Oval) (shapeWidth 0.0514961) (shapeHeight 0.102992))
(padStyleDef "Round1"
(holeDiam 0.125984)
(padShape (layerNumRef 1) (padShapeType Ellipse) (shapeWidth 0.133984) (shapeHeight 0.133984))
(padStyleDef "Rectangle1"
(holeDiam 0)
(padShape (layerNumRef 1) (padShapeType Rect) (shapeWidth 0.07) (shapeHeight 0.1))
(padShape (layerNumRef 16) (padShapeType Ellipse) (shapeWidth 0) (shapeHeight 0))

That is not so different from XML, is it?

The only reason I can think of why Farnell/CadSoft wants to switch to XML is that they hope that the heavyweights like Cadence or Pads will start writing Eagle import filters for their products. These products already know XML, it would be easy enough to add Eagle support. And that would be a good sales argument for Eagle. Start simple and low-budget with Eagle and when you’re ready to move on to something more serious you won’t lose your work.

It is all about compatibility.

Thursday, October 7, 2010

Build a dishwashing surveillance system

Every once in while I spend an afternoon or evening just browsing eBay. I do some searches on keywords concerning things that may interest me and I look through the results. When I find something interesting I click on the item for more details. Often I come across items that are sold by Chinese companies that sell lots of other things too. These are my favorite sellers. There are many Chinese eBay shops that sell exactly the same products, they probably are all related, but every once in a while I discover a new “family” of shops with different products.

My latest find is a series of cheap microcontroller boards equipped with a small camera and a 2.8” color TFT display. The camera, 640x320 pixels, is actually a small module that is plugged on top of the board, while the display (320x240 pixels, 262K colors) sits on the other side. You can make a camcorder out of it, because it has a micro SD card connector for storage.

I bought the ATmega32 board including a USBasp ISP programming cable for less than 35 euros (shipping included). It is a complete development system with full documentation and source code in C (with comments in garbage characters, probably Chinese). When it arrived I discovered that the display even has a resistive touchpad on it.

Here is a sneak preview of my killer app for this board: a dishwashing surveillance system that checks my dishwashing qualities. It will detect dirt on the dishes and sound an alarm when everything is dry. Pretty cool, huh?

So, what will you do with it?