<?xml version="1.0"?>
<!-- name="generator" content="blosxom/2.0.2" -->
<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">

<rss version="0.91">
  <channel>
    <title>peteg's blog   2010-02-15-Assembly.autumn</title>
    <link>http://peteg.org/blog</link>
    <description></description>
    <language>en</language>

  <item>
    <title>Some kind of progress.</title>
    <link>http://peteg.org/blog/2010/08/13#2010-08-13-Esterel</link>
    <category>/hacking/nixie_clock</category>
    <description>
&lt;p&gt;

The controller for the nixie clock is ridiculously complex, given how
many buttons the remote control has and the combinatory explosion of
modes it can be in. Ergo the attraction of &lt;a href=&quot;http://www.esterel-technologies.com/&quot;&gt;Esterel&lt;/a&gt;, the venerable
imperative synchronous language that is supposed to nail exactly these
problems.

&lt;/p&gt;&lt;p&gt;

The only publicly-available tools for &lt;a href=&quot;http://www.esterel-technologies.com/&quot;&gt;Esterel&lt;/a&gt; are from the crusty
old v5.92 distribution of circa 2000, which presumably occurred before
&lt;a href=&quot;http://www.esterel-technologies.com/v3/?id=37466&quot;&gt;G&amp;eacute;rard Berry&lt;/a&gt; et al tried to commercialise it. [*] Fortunately for
me, &lt;a href=&quot;http://www.tbrk.org/&quot;&gt;Tim&lt;/a&gt; has tried them out recently and &lt;a
href=&quot;http://www.tbrk.org/esterel/index.html&quot;&gt;demonstrated&lt;/a&gt; that
they're not &lt;em&gt;too&lt;/em&gt; crusty for my kind of purpose.

&lt;/p&gt;&lt;p&gt;

Up to now I've spent more time than I should doing the boilerplate,
and am only just getting started on the controller proper. It is
difficult to work out the architecture ahead of time, given how much
of neophyte I am with the language. The system interfaces are pretty
good, and it seems possible that one day I could run some of this code
on an &lt;a href=&quot;http://en.wikipedia.org/wiki/Atmel_AVR&quot;&gt;AVR&lt;/a&gt;.

&lt;/p&gt;&lt;p&gt;

I meant to say that Rob gave me a remote that works fine with
the &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7250&quot;&gt;ts7250&lt;/a&gt;. I think he got it to control MythTV. It's quite nice,
and the HID driver in &lt;a href=&quot;http://www.kernel.org/&quot;&gt;Linux&lt;/a&gt; has been very cooperative.

&lt;/p&gt;&lt;p&gt;

[*] Well, there is also the &lt;a
href=&quot;http://www1.cs.columbia.edu/~sedwards/cec/&quot;&gt;Columbia Esterel
Compiler&lt;/a&gt;, but it hasn't seen any development for many years now.

&lt;/p&gt;</description>
  </item>
  <item>
    <title>Adding a temperature sensor to the clock.</title>
    <link>http://peteg.org/blog/2010/07/10#2010-07-10-Temperature</link>
    <category>/hacking/nixie_clock</category>
    <description>
&lt;p&gt;

My &lt;a href=&quot;http://en.wikipedia.org/wiki/Ho_Chi_Minh&quot;&gt;Hồ Chí Minh&lt;/a&gt; clock has a temperature reading on it, alongside the
lunar calendar, so I figured the nixie clock should have one too.

&lt;/p&gt;&lt;p&gt;

&lt;a
href=&quot;http://www.linuxfocus.org/English/November2003/article315.shtml&quot;&gt;In
the past&lt;/a&gt; &lt;a
href=&quot;http://en.wikipedia.org/wiki/1-Wire&quot;&gt;one-wire&lt;/a&gt; temperature
sensors have been cheap and plentiful, and were traditionally hooked
up to classic PC serial or parallel ports. Nowadays the sensors seem
to start at , though I was fortunate to get some &lt;a href=&quot;http://www.maxim-ic.com/datasheet/index.mvp/id/2812&quot;&gt;DS18B20&lt;/a&gt;s from &lt;a
href=&quot;http://cgi.ebay.com.au/1-pce-DS18B20-18B20-Temperature-Sensor-MAXIM-DS1820-/280400099248&quot;&gt;this
bloke on eBay&lt;/a&gt; for  each plus postage. The &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7250&quot;&gt;ts7250&lt;/a&gt;'s GPIO
pins stand in for the less flexible interfaces of yore.

&lt;/p&gt;&lt;p&gt;

These DS18B20 devices are pretty fancy, being able to source power
parasitically from the data bus and yielding 12 bits of temperature
data. They're only accurate to 0.5&amp;deg; on average, though, or perhaps
a bit better at room temperatures, so I don't understand why one would
need more than the 9 bits of the other models.

&lt;/p&gt;&lt;p&gt;

Anyway, wiring it up took about 5 minutes, and finding a suitable
cable another half-hour or so. Fortunately the first four GPIO pins of
the DIO header on the ts7250 are supposed to have the requisite
pull-up resistors, so the sensor can indeed be powered parasitically.

&lt;/p&gt;&lt;p&gt;

