Adding a display to rfid time tracking

More than a year ago, I blogged here about using RFID to track presence times in the BORM ERP system. I used the system a lot since then. But the BlinkM was really limited as the only immediate feedback channel. To use it with multiple users, a display was needed. The default Arduino compatible displays seemed a bit overpriced, and the Nokia phone that I disassembled didn’t have the same display as I used for the spectrum analyzer. But these displays are available for a bargain from china. The only problem was that the bifferboard didn’t have enough GPIO pins available to drive the “SPI plus extras” interface. But i2c was already configured for the BlinkM.

So, the most obvious solution was to use an AtMega8 as an intermediary. I defined a simple protocol and implemented it as i2c and uart on the AVR. I also wrote a small python class to interface it from the client side. As I buffer only one complete command, I had to add some delays in the python script to make sure the AVR can complete the command before the next one arrives. Apart from that, it all worked well when testing on an Alix or RaspberryPi. But i2c communication refused to work entirely when testing with the bifferboard. Not even i2cdetect could locate the device. That was bad, since I wanted to use it with the Bifferboard, and the other two were only for testing during the development. I checked with the oscilloscope, and found out that the i2c clock on the bifferboard runs with only 33kHz while the other two run at the standard 100kHz. So I tried to adjust the i2c clock settings on the AVR, as well as different options with the external oscillators and clock settings, but I was still still out of luck. Then I replaced the AtMega8 with an AtMega168 and it immediately worked. Next, I tried another AtMega8 and this one also worked with the Bifferboard. I switched back and forth and re-flashed them with the exact same settings. Still, one of them worked with all tested linux devices, while the other one still refused to work with the Bifferboard. So I concluded, one of these cheap AVR’s from china must be flaky, and I just used the other one. Seems like that’s what you get for one 6th of the price you pay for these chips in Switzerland.

Apart from the display, I also added an RGB LED that behaves like the BlinkM before. And on top of that a small piezo buzzer. But since I could hardly hear it’s sound when driven with 3.3V, I didn’t bother re-soldering it when it fell off.

Now, my co-workers also started logging their times with RFID.

The code is still on github.

Wallis Ski Holiday

Last week we spent a ski holiday in the Wallis. We stayed with Mirella’s mother. Most days we went to Bürchen to practice skiing with Levin, and have some sledge rides with Noah. Levin went to the ski school for half a day, but he didn’t like it at all. He preferred being taught by us.

I did two flights from the Ski area above to Bürchen. Both were in downward wind. At the later one, the wind was blowing down so strong, that I inflated in the lee of a small building, and then skied really fast to get airborne. The icy wind was a good test for my new down insulation layer jacket.

Mirella and me took one day off, and went to Zermatt for skiing. We were mildly shocked when we saw the price for a one day ski pass. That’s roughly CHF 80. But we were never before on the small Matterhorn, and the snow as well as the weather was perfect. The cablecar for the small Matterhorn runs up to 3880 meters above sea level. Well, one could say the Jungfrau Joch is not as high, has no ski slopes and costs even more. We had lunch up at the top and could feel the altitude. Then we descended into Italy before returning back to Switzerland.

And then there was one day with clouds forecasted. As all others had better weather, we made a break. But still, the sun was shining when we walked around the town.

GPGPU programming class

It’s already a while back that I completed the coursera class “Heterogeneous Parallel Programming“. It was mainly concerned with cuda, which is Nvidia’s GPGPU framework. GPGPU is about running common computations on the graphics card. The class also quickly covered OpenCL, OpenACC, C++AMP and MPI.

In the programming assignments, we juggled a lot with low level details such as distributing the work load to thread blocks, which I almost didn’t care about when using OpenCL so far. After seeing cuda and OpenCL, it was a little surprise, that C++AMP is indeed a more convenient programming model, and not just a C++ compiler for the graphics card. Let’s hope that it gets ported to other platforms soon.

The most eye opening revelation for me was, that it is possible to parallelize prefix sum computation. When I was first presented with the problem, I thought that’s a showcase for serial execution. But apparently it’s not. Making it parallel is a two step process. First make a number of blocks, and compute the sum at the boundary for each one using something like a tree structure (in parallel). Once you have that, it’s more obvious, how to parallelize the rest.

Skiweekend in Hasliberg

Last weekend I was in Hasliberg wih the ski club “Schneefreaks” from Steinhausen. They booked two full days of tandem flights. So I did ten flights with skis and two with snow board. The weather was almost perfect and so was the snow.