Avian’s Blog

Electronics and Free Software

Measuring Eee, part 2

08.04.2008 22:21

Some time ago I attempted to measure the power consumption of my Eee PC with different settings for CPU clock and peripherals and confirm some findings on the Eee User forums.

On the second try I managed to get some results. First the measuring setup:

Eee is obviously very sensitive to voltage swings and I only got it more or less stable after I tried this with a second multimeter (with the first one Eee would not even boot). Soldering the biggest capacitor I could find in the workshop directly to the power connector and shortening the wires as much as possible also helped a bit. Even so turning on the camera repeatedly crashed the machine, so I couldn't measure its effect on the current.

Results (CPU clock as reported by cpufreq-stat):

All peripherals off, CPU idle:

  • CPU clock at 113 MHz: 1.06A
  • CPU clock at 900 MHz: 1.06A

All peripherals off, CPU busy:

  • CPU clock at 113 MHz: 1.12A
  • CPU clock at 900 MHz: 1.22A

Wireless LAN on, idle, CPU idle:

  • CPU clock at 900 MHz: 1.17A

Card reader on, idle, CPU idle:

  • CPU clock at 900 MHz: 1.14A

This confirms what other people have found out. CPU throttling is basically useless in Eee: There is less than 10% difference in current draw at full load and no difference in idle.

I also expected larger savings when you turn off the peripherals. Each thing you turn on but don't use costs you around 100mA, which is not that much. It would be interesting to also see how much difference you can make with backlight settings.

The computer was still crashing every few minutes so I think I satisfied my curiosity (and pushed my luck far enough) for now.

Posted by Tomaž | Categories: Digital | Comments »

Serial numbers 001, 002

27.03.2008 21:04

So, this is the device that employs the circuit boards I've been writing about lately:

(click here if you can't see embedded video)

From the electronic standpoint it's a pretty ordinary clock with a quartz oscillator for the time base. The digital part is composed of standard LSI and MSI chips from the 74HC family. There's also a small back up NiMH battery (the kind you sometimes see on computer motherboards) so that you don't need to set the time every fortnight when the distribution company decides to cut your power.

What makes it stand out a bit is the fact that the time is displayed as a binary-coded decimal in 24-hour format. That's not a new idea of course.

Well, what does make it special is that it's a limited edition, with exposed circuitry and a nice, heavy wooden stand.

Posted by Tomaž | Categories: Digital | Comments »

Bulgarian boards revisited

18.03.2008 21:01

I take one thing back from what I said on Saturday about boards made by Bilex-LP.

The weren't perfectly etched. One of the four boards had this little glitch on it, which we found only after one of the finished circuits wasn't working properly. Luckily it wasn't hard to spot - a signal line had a short-circuit to the ground fill:

Oops

Anyway, even considering this problem it was still a good deal.

Posted by Tomaž | Categories: Digital | Comments »

Boards made in Bulgaria

15.03.2008 16:11

Remember this little project? Yesterday the first batch of circuit boards arrived by post from manufacture.

PCBs

These were made by Bulgarian Bilex-LP. I first heard about them some years ago in Berlin on one of CCCs and this was an opportunity to try them out (since now Bulgaria is part of European union and there aren't any customs charges).

The boards are nicely manufactured. Copper is perfectly etched as far as I can see and RoHS coating is flawless. The only glitch I found is that the drilling is off for maybe 1/4 mm and silk screen print off for a mm on one piece, but at least for these boards that's nothing near critical. Definitely better than what I could done in my home workshop.

Their prices are also lower than Slovenian companies - at least if you need only a couple of boards and don't mind waiting three weeks for manufacture and delivery. So it's definitely a positive experience (and I'm willing to forget that they renamed me first to Tomaz Solz and, after I reminded them, to Thomas Solc).

Posted by Tomaž | Categories: Digital | Comments »

My latest project

24.02.2008 11:53

Guess what's this going to be...

Posted by Tomaž | Categories: Digital | Comments »

Old calculators

26.01.2008 11:52

My grandfather gave me two old calculators a while ago. Now I've finally found some time to have a close look at them.

TRS 529

First one is TRS 529, made by Tvornica računskih strojeva Zagreb (I wonder if the same acronym as Tandy/RadioShack is a coincidence). As you can see from the photo it's a scientific calculator with basic trigonometric functions and memory for one variable.

Tiny VFD Rockwell A4001CC

A look inside reveals a tiny vacuum fluorescent display powered by an early DC-DC converter made by Ematron Inc., Taiwan. This hybrid circuit converts +6V from four AA batteries to -25V which is then used as anode voltage for the display and also for powering the processor. CPU is Rockwell A4001CC inside a plastic staggered dual in-line package. 7801 says that it's been manufactured in the first week of 1978.

Sadly it doesn't work anymore. As far as I can see the power supply works correctly, however the CPU appears to be completely dead. When I connected it to an oscilloscope I could see no attempts at keyboard scanning or display multiplex.

Hewlett Packard 21

The other calculator is Hewlett Packard 21. It's the first RPN calculator I've seen. I remember it as the calculator that had the "Enter" key like the big computers and that only my grandfather knew how to use.

From the technical standpoint there is little I could add to information that is already available on the internet. This one did show some signs of life when powered up. The little LED display shows "0 0", however it appears there is something wrong with the keyboard, since only the top row of keys produces any response.

I didn't try to open it to see what's wrong since at first I didn't see any obvious way of taking it apart. Now that I know that you have peel away the front two rubber legs I'll probably look into it.

Posted by Tomaž | Categories: Digital | Comments »

Wireless A/V receiver

23.12.2007 0:13

Here's another cute board I could lay my hands on today:

Front Back

This is a 2.4 GHz analog audio/video receiver that connects to a USB 2.0 port (model GP-722, manufacturer unknown). It receives a color video signal from up to four little battery-powered cameras (you know, the kind you see in spy movies or the kind you might put inside a model airplane).

Unfortunately it doesn't work yet under Linux. It uses a Trident TM5600 encoder/USB interface chip, which is a cheaper variant of TM6000. That one seems to have some support under Linux. Maybe I will actually be able to use it after some hacking.

Posted by Tomaž | Categories: Digital | Comments »

Another ZX Spectrum's near-death experience

19.06.2007 22:23

Approximately one year ago I got two Sinclair ZX Spectrums (48kB versions) from Cyberpipe's computer museum to repair. I was quickly able to put together an undamaged circuit board and a working keyboard into one working machine which was then on display in the museum for some time. After that I was left with enough parts for another Spectrum which I declared unrepairable because it seemed that every imaginable component was burned out.

However after tinkering with it every once in a while when I found some free time I got it back to a perfectly working condition. Looking back it was quite an amazing experience. Here's a list of all things that needed repair in the order I repaired them:

There was a big hole in the 5V regulator. Replacing that was the easy part.

Seriously burned out 7805

The ferrite core of the little transformer on the circuit board was also shattered, probably because of over heating. The wiring also appeared to be damaged. When I couldn't find a similar new core I ended up gluing back together the original core piece by piece with epoxy resin and then making new windings.

Continuing with the obvious stuff, there was also a resistor with a crack along it's body. Perhaps the transformer core shattered because of a mechanical not thermal shock after all?

Since the transformer of the DC-to-DC converter was obviously shorted at one time it was easy to guess that the switching transistor TR4 (ZTX 650) was also burned out. Getting a replacement however wasn't that easy because this NPN transistor has to withstand 2A of pulse current but also has to be in small a TO-92 or TO-18 case in order to comfortably fit on the circuit board and under the keyboard. I tried a bunch of transistors from a basic 2N2222 to a fancy 400V ST13001 I got from an old fluorescent lamp. They all eventually burned out (with ST13001 holding a record at several hours of operation). I only found a satisfactory replacement two weeks ago when I noticed that one of the local electronic component shops had an old stock of ZTX 651 transistors.

2N2222 on its way to destruction

Now it was finally time to fully power up the computer and see how extensive was the damage to the digital part. As expected the first time only four characteristic black and white vertical bars appeared on the screen. I suspected that the low 16 kB of RAM was to blame and it took me a couple of months to find a supply of chips that could be used to replace the original 4116 ICs (4164 ICs by the way and I only got four for quite an outrageous price). After experimenting a bit with RAM chips however I couldn't find specific chips that were bad.

Suspecting the CPU, I took the Spectrum to my Faculty's lab and removed all the big chips from the circuit board and put them into sockets. Replacing the CPU with a known-good chip however didn't help. After having some wacky ideas how to diagnose this problem I got some good advice from Winston on the World of Spectrum forum to suspect the ROM.

After confirming that the ROM chip was certainly acting strangely (I definitely wouldn't suspect it myself, thinking that a mask ROM was the most robust IC in the Spectrum) I've found an old 27C128 EPROM, programmed the original ROM contents in it and modified the circuit to accommodate an EPROM instead of ROM.

Those wires look dangerously close to the coil

Success! Spectrum now boots to the "Copyright by Sinclair" screen, however the keys don't work. As usual the keyboard membrane broke in several places. I first tried to repair it, but soon gave up (there's a funny story here about how the membrane worked properly each time I tested it on the table but was dead when I connected to the machine).

Luckily these guys offer cheap new (manufactured in 2007!) replacement membranes. Now it was just a matter of undoing all my previous keyboard-related modifications.

Keys now work, but there's no familiar clicking sound from the speaker. Interestingly one last component needed replacement - the protection diode on the audio output pin of the ULA chip. This also made me wonder if the damage to this board was made by connecting the power supply with a wrong polarity. This diode would form a direct short circuit in that case and I can't imagine any other fault which would damage it.

The
final result

So, now I have two Spectrums in a working condition. Maybe there's a game that supports multiplayer on two connected machines?

A
bunch of Spectrums
Posted by Tomaž | Categories: Digital | Comments »

A bunch of EPROMs

10.06.2007 20:51

Here's a nice picture showing how die sizes of EPROMs were shrinking over time. All chips here can store 64 kB of data (except one in the center which is 32 kB).

Compare the die sizes
Posted by Tomaž | Categories: Digital | Comments »

My childhood dreams for 40€

02.05.2007 15:32

As a kid I used to read and re-read a book titled Choosing and using your home computer (Slovenian translation published in 1984). It contains photographs and descriptions of a lot of contemporary home computers, including the EPSON HX-20. This little device is described as the future of portable computing - it's amazingly small case includes a cassette recorder and a printer and you can even work with it while you are traveling since it has a rechargeable battery. According to this book this is the first truly portable computer, a first sign of what we can expect in the future.

Of course back then I really wanted to have one. The Spectrum we had looked just clumsy compared to it.

a""/

This weekend they were selling them at VCFE for 40€ a piece and now I'm wondering why the hell I haven't bought one.

Posted by Tomaž | Categories: Digital | Comments »

Vintage Computer Festival Europe 2007

02.05.2007 0:16

Internet connectivity wasn't very good at VCFE, so here's a late and condensed report from my visit to München. (Organizers did give us internet access, but they said we should use it as little as possible because they only had a limited amount of net traffic allowed)

VCFE from above

My general impression was that for a Computer Festival Europe the whole event was surprisingly centered around German visitors and exhibitors. When I asked why all announcements and speeches were in German they said that they do not want to force English language to the 95% of Germans there. I can understand that, but I don't think that adding a single English sentence would hurt their feelings too much. It would at least give me some idea what that last public announcement was about - even if that meant I would have to go to the nearest native speaker and ask him for a more detailed translation (everyone I spoke to was fluent in English). If CCC in Berlin got the right mixture of English and German language so that I didn't feel pushed aside, I don't see why they couldn't also.

Other than that, I was impressed with what I saw at the festival. I've never seen or heard of a lot of computers and equipment that was on display. It felt a bit strange to walk around and not recognize names on computers (and I thought that I have some knowledge of this field).

Then there was also the tour of the Cray-Cyber collection, which was awesome and deserves a post of its own.

MyCPU was in my opinion the most impressive exhibit of the VCFE. Its author created his own CPU architecture, implemented it with 74HC discreet logic circuits, built a complete computer around it (IDE interface, VGA board and all), wrote a DOS-like operating system for it and on top of everything ran a C64 emulator.

I'm definitely going to have a look at how he managed to implement a PS/2 keyboard interface with logic chips. Perhaps I could make a similar interface for Galaksija to replace that weird keyboard I made.

This Apple eMate laptop looked surprisingly like the OLPC laptop. It has similar size and a similarly unusual user interface. It is also 10 years older and sold for 8 times as much at the time (i.e. it was meant for USA, not Africa).

Yes, not all exhibits were digital! This Dornier DO-80 analog computer draw a ball that was bouncing inside the edges of the oscilloscope screen. I haven't studied the papers I got that describe how they managed to do that, but it sure was an impressive thing to see a box of operational amplifiers draw a nice animation like that


Last but not least, here's Cyberpipe's Museum with my Galaksija. Our exhibits attracted more attention from visitors than I expected. Galaksija was in fact so popular that there are good chances that next year I'll prepare a workshop where anyone will be able to built one.


In conclusion it was a nice experience. As always I really enjoyed being once again among friendly hackers where everyone is prepared to explain what is that weird thing on his table and/or try to help you with a particularly strange hardware problem you stumbled upon.

Posted by Tomaž | Categories: Digital | Comments »

The incredible shrinking ipod

05.03.2007 22:32

I am having some weird problems with my iPod mini.

It started when I had to reinstall OS X on the laptop because of one Debian installation gone wrong. Since I lost all music in the iTunes library and I didn't want to rip my CD collection all over again I copied the MP3 files from the iPod and re-imported them to the freshly installed iTunes (Contrary to the popular belief this is quite simple and doesn't involve any special malware-infested applications. You just copy music files from a hidden folder on the iPod to the hard disk).

The problem appeared when I tried to sync this re-imported music library back to the iPod through iTunes. It turned out that exactly the same amount of music will no longer fit on the device (although as far as I can remember there was a good 100 MB free space on the iPod before). After a bit of comparing with a music library on the other computer it turned out that MP3s didn't increase in size (iTunes could attach something the first time I imported them). So what is happening here?

After deleting a couple of albums so that the whole thing again fit on the disk the iPod worked without problems. Until yesterday, when I deleted some song I didn't like from the library and iTunes said that the library once again won't fit (with one song less?!).

The only explanation I see is that the disk space is somehow shrinking with time. Unfortunately I have no records of how much total disc space was reported by df before all this began. The number of bytes df shows now (7933880 512-byte blocks, it's a 4 GB model) doesn't seem too low. Could it be that the disk is accumulating bad blocks and that they are somehow silently detected and subtracted from the total amount of disk space by magic dust that Apple puts inside its hardware?

Some extensive googling didn't turn out anyone with similar problems. Well, if it'll get any worse, I'll probably replace the disk with a compact flash card like this guy.

Posted by Tomaž | Categories: Digital | Comments »

Comparing Galaksija and Spectrum tapes

13.02.2007 14:23

Both Sinclair Spectrum and Galaksija use ordinary audio cassettes for program storage. They do however use different modulation techniques to store digital data on the audio-frequency range analog signal that gets recorded to the tape.

Here's how a short program hears like: Galaksija and Spectrum.

First thing you can notice is that on Spectrum, there are two distinct block of data (there's a pause in the middle of the recording). That's because Spectrum puts a separate header in front of each chunk of data it saves. This header contains the name of the block that follows, where in memory it should be located and similar meta-data. Galaksija on the other hand uses a similar header, but saves it in the same block that also contains the data itself.

On both systems, each block of data is preceded by a leader signal. This signal carries no information. It serves only as a kind of reference signal which the software can easily recognize - it tells the computer that a block of data will follow immediately after it. It also helps the software (which is of course running asynchronously to the signal) to synchronize with it. On a Spectrum tape you can hear this leader tone as a pure tone at 800 Hz (the beeeeep in beeeeep-bop). Galaksija's leader is harder to make out. If you listen carefully you can hear that the beginning of the recording is a bit more regular than the other part. That's because Galaksija simply uses some 100 "0" bytes as a leader - there's no specialized tone or frequency dedicated to it.

Two bytes on Galaksija tape

Two bytes on Sinclair Spectrum tape

(These are idealized waveforms of course - in reality the square signals get rounded because of the limited bandwidth of the tape and recording equipment.)

Spectrum uses frequency shift keying modulation to store its data, while Galaksija uses a modulation I can't really place anywhere. The main difference is that while Spectrum uses tones of different frequencies to store 1s and 0s on the tape Galaksija uses short impulses - two impulses for 1s and one impulse for 0s. This means that much of Galaksija signal's energy is in high frequencies (impulses in theory include all frequencies from 0 Hz to infinity).

That is also the reason why Spectrum tapes are much nicer to hear - they mostly include frequencies that are close to human voice (between 800 Hz and 4000 kHz). Galaksija tapes on the other hand hear closer to white noise than a legible signal because white noise also includes all frequency components.

In the end I would say that Spectrum has a much better and more robust modulation scheme than Galaksija. Old magnetic tapes tend to loose higher frequencies much faster than lower ones so I would guess that Galaksija tapes would lose their integrity faster (unfortunately I don't have here any old Galaksija tapes to test this, but I've heard that it can be quite hard today to salvage old Galaksija programs from tape).

It's interesting why Galaksija was designed with this simple modulation scheme instead of imitating Spectrum (I'm sure Spectrum's ROM routines were available to Galaksija authors). The hardware is almost identical in both machines so that couldn't be a reason. One of the articles about Galaksija mentions that a slower baud rate was chosen to improve reliability. However they could have lowered the baud rate while retaining Spectrum's proven modulation scheme. It would certainly be more reliable than making their own. Perhaps it was the limited ROM space.

Posted by Tomaž | Categories: Digital | Comments »

Galaksija: Screencast

06.02.2007 14:37

Here's the screencast I promised. It gives a basic demonstration of Galaksija's graphics capabilities with one BASIC and one machine code program.

The video is encoded with XVid and is around 20 MB in size. It's unedited since I don't have enough patience to deal with open source video editing software (feel free to use the Fast Forward feature of your player to skip the boring parts).

I know this is really badly encoded (on the original recording the picture is sharp). However this is the best I could manage with five tries with transcode.

Posted by Tomaž | Categories: Digital | Comments »

Galaksija: Fine tuning

05.02.2007 21:19

I've been having a lot of fun recently with Galaksija in the past few days (mostly playing Galaksija's version of Jumping Jack, a simple and addictive game I used to play on Spectrum)

Anyway, here's some details about hardware problems I've had with my redesigned board:


My initial tests of the video part (I tested it separately, with the CPU and other integrated circuits removed from the board) showed that switching transistors that were mixing the video signal with the sync impulses weren't able to switch on and off fast enough to show a clear picture and provide good sync pulses.

My original plans were to use BC547 transistors. These are designed for audio-frequency operation, however SPICE simulations showed that they should be more than fast enough to be used in this way. Unfortunately it turned out that SPICE was awfully wrong this time. I'm not exactly sure why. It could be that either SPICE doesn't take into account base charge storage time in it's bipolar transistor models (unlikely) or that SPICE model parameters for BC547 I got from the manufacturer's web site didn't include this information (i.e. who would be stupid enough to use these transistors in an application where switching times are important).

So the mixing stage now uses 2N2222 switching transistors which work perfectly.


The digital part of the circuit had something like 5 wrong connections. They were mostly because of my sloppiness (three times for example I connected an "active-low" reset signal to the ground instead of Vcc). Fortunately these errors were pretty easy to find with my equipment - a wrong connection in the address decoder for example would be much harder locate without a good digital oscilloscope.


After I fixed these things a picture appeared on the TV screen for the first time. Blurred and flipped, but a picture nonetheless :).

The characters were flipped either because the data lines of the character generator ROM were connected to the shift register in the wrong order or there was a bug in the character generator ROM contents. Since I'm a hardware guy and I tend to blame the software for bad things I would say the second reason is more correct :).

Seriously, the scans of the original Galaksija schematics were a bit ambiguous about how the character ROM is connected to the shift. I assumed that MSB on the ROM gets connected to MSB on the shift register. I should have checked if the ROM contents agree with this assumption, but once I got them I already forgot about this problem. In the end it turned out that the original ROM was programmed to be connected the other way around. Since I didn't want to make a new PCB just because of such a trivial mistake I only reprogrammed the ROM with the bit order reversed.

From the software point of view this fix doesn't break any compatibility with the original Galaksija. The character generator ROM isn't directly accessible to the CPU and the reversed bit order of the ROM contents perfectly compensates for the error on the circuit board. The only problem is that a character ROM from an original Galaksija won't work in my version.


After getting the display to work I focused on the only other peripheral device - the audio cassette interface. The output was working correctly on the first test. The input however had a small problem. The original schematics had an RC high-pass filter on the audio input which I directly copied to my design with any checking. Now it turned out that I should have also double-checked this part of the circuit. The original filter was blocking signals with frequencies lower than around 16kHz which meant that it was blocking practically everything that came from the recorder. A quick replacement of one resistor and one capacitor fixed this.

The audio input still requires a relatively high amplitude of the input signal (something like 2 Vpp from my experience) to work reliably. If I knew that before I would add a small audio amplifier to the board - some devices (for example my laptop) won't produce such high levels on their audio outputs.


I also spent quite some time tinkering with the common-collector video amplifier. The blurry picture on the TV made me think that it didn't have enough bandwidth (although SPICE again showed that the high-frequency limit should be well into 10 MHz range - but I wasn't going to be deceived twice). After spending two nights on figuring this out I finally connected Galaksija to a TV that cost more than 20€... And the picture was crystal clear. It turned out that the fantastic TV I bought on the sale had bandwidth problems, not my video amplifier.


The final thing (which I'm still working on) is the little switched-capacitor voltage inverter that provides a low-noise -5V supply for the video amplifier. I obviously miscalculated something when designing it because its transistors are overheating. So far nothing blew out, but transistors are clearly working outside their safe temperature range. I'm certainly not prepared to unleash another unreliable overheating power supply to the wild (although on the second thought, unreliable overheating power supplies seem to be present in all computers I really like - remember TR4 in spectrum?)

Posted by Tomaž | Categories: Digital | Comments »