Getting &lt;a href=&quot;http://www.kernel.org/&quot;&gt;Linux&lt;/a&gt; to talk to it was a bit challenging, as the one-wire
drivers don't seem to be set up for actual use. Apparently you have to
use the non-mainline &lt;a
href=&quot;https://dev.openwrt.org/browser/trunk/package/w1-gpio-custom/&quot;&gt;&lt;code&gt;w1-gpio-custom&lt;/code&gt;&lt;/a&gt;
module to indicate the GPIO pin to the one-wire driver. I don't know
how to do it any other way; perhaps it is supposed to be hardwired
somewhere. Moreover to get timing right for the parasitic powering,
one needs a few more patches, &lt;a
href=&quot;http://plugcomputer.org/plugforum/index.php?action=printpage;topic=163.0&quot;&gt;which
this bloke has hacked together&lt;/a&gt;.

&lt;/p&gt;&lt;p&gt;

It works:

&lt;/p&gt;
&lt;pre&gt;
# cat /sys/bus/w1/devices/28-0000027d5e12/w1_slave
09 01 4b 46 7f ff 07 10 bf : crc=bf YES
09 01 4b 46 7f ff 07 10 bf t=16562
&lt;/pre&gt;
&lt;p&gt;

but often the &lt;code&gt;w1-therm&lt;/code&gt; driver complains:

&lt;/p&gt;
&lt;pre&gt;
w1_slave_driver 28-0000027d5e12: 18S20 doesn't respond to CONVERT_TEMP.
&lt;/pre&gt;
&lt;p&gt;

and the CRC check fails with occasionally crap data. I'm suspicious
about the device ID as the code apparently does know about the
DS18B20. Unloading the &lt;code&gt;w1&lt;/code&gt; drivers doesn't work
either. Still, this is all much better than I had any right to expect,
I guess.

&lt;/p&gt;</description>
  </item>
  <item>
    <title>We have real time.</title>
    <link>http://peteg.org/blog/2010/04/13#2010-04-13-RealTime</link>
    <category>/hacking/nixie_clock</category>
    <description>
&lt;p&gt;

Finally I have managed to get a real-time &lt;a href=&quot;http://www.kernel.org/&quot;&gt;Linux&lt;/a&gt; kernel running on
the &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7250&quot;&gt;ts7250&lt;/a&gt;, resulting in a flicker-free display. Score one to
patience.

&lt;/p&gt;&lt;p&gt;

Briefly, the &lt;a href=&quot;http://www.spinics.net/lists/linux-rt-users/&quot;&gt;Linux RT&lt;/a&gt; blokes skipped 2.6.32.x as the kernel's
concurrency foundations got a reworking. They released an RT patch
against 2.6.33.2, and as &lt;a
href=&quot;http://ynezz.ibawizard.net/ts72xx/linux-kernel/2.6.33/&quot;&gt;ynezz
has forward-ported the ts72xx patches&lt;/a&gt; it was a cinch to move to
the bleeding edge. &lt;a href=&quot;http://www.yaffs.net/&quot;&gt;YAFFS&lt;/a&gt; (a flash filesystem) broke as it uses
some old-school mutexery. Grossly updating it all to the &lt;code&gt;struct
mutex&lt;/code&gt; way of doing things is straightforward and seems to work.

&lt;/p&gt;&lt;p&gt;

Hacking the clock driver code is trickier now though, as the process
runs at the maximum real-time priority. If it loops without making
syscalls, the system dies.

&lt;/p&gt;</description>
  </item>
  <item>
    <title>&lt;a href=&quot;http://mpd.wikia.com/&quot;&gt;MPD&lt;/a&gt; on the nixie clock.</title>
    <link>http://peteg.org/blog/2010/02/27#2010-02-27-mpd</link>
    <category>/hacking/nixie_clock</category>
    <description>
&lt;p&gt;

