Category Archives: Electronics

Posts about electronics. Usually meaning electrical gadgets smaller than a proper computer.

Hundreds of dollars of parts, hours of fiddling and “Hey! It almost drew a circle!” (I’ve been playing with my CNC parts pile again – more later)

Posted on by pappp | Leave a comment

Pionier Button Hacking: Step 2

It took over a year for me to get back to it, but I finally sat down and made some progress on hacking the Buttons Pionier was giving away at SC09.

When I last posted about it, I had drawn out all the USB identification information, as well as disassembled one, identified all the hardware components, and tracked down data sheets for the important bits.

Now that I have a Bus Pirate, I decided to dump the 24c64 EEPROM. A 24c64-type EEPROM speaks standard I2C, with the addition of three dedicated address pins (for banking chips), and a hardware write protect pin.

My first attempt was a little troublesome, because attaching the chip in-place was (as is often the case) powering the whole board, leaving two I2C bus masters, and confusing the situation.

The following is basically a reference for communicating with 24c32/64 EEPROMs.

To remedy the problem, I simply desoldered the 24c64 from one of the buttons, soldered pins 1-4 (one full side) to a bit of wire, so I could ground GND, A2, A1 and A0 with a single clip, and attached the bus pirate leads to the floating chip (Yes, SOIC8 packages are rather small):

24c64dump_sm.jpg

To be specific the connections are GND to pins 1-4 (Gnd, A2, A1, A0) 3.3V to Vcc (8) and WP(7), CLK to SCL (6), and MOSI to SDA (5) like so:

24c6pins_sm.png

To write the ROM, the WP pin would need to be grounded instead of powered, but preventing writes is a good safety measure when exploring.

Software-side, I ended up following the communication instructions in the Bookly 24c64 datasheet, because I found them asier to interpret, but the datasheets from Atmel or any other manufacturers that make a compatible part will do as well. Start with the usual bus pirate setup of ‘m’ for menu, ‘4′ for I2C, Chose a clock (I used 100kHz for fear of interference from the long-for-I2c leads), ‘P’ to turn on pull-up resistors, and ‘W’ to turn on the power supplies.

Then, to read out a 24C64, you feed it (this is a commented log of the terminal session)

