Adding ICSP to the PICkit 2
I want to show how I added ICSP capability to my PICkit 2 programmer.
First, peel open the case, starting at the lanyard clip:

I want to show how I added ICSP capability to my PICkit 2 programmer.
First, peel open the case, starting at the lanyard clip:

I spent most of yesterday getting Microchip’s AN734 code working on a PIC16F690. To spare others the pain, here’s a tarball of my source code and Makefile.
To test this code, I connected a couple wires to the I2C lines on the flash memory on one of my computer’s memory DIMMs. I got the idea from the lm-sensors project. Here’s a photo:

So does it work? I’ll test it using the SMBus tools from lm_sensors. (In Fedora, “yum install lm_sensors” as root will install it).
The SMBus protocol writes an address byte, then reads the resulting data. AN734 just reads/writes the same buffer, so the effect is to echo the SMBus address back.
i2cget will only write to i2c addresses 3 and above. I have fixed this in the tarball above. For whatever reason, the address is half the one given in the an734.asm source file. So I set the address to 0×06.
Now, I’m ready to test:
[root@kaonashi ~]# i2cget -y 0 3 0x01
0x01
[root@kaonashi ~]# i2cget -y 0 3 0xff
0xff
Sweet!
My new computer has a VGA video camera built-in, and can apply some simple effects in real time. Here’s Melody playing with it:

Thanks to Chris, the builder of stuff, who prepared this rendering of the scanner for me:

Well, I’m gonna be going to the Amia conference in Anchorage, Alaska next week.
I want to take my second prototype film scanner to show it in at a vendor booth. One problem: I don’t have one yet! All the parts should arrive this week. So I’ll be working day and night to get it together.
I’m excited about the new design. The ripple in the last test film is caused by two things: First, the brush-DC motors I was using had some “cogging” as the motor turned. This was preventing the film from moving smoothly through the transport. Secondly, the displacement sensor I was using (the carcass of an optical mouse), which *should* have canceled out the motion, has a lowly 300 dpi resolution. I made a PLL to translate this signal up to the line clock for the camera, but the sensor resolution limited the accuracy of the line clock.
After some interesting but ugly work with a stepper motor (too many moving parts), I switched to a high-torque pancake motor directly driving the spindles. Much better. This motor has no cogging that I can feel, and turns very smoothly. If this was a money-no-object design, I would use e-TORQ motors. But, remembering the 80/20 rule, I found a Chinese manufacturer of decent pancake motors intended for electric bicycle use. I designed a current-mode controller for them. I’ll have to limit their maximum speed: They can really whip a reel of film around! Maybe this can be a feature: rewind 800 feet of film in twenty seconds!
I’m also going to replace the 300 dpi sensor with a new 1600 dpi sensor (sacrificed from a Razer mouse). This should give a good, stable image. Thanks to HP/Agilent/Avago for putting their excellent datasheets online.
It’s exciting to see something come together after working for almost a year on it.
I was designing something using qcad and needed to scale an object in one dimension only, to draw in perspective. So I made a patch to qcad that looks for two comma-separated arguments in the rescaling dialog. If it sees two arguments, it will take the first as the x-dimension scaling and the second as the y-dimension scaling.
Also, I made a trivial patch to allow qcad to compile on a 64-bit platform.

In my business, I’ve been trying to design a low-cost, archival film scanner. I’ve been working out of my garage. Today I got a piece of film scanned for the first time. It’s really rough!
Read the rest of this entry »
Today I got some circuit boards back from Advanced Circuits (aka 4pcb). They packed some freebies in the box: A packet of microwave popcorn, and a clock-thermometer-desktop organizer gadget, which didn’t work. I hope it’s not a PCB failure. Advanced Circuits has crazy marketing. They’ll give new cutomers $500 of merchandise free. Too bad I’m not a new customer.
I had a bad customer service experience the other day. I was ordering a sandwich at W.G. Grinder’s (what a stupid, cutesie name) and the employee I was talking to answered his cell phone while I was still giving my order.
Now, I’m not a customer relations genious, but I think that’s pretty high on the list of things not to do.