Slow and steady progress compiling software this week. It is tedious
as hell, and I am mystified as to why mature projects still have such
baroque configuration management systems. For example,
&lt;code&gt;GLib&lt;/code&gt; (a part of &lt;a href=&quot;http://www.gtk.org/&quot;&gt;GTK&lt;/a&gt;) does not support
cross-compilation out of the box. A few hacks later and it does
compile relatively painlessly, so why haven't the hacks been folded
back into the project itself? I think the lasting effect of &lt;a href=&quot;http://www.debian.org/&quot;&gt;Debian&lt;/a&gt;'s packaging of the known universe is that these nasty problems
get patched but not pushed (or accepted or whatever) upstream.

&lt;/p&gt;&lt;p&gt;

Anyway, I was shocked, surprised and relieved that my
long-in-the-making cross-compiled &lt;a href=&quot;http://mpd.wikia.com/&quot;&gt;MPD&lt;/a&gt; ran first-go on the &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7250&quot;&gt;ts7250&lt;/a&gt;. It took me an age to configure &amp;mdash; &lt;a href=&quot;http://www.alsa-project.org/&quot;&gt;ALSA&lt;/a&gt; calls the
mixer &quot;Speaker&quot; instead of the conventional &quot;Master&quot;, and &lt;a href=&quot;http://www.alsa-project.org/&quot;&gt;ALSA&lt;/a&gt; is
so overengineered that even something this simple requires forensic
deobfuscation. Everyone's had problems with &lt;a href=&quot;http://www.alsa-project.org/&quot;&gt;ALSA&lt;/a&gt;, so &lt;a href=&quot;http://www.google.com/&quot;&gt;Google&lt;/a&gt; is
full of unanswered questions from noobs with poor grammar, or pages
from 2005 describing now-obsolete obscurities.

&lt;/p&gt;&lt;p&gt;

Well, yeah. Using the pleasant &lt;a href=&quot;http://mpd.wikia.com/&quot;&gt;MPD&lt;/a&gt; client &lt;a href=&quot;https://theremin.sigterm.eu/&quot;&gt;Theremin&lt;/a&gt;, I can now
blast tunes from the Nixie clock and control it from the laptop. It
sounds fine, and uses less than 60% of the CPU with the clock driver
doing its thing. I feel like I have finally joined the class of 1998.

&lt;/p&gt;
&lt;div class=&quot;figure&quot;&gt;
&lt;p&gt;&lt;a href=&quot;http://peteg.org//static/Computer-Remote-Control-SZRM873-.jpg&quot;&gt;&lt;img src=&quot;http://peteg.org//static/cache/tn_Computer-Remote-Control-SZRM873-.jpg&quot; width=&quot;70&quot; height=&quot;70&quot; class=&quot;scaled&quot; style=&quot;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;

&lt;p&gt;

The last of the desiderata is a remote control, so I can park the
clock on the mantelpiece and do less sophisticated things without the
&lt;a href=&quot;http://www.apple.com/macbook/&quot;&gt;MacBook&lt;/a&gt;. The receiver half of this cheap-arse infra red thing I
bought does not get along with the &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7250&quot;&gt;ts7250&lt;/a&gt; too well, though &lt;a
href=&quot;http://hardware4linux.info/component/39833/&quot;&gt;it might be OK on
stock hardware&lt;/a&gt;. Having pretty much given up on it, I will flog its
carcase in all the fora known to Cirrus EP93xx sufferers as a public
service. I would so dearly like to be cool and trendy and BlueToothy,
but I have no cool and trendy mobile phone to pair a receiver with.

&lt;/p&gt;</description>
  </item>
  <item>
    <title>Scraping the nixie clock software together.</title>
    <link>http://peteg.org/blog/2010/02/16#2010-02-16-Software</link>
    <category>/hacking/nixie_clock</category>
    <description>
&lt;p&gt;

I spent the evening polishing a root filesystem for the &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7250&quot;&gt;ts7250&lt;/a&gt;. The flash is quite fat (128Mb) so I gave up on some of the
buggy &lt;a href=&quot;http://busybox.net/&quot;&gt;busybox&lt;/a&gt; applets (&lt;code&gt;udhcpc&lt;/code&gt; in particular) in
favour of their real counterparts from the &lt;a href=&quot;http://www.debian.org/&quot;&gt;Debian&lt;/a&gt; distro. This
approach put &lt;a href=&quot;http://matt.ucc.asn.au/dropbear/dropbear.html&quot;&gt;dropbear&lt;/a&gt; back onto its branch, and as the board can
reliably connect to the WiFi router I can now &lt;a href=&quot;http://www.openssh.com/&quot;&gt;SSH&lt;/a&gt; into it almost
always after boot. It displays the time now, and synchronises with &lt;a href=&quot;http://www.ntp.org/&quot;&gt;ntp&lt;/a&gt;, and the built-in real-time clock works too, albeit with some
hefty drift.

&lt;/p&gt;&lt;p&gt;

Unfortunately the system still does not schedule my program very
satisfactorily: any perturbation in CPU load results in flicker, and
it struggles to play an mp3 without skipping. This is with a
low-latency &lt;a href=&quot;http://www.kernel.org/&quot;&gt;Linux&lt;/a&gt; kernel (2.6.32.3). I get the impression that
later kernels in that series are easy to get going on the &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7250&quot;&gt;ts7250&lt;/a&gt;,
so I might try one, but apparently there will &lt;a
href=&quot;http://lwn.net/Articles/370697/&quot;&gt;not be a full RT patch for
2.6.32&lt;/a&gt;. Bleeding edge it may have to be.

&lt;/p&gt;&lt;p&gt;

Part of the reason is that my program naively uses the kernel
scheduler for all delays, not just the larger ones. Thus when there is
contention for the CPU the system overhead spikes, taking roughly as
much time as user code. The &lt;code&gt;sirq&lt;/code&gt; (presumably clock
interrupt) load is circa 10%. I can feel some busy waiting coming on.

&lt;/p&gt;</description>
  </item>
  <item>
    <title>Putting it together.</title>
    <link>http://peteg.org/blog/2010/02/15#2010-02-15-Assembly</link>
    <category>/hacking/nixie_clock</category>
    <description>
&lt;div class=&quot;figure&quot;&gt;
&lt;p&gt;&lt;a href=&quot;http://peteg.org//static/P2150005.JPG&quot;&gt;&lt;img src=&quot;http://peteg.org//static/cache/tn_P2150005.JPG&quot; width=&quot;93&quot; height=&quot;70&quot; class=&quot;scaled&quot; style=&quot;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;

&lt;div class=&quot;figure&quot;&gt;
&lt;p&gt;&lt;a href=&quot;http://peteg.org//static/P2150006.JPG&quot;&gt;&lt;img src=&quot;http://peteg.org//static/cache/tn_P2150006.JPG&quot; width=&quot;93&quot; height=&quot;70&quot; class=&quot;scaled&quot; style=&quot;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;


&lt;p&gt;

Replacing the anode driver transistor was entirely routine. Its friend
survived. As I was having one of those rare days when the crappiness
of earlier decisions on this and other topics was not only manifest
but within reach of correction, I decided to assemble the
hardware. Here's some photos, taken with the &lt;a href=&quot;http://www.olympus.com.au/component/option,com_product/id,342/task,detail/Itemid,69/&quot;&gt;Olympus &amp;mu;Tough 6010&lt;/a&gt; on
Daz's shonky tripod.

&lt;/p&gt;&lt;p&gt;

It's running on one of &lt;a href=&quot;http://www.cse.unsw.edu.au/~andrewt/&quot;&gt;Andrew T&lt;/a&gt;'s old power supplies, as my
old-school LM7805 arrangement couldn't handle the heat. These devices
have good failure modes for the most part, but overheating manifests
as a loop: the &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7250&quot;&gt;ts7250&lt;/a&gt; draws less current when the CPU is idle, so
when the regulator comes back from a shutdown due to heat the
processor gets to run for a few seconds before the regulator overheats
once more. Nasty.

&lt;/p&gt;&lt;p&gt;

I discovered the &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7250&quot;&gt;ts7250&lt;/a&gt; puts out enough current on the &lt;a href=&quot;http://www.usb.org/&quot;&gt;USB&lt;/a&gt;
port to power the WiFi and audio adaptors.

&lt;/p&gt;&lt;p&gt;

It seems that &lt;a href=&quot;http://www.google.com/&quot;&gt;Google&lt;/a&gt;'s &lt;a
href=&quot;http://code.google.com/android/&quot;&gt;Android&lt;/a&gt; platform is
attracting a lot of people to &lt;a href=&quot;http://en.wikipedia.org/wiki/ARM_architecture&quot;&gt;ARM&lt;/a&gt; platforms.

&lt;/p&gt;&lt;p&gt;

Software-wise things are still on the slow. &lt;a href=&quot;http://www.debian.org/&quot;&gt;Debian&lt;/a&gt;'s
&lt;code&gt;armel&lt;/code&gt; port features a working &lt;a href=&quot;http://matt.ucc.asn.au/dropbear/dropbear.html&quot;&gt;dropbear&lt;/a&gt; SSH server, so
I reckon there's something fishy with my cross-compiler setup, maybe
the C libraries. Conversely nothing &lt;a href=&quot;http://www.alsa-project.org/&quot;&gt;ALSA&lt;/a&gt;-ish wanted to
run. Generally things are looking pretty likely.

&lt;/p&gt;</description>
  </item>
  <item>
    <title>&lt;a href=&quot;http://www.debian.org/&quot;&gt;Debian&lt;/a&gt; on the &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7250&quot;&gt;ts7250&lt;/a&gt; and another kind of disaster</title>
    <link>http://peteg.org/blog/2010/02/14#2010-02-14-DebianAhoy</link>
    <category>/hacking/nixie_clock</category>
    <description>
&lt;p&gt;

The options for getting software onto the &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7250&quot;&gt;ts7250&lt;/a&gt; are unappetising;
either hand-compiling everything or running the risk of someone else
miscompiling something. I'm sick of the former so I thought I'd try
the latter, in the form of &lt;a href=&quot;http://www.debian.org/&quot;&gt;Debian&lt;/a&gt;'s &lt;code&gt;armel&lt;/code&gt; port. &lt;a
href=&quot;http://martinwguy.co.uk/martin//ts7250/DEBIAN&quot;&gt;Martin Guy's
recipe&lt;/a&gt; makes this straightfoward. &lt;a href=&quot;http://www.cse.unsw.edu.au/~andrewt/&quot;&gt;Andrew T&lt;/a&gt; gave me a little
script that copies binaries and just the libraries they depend on, but
what I really want is an easy way to recompile programs and their
dependencies. I've used &lt;code&gt;apt-get source &lt;em&gt;blah&lt;/em&gt;&lt;/code&gt; in
the past and been happy.

&lt;/p&gt;&lt;p&gt;

Bogosity: &lt;code&gt;dpkg&lt;/code&gt; does not like running on NFS exported
through &lt;code&gt;nfs-user-server&lt;/code&gt;. It seems that &lt;code&gt;lockd&lt;/code&gt;
has been on their TODO list for approximately the last twelve
years. Sanity and serenity is provided by
&lt;code&gt;nfs-kernel-server&lt;/code&gt;.

&lt;/p&gt;&lt;p&gt;

I sorted out the remaining issues on the nixie board, viz making the
anode resistors uniformly 11k&amp;Omega;. The display is bright but some
PWM will cure that. So it was time to fit the whole show together, and
just as I gave up on one of &lt;a href=&quot;http://www.cse.unsw.edu.au/~andrewt/&quot;&gt;Andrew T&lt;/a&gt;'s power supplies I managed to
release some magic smoke from the nixie board by forgetting how
parlous the power arrangement was when reaching over the board. I'd
switched everything else off but not my power supply, which the
cockroaches will be getting when the time comes. The &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7250&quot;&gt;ts7250&lt;/a&gt;
survived unscathed, and a ginger replugging of it all revealed that
I'd only managed to toast at most two of the anode switching
transistors, and their failure mode is to go
short-circuit. Phew. Relief. The Russian K155ИД1 is still going like a
champ, and John Taylor's power supply didn't notice a thing.

&lt;/p&gt;&lt;p&gt;

More &lt;a href=&quot;http://www.rohs.gov.uk/&quot;&gt;RoHS-non-compliant&lt;/a&gt;
repair tomorrow.

&lt;/p&gt;</description>
  </item>
  <item>
    <title>Nixie clock update: hacking continues</title>
    <link>http://peteg.org/blog/2010/02/12#2010-02-12-MoreHackery</link>
    <category>/hacking/nixie_clock</category>
    <description>
&lt;p&gt;

Well! It's been a long time since I wrote about this project. A lot
has happened, even some good things. Hardware-wise I put the &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7260&quot;&gt;ts7260&lt;/a&gt; beyond use by somehow trashing the onboard flash. All I did
was ask it to write 6kb to the root filesystem! Instead it took out
enough of Redboot (or perhaps one of the even more obeisant
Technologic Systems boot loaders) that recovery became a matter of finding
something with real serial ports, and trying my luck with the serial
blaster utility that someone wrote for precisely this
contingency. Suffice it to say I got far enough to know the board is
not toast, but not as far as getting it working again.

&lt;/p&gt;&lt;p&gt;

I met up with &lt;a href=&quot;http://www.cse.unsw.edu.au/~andrewt/&quot;&gt;Andrew T&lt;/a&gt; on Monday past and he gifted me with a pair
of &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7250&quot;&gt;ts7250&lt;/a&gt; boards, quite similar to the &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7260&quot;&gt;ts7260&lt;/a&gt; but lacking the
power supply magic; I must feed them 5v and nothing more. They both
fired up fine, but with &lt;a href=&quot;http://www.kernel.org/&quot;&gt;Linux&lt;/a&gt; systems too far out of date for &lt;a
href=&quot;http://peteg.org/blog/hacking/nixie_clock/2010-01-17-LinuxRTAhoy.autumn&quot;&gt;my
purposes&lt;/a&gt;. Fortunately their real-time clocks appear to work, and
the world has regained its rosy tinge.

&lt;/p&gt;&lt;p&gt;

So I spent this last week, more off than on, building kernels and
wireless drivers and whatnots for one of these boards, saving the
other against calamity. It mostly works, albeit with some dodginess in
connecting to the WiFi: the dhcp client in &lt;a href=&quot;http://busybox.net/&quot;&gt;busybox&lt;/a&gt; takes a few
goes to get a lease. I need it to reliably connect before I can cut
the rats' nest of umbilical cords the &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7250&quot;&gt;ts7250&lt;/a&gt; presently lives off.

&lt;/p&gt;&lt;p&gt;

Today I bought a &lt;a
href=&quot;http://www.soundblaster.com/products/product.asp?category=1&amp;amp;subcategory=207&amp;amp;product=17892&quot;&gt;Creative
Sound Blaster Play!&lt;/a&gt; USB audio dongle. &lt;a href=&quot;http://msy.com.au/&quot;&gt;MSY&lt;/a&gt; is selling them for
just &lt;$25 /&gt;, a steal for such an anachronistic device. (Creative itself
wants &lt;$28 /&gt; + &lt;$15 /&gt; delivery.) Quality is fine to these non-discerning
ears. It will take me a while to compile up all the &lt;a href=&quot;http://www.alsa-project.org/&quot;&gt;ALSA&lt;/a&gt; libraries
and things; I'm hoping to use &lt;a href=&quot;http://www.underbit.com/products/mad/&quot;&gt;MAD&lt;/a&gt; with an infra-red remote
control.

&lt;/p&gt;&lt;p&gt;

Lesson of the day: say &lt;code&gt;configure --prefix= yadda&lt;/code&gt;
where &lt;code&gt;&lt;/code&gt; is where the artefact will appear relative
to the root of the destination filesystem, and say &lt;code&gt;make
DESTDIR= yadda&lt;/code&gt; where &lt;code&gt;&lt;/code&gt; is the root
of the destination filesystem on the host system. &lt;a href=&quot;http://www.alsa-project.org/&quot;&gt;ALSA&lt;/a&gt; embeds
absolute paths into the libraries. This approach screws up the paths
in the &lt;code&gt;.la&lt;/code&gt; files that &lt;code&gt;libtool&lt;/code&gt; generates; it
assumes that you'll be compiling relative to &lt;code&gt;&lt;/code&gt;.

&lt;/p&gt;&lt;p&gt;

Software wise I hacked up a crossfader for the digits. It looks OK,
but as &lt;a href=&quot;http://www.cs.mu.oz.au/~bjpop/&quot;&gt;Bernie&lt;/a&gt; observes it will certainly need tweaking to take
care of the relative digit brightnesses and perhaps those amongst the
tubes too.

&lt;/p&gt;&lt;p&gt;

I spent the final week of January in Orange. I helped Dad build a
wooden case for the whole thing. It's not going to set any size or
innovation records, but it looks tidy enough. I'll take a photo when
the software is sorted out.

&lt;/p&gt;</description>
  </item>
  <item>
    <title>Completely wired.</title>
    <link>http://peteg.org/blog/2010/01/19#2010-01-19-WiredUp</link>
    <category>/hacking/nixie_clock</category>
    <description>
&lt;object data=&quot;http://www.youtube.com/v/vYWaUwq6Gsg&amp;amp;hl=en_US&amp;amp;fs=1&quot;
           height=&quot;344&quot; type=&quot;application/x-shockwave-flash&quot;
           width=&quot;425&quot; style=&quot;float: right&quot; &gt;&lt;param name=&quot;movie&quot;
           value=&quot;http://www.youtube.com/v/vYWaUwq6Gsg&amp;amp;hl=en_US&amp;amp;fs=1&quot;
           /&gt;&lt;/object&gt;
&lt;p&gt;

Finished wiring up the clock, and it seems to go fine. The video is
pretty boring, I know, but I had to have some evidence of how I spent
the past few weeks. :-) The tubes do have uneven brightness: the third
one seems to have a blackened grill, and is dimmer even though it has
a smaller anode resistor. The fourth also has a smaller anode
resistor, making it a bit brighter than the first two.

