Circular Layout ULP for Eagle

Some time last year, Mats Engstrom shared his PHP script for generating commands to move components in CadSoft Eagle to form a perfect circle. If you look at the screenshot, it’s mainly made up of MOVE and ROTATE commands – relatively easy.

Eagle has what it calls user language programs (ULPs) for doing some simple scripting with the ability to display a dialog for user input. I decided to try my hand at creating a ULP that creates these circular layouts. The main advantage of using a ULP is that it has access to your board layout, saving you from some typing. You can also easily iterate through different parameters quickly and without hassle.

I shall illustrate briefly how this circular layout ULP can be used for doing various kinds of layout, with help from some open-source projects with Eagle CAD files.

Ringo3 Clock

The most common use for a circular layout is in clocks. Conveniently, Mats has a project called Ringo3. For photos of the PCB and assembled clock, see this Dangerous Prototypes forum topic.

Delete the existing board (.brd) file to start with an empty PCB created from the schematic. We shall take (2.00, 1.60) to be the centre of the circle, as shown. Eagle 6 introduced a dimensioning tool, used here to show the radius of the circle (1.5″) – handy but not a must.

Ringo3 empty PCB layout

The circular layout ULP has 3 main sections: (i) parts selection, (ii) layout options, and (iii) circle centre point & radius. For parts, enter D for prefix and 1 to 60 and click the Filter button to select components D1 – D60 for layout. The handy table shows you the currently selected list of components. Enter 2 and 1.6 for the circle centre X, Y values that have been identified. The radius has been marked by the dimensioning tool as 1.5. The layout direction is “Clockwise” and we want to place D1 at the top “12 o’clock” position. Click the Do Layout button, and OK to start the layout.

Circular Layout Settings

You should see the components move into place as shown in the next figure.

Ringo3 PCB with laid out LEDs D1 - D60

If you make a mistake, you can always just hit Undo or hold down Ctrl+Z until all the components were back at their original positions.

Continue reading


Apple’s Lightning Digital AV Adapter

Recently, Panic noticed the odd output resolution and MPEG-like artifacts with the new Lightning digital AV adapter and decided to take a hacksaw to it. They found an ARM processor inside.

Lightning digital AV adapter

image credit: Panic blog

Shortly after, they received an anonymous comment that explains it all:

The reason why this adapter exists is because Lightning is simply not capable of streaming a “raw” HDMI signal across the cable. Lightning is a serial bus. There is no clever wire multiplexing involved. […] We did this to specifically shift the complexity of the “adapter” bit into the adapter itself, leaving the host hardware free of any concerns in regards to what was hanging off the other end of the Lightning cable.

This system essentially allows us to output to any device on the planet, irregardless of the endpoint bus (HDMI, DisplayPort, and any future inventions) by simply producing the relevant adapter that plugs into the Lightning port. Since the iOS device doesn’t care about the hardware hanging off the other end, you don’t need a new iPad or iPhone when a new A/V connector hits the market.

While I understand what they are trying to achieve, I think it’s sad that this new Lightning system can no longer carry the uncompressed HDMI output. Maybe they could have streamed the raw video output in a format close to what HDMI expects, then have the adapter add headers and trailers to the data, but that would still be tricky since the system needs to stop sending frames while the adapter is doing its work. And what about HDCP?

Just one of the many tradeoffs that engineers need to make.