I2C>[0xA0 -- Start, Send 1010, the Values on the A2-A0 pins (000 if grounded), Followed by 0 write for and 1 for read -- dummy write to set address pointer
I2C START BIT
WRITE: 0xA0 ACK
I2C>0x00 -- Send the start address to the chip, the 24c64 ignores first three bits. 0x0000 to start at the beginning of the ROM.
WRITE: 0x00 ACK
I2C>0x00
WRITE: 0x00 ACK
I2C>[0xA1 -- Starts, then random read (same as first byte of dummy write, with R/W high instead of low)
I2C START BIT
WRITE: 0xA1 ACK
I2C>r:255 -- Sequential read out the whole ROM (Overflows most terminal's history, I pulled 256 or 512 at a time.)
READ: 0x5A  ACK 0xA5  ACK...

I dumped it twice to cross-check that I didn’t make any dumb mistakes the first time, then massaged the dump with some regexes to get rid of the communication details and extract a pure hex dump. Only the first 4608 bytes of the ROM are written, so there is even room to tamper, if I can figure out the encoding. Note that the posted string is NOT S-records or Intel HEX, but raw ASCII-encoded two-characters-per-byte hex. In order to get it into an 8051 disassembler for further analysis, I will either need to figure out how to coax the Bus Pirate to generate a formatted dump, or write a script to segment and prefix the existing string, but neither has happened yet.

Giving analysis a first pass, I looked for pieces of the string it prints when activated as ASCII and raw USB HID Scancodes, but didn’t find them… which either means there is a problem with the dump (byte order?), or some clever and inconvenient encoding was used. I’m not terribly familiar with 8051s and their associated tools, so that will be the rather large next step. If nothing turns up in analyzing the dump, I may have to sniff the bus while the board is in operation to see if there is some funky data layout obfuscation.

Posted in Computers, DIY, Electronics, Objects, OldBlog | Tagged , , | 1 Comment

The Ugliest Little RepRap Stepper Driver

I’ve been playing with my CNC Mill project a little bit in some “spare” time(= time I should be working on things for school, but can’t focus), and just got my third RepRap Stepper Motor Driver v2.3 working after some replacement parts and judicious green-wiring.

I bought three drivers as kits, because they were cheap and well regarded, but the boards are largely surface-mount, and the first attempt to populate them didn’t go well, thanks to distorted lead frames and UK’s shifty surface mount equipment. With a little bit of hand soldering to fix lifted pads, I got two of the three boards going, but one of them …ignited… when tested because of a lifted ground on the main IC. The bad board has been sitting in it’s bag waiting for me to do something about it for most of a year now, and the other night I realized I could probably remove the chip, order a replacement Allegro A3982 from one of the electronics suppliers for a couple dollars, and try again. Pulling the chip by hand lifted four pads, but left it looking workable, so I picked up a pair of spare chips from DigiKey (who, for a pleasant but startling change, only charged me a very modest shipping fee).

My replacements arrived earlier today, and I couldn’t resist taking a crack at it. As the title suggests, this resulted in a UGLY but working driver board (click for larger):
redwire_sm.jpg
Check out the run of magnet wire across the bottom of the board, up through a via, and then under the pad it goes to. That is some quality fabrication (also, I checked, that path never carries much current, so magnet wire is OK). The other fixes are all relatively easy (and large-current) runs across one side of the board.

This time, instead of catching fire and destroying an IDC cable, connecting power and my supremely ghetto-rigged test circuit (a 555 timer set up to generate a pulse train on step, and some buttons and switches to control direction and enable) resulted in a smoothly turning motor. Success. I’ll probably only have to make one more small electronics order (remember that melted IDC cable…) and all the drive electronics will be together to run it from a EMC2/Linux box.

The hangup now is the connections between the axes and the drive nuts: my old bent-steel-sheet brackets were not square enough, and were causing walking and uneven tension and all manner of badness, but I haven’t managed to design a replacement I’m both satisfied with and able to build/source. If anyone has an idea for mounting a 1.25” long, .56” flat-to-flat hexagonal coupling nut to a metal panel 1” away from the rod the nut rides on, which will take large lateral torque and remain square to the rod, let me know. I have a half-baked plan with some modified heavy L-brackets, but there must be something better.

Posted in DIY, Electronics, General, Objects, OldBlog | Tagged , | 1 Comment

Kentucky Touch screen / Natural User Interface meeting

Earlier tonight I attended a sort of open-access seminar on multi-touch user interfaces, catalyzed by an EE senior design group working with Awesome Inc. to create a large multi-touch wall for the outside of their space. The attendece was wonderfully diverse on account of the announcement hitting the professional, academic, and hobbyist communities in Lexington (more events need to propagate like that!). Attendees included several members from the Lexington IEEE chapter (co-opted as a chapter meeting), a number of local creative types, many students from UK, and several other interesting folks.

The discussion centered around the CCV effort of the NUI group, and was fairly solid, although I would have appreciated a bit more technical depth. I actually ended up dominating a couple conversations on account of being better read in the area than most of the other attendees, and don’t consider myself particularly well-versed in multi-touch display technology. I still don’t really understand TUIO, I was rather hoping someone there would be able to explain it.

One small downside, I still get the uncomfortable feeling that everything said or done at Awesome is being sucked in and analyzed as a potential source of financial gain. The culture there always seems exploitative (or at the very least commercial) instead of communal, which is very unfortunate, as they have set up a nice space, and seem to be attracting interesting events.

I really am attracted to open-access, discussion based topic seminars like this, and would love to see more of them happen. There are lots of good efforts to bring that sort of thing to Lexington, from a seminar series Dr. Finkel is attempting to arrange this semester (based on students and faculty giving short presentations on neat things they have found), to Collexion and Dorkbot’s regular meetings. This is not the first time I’ve been after this sort of thing either, for a while the UK LUG was running some decent events in this vein, in particular I remember a successful LUG event on PyGTK, but the LUG is several years defunct…again…because those of us who were active didn’t have time to keep it going on our on (and be students), and no one else stepped up. I think some of the short-form lecture series like ignite have had events here as well, but those have never seemed as useful to me.

Posted in Computers, DIY, Electronics, General, Objects, OldBlog | 1 Comment

CHDK on the SD770 IS

The camera handling for my last post reminded me to check to see if progress had been made on the CHDK port to for the Canon SD770 (the little point-and-shoot I have). There was a promising effort about a year ago, but the developer disappeared without releasing the partly functioning code, and it was quickly abandoned. Apparently someone else stepped up in November; there is now a (roughly) fully functional boot image available for the SD770.

CHDK features provide at least partial fixes for all my major complaints about the 770; the exposure override settings allow the flash to be kept under manual control through power cycles, even when the other features are on automatic, the exposure behavior can be more precisely controlled to hide noise issues in low light, and all the CHDK toys are now on hand, so I’m not missing any expected features.

Right now I just have a spare small card set up, but the process is non-destructive and simple, especially on cards <4Gb, so I’ll probably set up the pair of 1GB cards I usually use with it shortly. Anyone with a Canon camera should go set up a card with the appropriate CHDK image, it really does improve the camera.

EDIT: There are a couple bugs, the only serious one being that the camera crashes when using auto white balance with the version of CHDK in the linked thread loaded. I don’t have time to get into another environment to fix it.

Posted in DIY, Electronics, General, OldBlog | Tagged , , | Leave a comment

Pionier Button Hacking: Step 1

pionierbutton_sm.jpg

(eventually I’m going to have to hack up a light tent (for the glare) and camera mount(for the jitter) for this kind of thing, but it hardly seems necessary with my little point-and-shoot)
One of the more promising bits of schwag at SC09 was a little USB button thing handed out by Pionier. The basic premise on the button is that after connecting it to a computer via USB, it lights up with enticing shifting colors, and, when pressed, sends the computer to the pionier SC09 website. It does this by announcing itself as a USB HID device, emulating a keyboard, and typing “{control}rhttp://www.pionier.net.pl/webstarter/09scpo6r8q {newline}”, which will have the desired effect… from the desktop on a windows box. After seeing what it did on a laptop on the show floor, I grabbed a few extras thinking they would be fun to hack.

I pulled apart one of the buttons to read off what the chips are, and things look promising. (larger image linked)

pionierbuttonteardown_sm.jpg

The board is based around a MXT8208 USB 2.0 Flash Disk Controller (datasheet). The chip consists of a 80c51 microcontroller with hardware USB 2.0 PHY, I2C, a general purpose UART, some dedicated flash management features, and 28 GPIO pins (mostly overlapped with other functions) in a LQFP48 package. This means it SHOULD be susceptible to much better hacks than simply changing the output string; with a little luck it will be convertible into a darling little intermediary device for attaching projects to a computer via USB by serial or PIO. Since there is no flash chip hooked up, the majority of the GPIO pins are free, making it especially suitable for that kind of repurposing. By far the primary use for this chip is making little USB flash drives (and, based on the information around the ‘net, this one is particularly favored in making “fakes” that misreport their capacity, because it is more programmable than many of it’s competitors), but, assuming I am interpreting the chinglish datasheet correctly, the non-memory USB widget use case here is intended as well. Matching the suggestion in the datasheet, the software for the button behavior is (apparently) on a K24C64 64kbit Two-wire EEPROM (Datasheet) mounted on the other side of the board.

The other components aren’t terribly interesting: a pair of SMT push buttons, a 12Mhz crystal, 6 assorted SMT capacitors, 3 assorted SMT resistors, and a 2-lead RGB color phasing LED(unfortunately, 2 leads means it probably can’t have it’s behavior altered beyond on/off).

Software wise, it reports VID=0×2000, PID=0xbeba, which seems to be a made up ID written to the chip in software. There is a UdTools utility offered up by micov (after a little bit of google translate-foo), but it only seems to be able to tweak the flash-specific functions, not perform general reprogramming. This IS promising, as it implies everything should be writable from a host computer, rather than having to pull the EEPROM and program it separately to alter the behavior, but I haven’t figured out how to do so yet.

Any ideas? Usage wise or tools wise?

Posted in DIY, Electronics, General, Objects, OldBlog | 2 Comments

Anti-Convergence

I saw a couple of really impressive examples of Anti-Convergence on the trip to Portland, and ran into a couple pretty good arguments for the concept. The best example was the girl in front of me on the long leg of the flight; she was dual wielding an iPod Touch (or iPhone) for games, and some sort of hard drive based music player for music. The strange thing is, I’m sure the experience of each was better than using the touchscreen as a convergence device as I’m sure Apple intended. Touchscreens are still terrible interfaces for music players. I use, and for the most part enjoy, my n810 as a music player, but the inability to use it without taking it out and looking, like I could with the physical interfaces of it’s predecessors, is frequently irritating.
I ran into several good reasons for not using a single device, because I was (so much as I could) doing so. I was, for several hours, using my n810 as a a music player and ebook reader. The combination keeps the onboard DSP and the screen (with backlight) enabled, which drains the battery very much more quickly than either operation (particularly music only) on its own, to such an extent I had to switch to reading a dead tree book or risk killing my entertainment. The thing is, I don’t need more battery (MOAR BATTERY!) very often, just on a rare, almost always premeditated occasion. Maybe those silly little rechargeable external battery pods are actually a good idea.
This hits both issues; the eggs in one basket problem, where having a single converged device leaves a single point of failure (compounded by my tendency to hack on my gadgets), and the battery tech issue, where the ability to power gadgets is significantly lagging other gadget features right now.
I also always run into a pair of problems with cellular convergence devices; the blooducking assholes in the cellular industry, and the potential for breaking my phone. There is a strong tendency to lock down the ability to hack on devices with phones, and the ones they haven’t locked down are extraordinarily expensive. There is a fairly valid argument for the lock-down, as it is a reasonable concern that users (or some black-hat assholes’) actions could disable the cellular functionality, potentially cutting someone off in an emergency.
Maybe one day there will be a magical converged device (perhaps one of these things with a dual-layer epaper+active screen?), that will fit in a pocket and suffice as a web access mechanism, phone, music player, and ebook reader. Until then, I’ll keep eyeballing all the fancy new widgets, and using my collection of (moderately) reliable old ones (and dead tree books) until there is actually an improvement.

Posted in Computers, Electronics, Entertainment, General, OldBlog | Tagged | Leave a comment

N8x0 PowerVR Drivers!

Since the N800 came out there has been a lot of rumbling in the community about the unutilized hardware present in the device (and it’s sibling/successor, my beloved N810). The piece most complained about are the PowerVR MBX 3D accelerator and 5MB SRAM included on the OMAP2420 SoC the device is built around. The explanation has always been a mixture of licensing issues for the drivers, and that the external Epson S1D13745 display controller was better suited to the 800×480 (still unusually high for mobile devices) resolution, despite being rather slow and devoid of 3D-capability.

With the advent of the N900 and it’s non-backward-compatible Maemo 5 OS, there is some fear in the community that the N8×0 devices will be abandoned. The N900 looks like a very cool device, but like many tablet owners, part of the appeal of my N810 was that it wasn’t designed to have a >$50/month cellular data plan. Nokia’s offical (and seemingly very classy) stance is that they will provide support for continued community developed FOSS software for the platform, which currently mostly means Mer, a community firmware/ partial Maemo 5 backport. There are also several other linux-based OS ports to the N8×0 platform, and a burgeoning effort to produce a binary-compatibility-maintaining system software update like the ones Nokia used to produce for Maemo 4 which will hopefully all cross-pollinate sources and keep the platform alive. One only has to look at how long the OpenZaurus (later merged into OpenEmbedded/Ångström) community held on, and how much they accomplished to be hopeful.

The combination of these thoughts? Nokia (and the various other relevant IP owners) announced they will be supplying drivers for the PowerVR to the community in the immediate future. With a little luck the Mer hackers will get them integrated into a release soon, which may contribute to tipping to Mer as the predominant OS for n8×0 devices over the OS2008/Maemo 4 stack Nokia provided.

I depend so much on my n810 I haven’t really been into OS hacking on it, but as it ages and the community firmwares come to the fore I suspect I’ll get more into it (if I have time). Maybe as they get cheap I’ll even end up with one of the “knockoffs” to use as a test platform in the same primary machine/beaterbox setup as my bigger machines.

Posted in Computers, DIY, Electronics, General, OldBlog | Tagged , , | Leave a comment

XMOS

I ran into an ad for development boards from XMOS the other day, and, being generally curious about unusual little processors, read up on them. The architecture they are using sounds like a really good idea to me, and I hope it’s as well executed as it is clever. Some of the cool stuff:

Programmable hardware – they call it “Software Defined Silicon”, it appears to be FPGA-like programmable switching setups between the cores, and some programmable features in the IO blocks.

Static scheduling – This is my bet for the way to solve the memory latency problem that continues to be my favorite candidate for “the next big problem in computing”. Caches and parallelism can only hide so much, and caches are responsible more than their share of uglyness.

LLVM-based tools- I’ve been working with LLVM for LARs, and there is a lot of similarity to the designs. I’m pretty well convinced now that LLVM is a Good Thing and the programming environment they built with it sounds promising; it appears to be C, extended with features to better support thread concurrency and the programmable I/O stuff.

The biggest worry is they don’t seem to actually have their chips in any high profile devices, which may just mean they haven’t been around long enough, and may mean there is some hidden problem with their products that I haven’t caught on to yet.

I don’t have enough free time and energy to think its a good idea to drop $100+ on a dev kit which will sit unused on my shelf “until I have time”, nor do I have a project for which it would be appropriate, but I’d love to to sit down and play with one of their dev kits (the little credit-card boards are cool, but the one with the QVGA touchscreen is way cooler…) and see if it really is as good as it looks (One of the many cool project ideas I doubt I’ll ever get to: I’d love to try to port a conventional(ish) OS to these things in a way that actually took advantage of the architecture (I’m thinking tricks with a microkernel across threads), both for the porting experience and because it would be a good (predicted) future of parallel programming playground. There is a review of the fancy kit with the screen above, and it sounds like the software tools (at least at the time of the review) and documentation are still a little rough, but they seem to agree its a promising idea, and do note that XMOS seemed to be aware of the issues and showed signs of moving to solve them. Definitely a product to watch.

Posted in Computers, Electronics, General, OldBlog | Tagged , , | Leave a comment

Barrel #2: Away

barrel2guts.jpg
The 12-note barrel is away. I’m pretty sure everyone from Collexion involved is well and truly done with this particular stunt, but it was a neat project with some great results. This one went through the School of Music’s benefit gala to benefit the School of Music Service Organization. It only pulled in $750, but with the lower materials cost that still represents some income for the benefiting organization. The picture above is (almost) all the guts for the barrel, before being assembled and installed.

Posted in Announcements, DIY, Electronics, Entertainment, General, OldBlog | Tagged | Leave a comment