&lt;/p&gt;&lt;p&gt;

Apart from some fiddly soldering with a fat wedge tip, this came
together fairly easily. The next thing to do is sort out the software,
rig up a case and see if &lt;a href=&quot;http://www.cse.unsw.edu.au/~andrewt/&quot;&gt;Andrew T&lt;/a&gt; will part with another &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7260&quot;&gt;ts7260&lt;/a&gt;. I've yet to try out John Taylor's power supply, and am hoping
I can run the whole show off the 5v the &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7260&quot;&gt;ts7260&lt;/a&gt; is supposed to pump
on the LCD port.

&lt;/p&gt;&lt;p&gt;

As for numeral systems, the answer is &lt;a
href=&quot;http://en.wikipedia.org/wiki/List_of_numeral_system_topics&quot;&gt;a
big no&lt;/a&gt; &amp;mdash; there are heaps of natural-language numeral systems
in common use, even now.

&lt;/p&gt;</description>
  </item>
  <item>
    <title>Real-time and high-resolution timers for &lt;a href=&quot;http://www.kernel.org/&quot;&gt;Linux&lt;/a&gt; 2.6.29.6 running on the &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7260&quot;&gt;ts7260&lt;/a&gt;</title>
    <link>http://peteg.org/blog/2010/01/17#2010-01-17-LinuxRTAhoy</link>
    <category>/hacking/nixie_clock</category>
    <description>
&lt;p&gt;

I got bitten by the classic &lt;a href=&quot;http://www.kernel.org/&quot;&gt;Linux&lt;/a&gt;-ism: the standard resolution of
&lt;code&gt;usleep&lt;/code&gt; is only 10ms on these ARM boards, which is way too
slow to do the kind of multiplexing the clock needs: I need delays of
about 2ms and could use 100&amp;micro;s. I'm allergic to busy-waiting in
user-space too.

&lt;/p&gt;&lt;p&gt;

The short story is that I tried 2.6.31.x and couldn't get the board to
boot, but 2.6.29.6 works fine, after some mild futzing in applying the
patch in the &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7260&quot;&gt;ts7260&lt;/a&gt; forum's file area at &lt;a href=&quot;http://yahoo.com/&quot;&gt;Yahoo&lt;/a&gt;. It does not
provide high-resolution timers for the ARM ep93xx which the &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7260&quot;&gt;ts7260&lt;/a&gt;
is blessed with, though. One can readily apply the &lt;a
href=&quot;http://rt.wiki.kernel.org/&quot;&gt;RT patches&lt;/a&gt; to 2.6.29.6, but
these also do not include the hrtimers stuff; one needs a &lt;a
href=&quot;http://lkml.org/lkml/2009/7/22/78&quot;&gt;further, not so clean
patch&lt;/a&gt; to get these working.

&lt;/p&gt;&lt;p&gt;

So the clock now seems to scan OK, with no flicker visible to my eyes
(on the single tube I have installed so far). Well, that's true
provided that no other process is running. I've selected the right
scheduler, cranked up the priorities, locked the program's virtual
memory, and generally futzed with no improvement in robustness under
load.

&lt;/p&gt;&lt;p&gt;

As has been true for a long time, there is some &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7260&quot;&gt;ts7260&lt;/a&gt; stuff in
the latest &lt;a href=&quot;http://www.kernel.org/&quot;&gt;Linux&lt;/a&gt; kernel (2.6.32.3), and apparently the RT patches
have been merged to the mainline. (I cannot really tell, but the
&lt;code&gt;CONFIG_PREEMPT_RT&lt;/code&gt; and friends options are there.) I'll
see if I can get that to boot and perhaps figure out the hrtimers
story there.

&lt;/p&gt;&lt;p&gt;

An aside: here's a good post on the &lt;a
href=&quot;http://www.cons.org/cracauer/sigint.html&quot;&gt;proper treatment of
&lt;code&gt;SIGINT&lt;/code&gt;&lt;/a&gt;.

&lt;/p&gt;</description>
  </item>
  <item>
    <title>Screwing up my nerve</title>
    <link>http://peteg.org/blog/2010/01/15#2010-01-15-ScrewingUpMyNerve</link>
    <category>/hacking/nixie_clock</category>
    <description>
&lt;p&gt;

I wired up most of the first nixie tube to the board today. It's a bit
hairy for a few reasons: a misconnection could fry me or the ARM
board, and small mistakes could lead to extensive resoldering. Thus
far things have gone OK; it turns out my
33k&amp;Omega;-series/33k&amp;Omega;-pull-down setup is strong enough while
the ARM board is unpowered, but once the ARM board is fired up the
100k&amp;Omega; pull-up on the &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7260&quot;&gt;ts7260&lt;/a&gt; is enough to fire the anode
switcher. I cured this empirically, by reducing the series to
11k&amp;Omega; and the pull-down to 4.7k&amp;Omega;. It works, and the voltage
levels seem plausible, but they still imply the current is very
weak. I wonder about noise.

&lt;/p&gt;&lt;p&gt;

Now I can switch amongst the cathodes (those I've wired up) using the
K155ИД1, and that's about that. I need to replace all my resistor
pairs and solder up a further three tubes. Joy.

&lt;/p&gt;&lt;p&gt;

In other news John Taylor's high-voltage power supply turned up. Took
about four days to get here from California. I haven't fired it up
yet, but will after I get the display board completed.

&lt;/p&gt;</description>
  </item>
  <item>
    <title>Multiplexing conundrum</title>
    <link>http://peteg.org/blog/2010/01/14#2010-01-14-Conundrum</link>
    <category>/hacking/nixie_clock</category>
    <description>
&lt;p&gt;

I constructed a further three anode switchers and they work fine. Now
I'm up to wiring in the nixie tubes, but as I only want to do this
once, I'm getting a bit ginger. My concern is that the multiplexing
setup I'm using, which is essentially what everyone seems to use,
allows more than one tube to be on at a time. So in the worst case the
poor K155ИД1 chip would have to pass approx 12mA (four tubes at 3mA
each), which exceeds its rated 7mA.

&lt;/p&gt;&lt;p&gt;

From the software I've found, no-one seems to do anything clever, so I
expect their microcontrollers get into the main scanning loop quickly
enough that nothing blows up. Unfortunately the &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7260&quot;&gt;ts7260&lt;/a&gt; takes
several seconds to boot Linux, with the boot loader delaying three
seconds for recovery purposes, so I don't think I can ignore this.

&lt;/p&gt;&lt;p&gt;

According to the ep9301 ARM chip specs, the &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7260&quot;&gt;ts7260&lt;/a&gt; is supposed to
configure all these GPIO pins as inputs on bootup, which leaves them
floating. This is probably safe from the chip's point of view, but not
the nixie board's.

&lt;/p&gt;&lt;p&gt;

A solution is to pepper the anode drivers with &lt;a
href=&quot;http://en.wikipedia.org/wiki/Pull-up_resistor&quot;&gt;pull-down
resistors&lt;/a&gt; on the bases of the buffer transistors (the
MPSA42s). Ha! &lt;a href=&quot;http://elbastl.sweb.cz/clock.htm&quot;&gt;That's what
this guy was doing&lt;/a&gt;. Hmm, perhaps everyone does it. :-) I'm using
33k&amp;Omega; which seems to do the trick. The voltage drop across the
series 33k&amp;Omega; (between the ARM and the buffer transistor)
increased from 1.7v to 2.3v, so the current for a logic-high has gone
up to about 70&amp;mu;A, if I've done my sums correctly. That seems barely
plausible.

&lt;/p&gt;&lt;p&gt;

This still leaves the circuit at the mercy of the software. A
complementary approach is to gate the high tension, which I'll
investigate doing when John Taylor's power supply turns up. I want to
switch the nixies off under software control anyway.

&lt;/p&gt;</description>
  </item>
  <item>
    <title>The ARM is in control.</title>
    <link>http://peteg.org/blog/2010/01/12#2010-01-12-Switching</link>
    <category>/hacking/nixie_clock</category>
    <description>
&lt;p&gt;

I soldered up a stock PNP-NPN transistor tree for the anode control,
and surprise, it worked first go. This was reassuring as it is the
first time the &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7260&quot;&gt;ts7260&lt;/a&gt; has been hooked up to the high voltage.

&lt;/p&gt;&lt;p&gt;

The next step is to replicate that a further three times, and then
wire up the nixies. Board layout is the toughest part of this project,
I am geometrically weak.

&lt;/p&gt;</description>
  </item>
  <item>
    <title>Russian BCD is the same as American BCD.</title>
    <link>http://peteg.org/blog/2010/01/11#2010-01-11-Decoder</link>
    <category>/hacking/nixie_clock</category>
    <description>
&lt;p&gt;

I managed to hook the &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7260&quot;&gt;ts7260&lt;/a&gt; ARM board up to the K155ИД1 TTL
BCD-decoder/nixie driver chip, the Russian clone of the American
74141. The pinouts are identical. The short story I gleaned from &lt;a
href=&quot;http://www.tinaja.com/&quot;&gt;Don Lancaster&lt;/a&gt;'s venerable TTL
Cookbook is that the CMOS levels of the ARM (3.3v) can directly drive
one or maybe two TTL gates without anything blowing up. I am thankful
that electronic technology has a forward-looking longevity that
software should envy.

&lt;/p&gt;&lt;p&gt;

The &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7260&quot;&gt;ts7260&lt;/a&gt; refuses to generate the promised 5v on its LCD port, so
I think the little switch-mode power supply that is supposed to do
this has been fried (and I'm not getting into any finger
pointing). The same unit apparently services the USB port, which may
lend weight to the idea that that port's brains are intact but have
become unstuck from its brawn. Blowing up this kind of hardware is not
much fun, it simply silently stops working.

&lt;/p&gt;&lt;p&gt;

Why do the world's languages use the same numerals? Do any deviate?

&lt;/p&gt;</description>
  </item>
  <item>
    <title>Caving in to the inevitable.</title>
    <link>http://peteg.org/blog/2010/01/10#2010-01-10-Nixie_PS</link>
    <category>/hacking/nixie_clock</category>
    <description>
&lt;p&gt;

I caved and bought one of &lt;a
href=&quot;http://www.tayloredge.com/storefront/SmartNixie/PSU/comparison.html&quot;&gt;John
Taylor's power supplies&lt;/a&gt;. You cannot beat  or so, you just
can't. I will persevere with the one I built for now, and see if I can
quell the EMI. In any case I have enough tubes for two or three clocks
(depending on whether I go for four or six digits), so it won't go to
waste.

&lt;/p&gt;&lt;p&gt;

Rob gifted me with some wire, so I hope I can improve the
grounding situation too. You never know, it just might come good...

&lt;/p&gt;</description>
  </item>
  <item>
    <title>Further adventures in nixie land</title>
    <link>http://peteg.org/blog/2010/01/08#2010-01-08-Nixie_PS</link>
    <category>/hacking/nixie_clock</category>
    <description>&lt;p&gt;

Well! After a few hours of burning some digits in, the sacrificial
tube is looking pretty good. The '5' does not light the lower-left
arc, and I'm not sure what I can do about that.

&lt;/p&gt;&lt;p&gt;

As for the power supply, I revise my earlier comment to say that now I
would simply &lt;a
href=&quot;http://www.tayloredge.com/storefront/SmartNixie/PSU/comparison.html&quot;&gt;buy
a pre-built unit from John Taylor&lt;/a&gt;. They're small, and for ,
cheaper than acquiring the requisite bits.

&lt;/p&gt;&lt;p&gt;

My perf-board effort is getting tidier and more finished, albeit at
the cost of much solder and desolder braid. It seems stable, with
tight regulation at 182v from no load up to about 3mA after replacing
my 1.5&amp;Omega; current sense resistor with 0.33&amp;Omega;. Apparently I
should &lt;a
href=&quot;http://groups.yahoo.com/group/NEONIXIE-L/message/43727&quot;&gt;run the
tubes at something like 1.5 times the rated current&lt;/a&gt;, allowing for
multiplexing, so the supply really needs to go to 8mA. I'll leave that
to another day.

&lt;/p&gt;&lt;p&gt;

I found that the multimeter leads (hooked across the anode resistor)
radiated enough to interfere with the radio. However even when
removed, the TV still got a pincushion effect. (I'm glad I still have
an analog TV.) Placing the whole thing on top of my venerable
regulated power supply eliminated any visible or audible effects,
which is reassuring but not yet sufficient for confidence. I'm
wondering how I can improve the grounding and shielding without huge
amounts of solder or metalwork.

&lt;/p&gt;</description>
  </item>
  <item>
    <title>The millionth nixie clock</title>
    <link>http://peteg.org/blog/2010/01/06#2010-01-06-Nixie_PS</link>
    <category>/hacking/nixie_clock</category>
    <description>
&lt;div class=&quot;figure&quot;&gt;
&lt;p&gt;&lt;a href=&quot;http://peteg.org//static/P1060017.JPG&quot;&gt;&lt;img src=&quot;http://peteg.org//static/cache/tn_P1060017.JPG&quot; width=&quot;70&quot; height=&quot;117&quot; class=&quot;scaled&quot; style=&quot;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;


&lt;p&gt;

Late last year in a fit of procrastination I decided to try to build a
nixie clock, following in the footsteps of multitudes. To that end I
ordered some tubes and driver ICs from &lt;a
href=&quot;http://myworld.ebay.com.au/4951511020/&quot;&gt;a bloke in Moscow&lt;/a&gt;
who was amenable to a bit of bargaining. I have to wonder how the
Russians get their hands on these new-old-stock devices from the cold
war era.

&lt;/p&gt;&lt;p&gt;

I received the tubes &amp;mdash; IN-8-2's, with long solderable wires
&amp;mdash; yesterday after about a fortnight, well packed. They are a bit
larger than I expected.

&lt;/p&gt;&lt;p&gt;

For a power supply I synthesised something using an MC36043
switch-mode controller from a few designs around the net. If I was
going to start from scratch now I would simply follow &lt;a
href=&quot;http://cid-f9db37b8211ce831.skydrive.live.com/self.aspx/Electronic%20Projects/Nixie%20Power%20Supplies/MC34063%5E_MK15b.gif&quot;&gt;this
guy's design and advice&lt;/a&gt;. I think he's quite active on the &lt;a
href=&quot;http://groups.yahoo.com/group/NEONIXIE-L/&quot;&gt;nixie mailing
list&lt;/a&gt;.

&lt;/p&gt;&lt;p&gt;

Anyway, what I've got does fire up the tube, as you can see. It
generates an open-circuit 180v or so that sags to 160-170v with the
tube connected. I think this is due to my overly conservative current
limiting resistor in the power supply - with a 11k&amp;Omega; anode
resistor the tube itself seems happy, though I won't be using such a
small one long-term.  From what I've measured the efficiency is at
best 70%.

&lt;/p&gt;&lt;p&gt;

Many of the elements of this sacrificial nixie tube don't fire up
evenly, which might be due to &lt;a
href=&quot;http://www.tube-tester.com/sites/nixie/different/cathode%20poisoning/cathode-poisoning.htm&quot;&gt;cathode
poisoning&lt;/a&gt;. I have found that burning each digit in for a few hours
greatly improves the coverage, reducing this partial illumination, but
it remains to be seen if all digits come completely good.

&lt;/p&gt;&lt;p&gt;

The supply also generates copious amounts of RF interference, which
I'm hoping some more capacitors will fix. Haven't shocked myself yet,
but I am sure I will. The next step is to try to hook the driver ICs
up to &lt;a href=&quot;http://www.cse.unsw.edu.au/~andrewt/&quot;&gt;Andrew T&lt;/a&gt;'s &lt;a href=&quot;http://www.embeddedarm.com/products/board-detail.php?product=TS-7260&quot;&gt;ts7260&lt;/a&gt; ARM board, and see if I can bring the
nixie under software control. Yes, this board is massively overkill
just for a clock, but as all engineers know, you can never have too
much overkill.

&lt;/p&gt;</description>
  </item>
  </channel>
</rss>

