2009-12-02

Bringing up the UART

I spent a moment with the mega8515 again. This time I'm using a small dev board I made. It contains a level shifter and a ready header you can plug an old PC serial port to. I read a bit on how avr-libc does stdio and with a few lines, the cylon light now prints out the state in the main loop. You could easily compare the state to a previous one or some flag and just print the value when it changes but the point was mostly just to get some text out. Another exercise might be to use backspacing to make a character dance on the terminal like the LED does on the board. My current goal is some minimal command line I can use to fiddle with the system without having to constantly do the write-compile-flash-test loop. It goes something like this:

   printf_P(PSTR("Command prompt test\n"));
   printf_P(PSTR("p x: print x"));
   printf_P(PSTR("l:   show state of port A"));
   while(1) {
       printf_P(PSTR("cmd> ")); // prompt

       if (fgets(buf, sizeof buf - 1, stdin) == NULL) // ^C, maybe EOF
           break;
       if (tolower(buf[0]) == 'q') // q)uit
           break;

       switch (tolower(buf[0])) {
           default:
               printf("Unknown command: %s\n", buf);
               break;

           case 'p':
               if (sscanf(buf, "%*s %s", s) > 0)
                   printf("Got %s\n", s);
               else
                   printf("scanf failed\n");
               break;

           case 'l':
               printf("Porta: 0x%02X\n", (uint8_t) ~PORTA);
               break;
       }
   }
   printf("Bye!\n");

It's kind of neat how the familiar Unixy string stuff is largely there.

2009-11-05

A+, would buy again!

I thought I'd sign praises for some products I've come across. Off the top of my head in no particular order.

Nikkormat FTn

Nikkormat FTn body The term "built like a tank" pretty much qualifies. Match needle metering is very nice. The shutter speed ring can be a bit odd. 625 battery is certainly a downside, but it appears to work quite well with just an LR-44 dropped in.

Today: If you can afford it and want all-manual film, this is an excellent option.

Nikon D40

Carenar mounted It was the cheapest (D)SLR body in the market at the time. It's turned out to be a real jewel. Conservative design cut down. Small and light but comfortable to use. Well thought-out and fast operation, most options at your fingertips. Comfortable size screen. Last model made with this sensor, so quite likely the best model made with this sensor. Many seem to think this outclasses many "pro" bodies that are cumbersome and bulky and the extra features aren't worth the huge price leap. That probably depends on the features you need. Fast 1/500 top flash sync speed. Fits almost every F-mount lens ever made (including pre-AI!) plus anyhing else you can safely attach of course. Doesn't do D-TTL (does i-TTL), screw drive AF (does AF-S), or AI metering (does electronic metering). Sadly not stop-down metering either.

Today: Still as good as ever. Discontinued but you can still find some and they'll be very affordable because it's seen as an old low-end camera. 6mp is sufficient for me. Easy to carry but not a pocket camera. Depends on your use. No dynamic range trickery, auto bracketing or LCD viewfinder. Perfect mate for any 50/1.8 Nikkor or 100/2.8 Series E!

Vintage Micro-Nikkor 55/2.8 AI-S

I paid a fair bit for this and whatever it was, it wasn't enough. This is a dream. All micro-Nikkors are spectacular and 55mm is a very general purpose one. Reliable manual action, f/2.8, very very long throw focus ring. Good working distance. Scary sharp. Absolute dream lens for closeups.

Today: As good as it ever was, unless yours has been damaged by oil migration, physical trauma or excessive use. And even still it probably works and may be repairable. Today, old models (and there are only old models, the new ones are a different splendid animl) can occasionally be found for very reasonable price. You can't have mine.

Nikon SB-20 Speedlight flash

Progress with flashes Funky old-ish unit. Auto flash in several steps (set ISO and aperture). Manual flash in several powers. PC sync connector. Pretty good power. Vertical bounce angle with odd rotary head, three fresnel patterns. Probably does D-TTL too, I don't know. Bulletproof exposure for many ranges and subjects.

Today: A real winner for off-camera and other manual use along with SB-28 and some Vivitars. Handy bounceable flash. A bit bulky perhaps. Seems reliable. Low trigger voltage of course. Subtitute another good flash and you still get a lot.

Asus P2B motherboard

ECC ram, Piii with a little overkill cooling. Quite possibly the most stable "beige" PC ever. Affordable x86-ricer cpu power in its day.

Today: Quite obsolete. Pci isn't compatbile with everything, little underpowered and slot1 has no upgrade path. USB1.1, UDMA33.. And it's still just a pc.

Biltema bit-box

Small belt-clipped plastic box with screwdriver bits and an extender. Size of a matchbox or so and attaches together as a handy screwdriver. Saved me a lot of trouble as a sysadmin and I still take it along occasionally. You can switch some of the bits for strange ones if you need them. I have a hex bit for furniture and a torx that fit certain compaq parts. It was cheap, too, IIRC.

Today: Still working perfectly though it's probably easy to damage the plastics with excessive force. You can probably find various models and variations of this. They're a good idea. Swiss rmy knives and multitools aren't. They just don't work.

Miltec civilian version of a bundeswehr shoulder bag

Black, square, has no clips or obnoxious bits. The shoulder strap ring has a tendency to turn sideways if loaded. I've added pockets for a cellphone and pen case. Inconspicuous and practical.

Today: Better than new with the pocket hack. Carries books, Ti-86, bags, clothes, tools, smaller laptops, cameras and whatnot.

Frost's #121 knife (puukko)

Puukko From the "perfection is achieved when there's nothing more to remove" school of design. Sure grip, good sized blade for woodwork. Very accurate to work with. When sharpened properly, very sharp and still durable. Sheath is the swedish utilitarian plastic type. I've made a new one for fun.

Today: As good as ever and best I've met.

Kenwood Trio oscilloscope

Oscilloscope Well, any old (or new, but older ones are affordable) scope in good repair. Doesn't have flashy features and sometimes you miss storage or image capture, but that's the way it is. Takes some space, too. I've wanted one since the 80's and I wish I would have gotten one earlier. Full repair manual available from BAMA or some other source for some models.

Today: Still works perfectly. Lets you do a lot of basic measurements and observations.

I'll see if I can come up with more and add some links later.

2009-10-31

An experiment in toner transfer

Just Because, I decided to walk through the toner transfer process with my current things at hand. The biggest variable, that I was hoping to be the only one, was the paper. I started with the plain copy paper that I use for printing.

I drew up a small breakout board. SOIC-8 to be exact, quite useless. The results looked good on paper so I cleaned a piece of very thin two-sided board I have a big sheet of and ironed the design on until it shows through. In hindsight, the taping needs more thought because the glue gets around and masks a part of the backside of the board with a sticky mess.

I decided to solder on a chip I took out of something while trying out a small butane torch. SMD desoldering works out pretty nicely with that. Destroying the board may or may not happen with through-hole components, though.

After some inspection I decided pins 1-2 were shorted because of ragged copper, maybe under-etching, and a solder bridge that I can't get out without clearing the whole board. Funnily enough that's the output and negative in on LF353, so I have half of it permanently wired as a buffer.

Not a total loss, so I decided to try it out. I put -+ voltages on the chip, attached the scope to the outputs, wired both sides as voltage followers and fed some kHz sine in.

The result: it works. I took out the feedback on the left and the sine remained. There must be a short. Disconnecting the right side had (un)predictable results, so that probably works fine.

On a whim, I also fiddled with the supplies a bit. The positive clips normally as does the negative until you get to a certain point where JFET opamps do something funny: The negative clipping comes out as positive max.

So, I'm going to need to find some other type of paper and try not to get anything on the backside. Or use single sided board instead. And it wasn't a complete waste, I have a spare extra wide DIL package LF353 dual opamp now. :)

Atmega8515 cylon light

Flashing
I finally started trying out the ATMEGA8515 chips I got for a very reasonable price (at least by .fi standards). It's been a typical bit by bit process bootstrapping s development system. I've eventually ended up with a bsd style programming cable, a series resistor module, PSU, breadboard, MCU and wires. The pile of interesting stuff just waiting for me to have some working controllers to poke them with has been growing steadily in the background.

Flashing (the dark side)
Software side is trivial, since Debian has the kit available and integrated. It also happens to run on a computer that has a real parallel port, so it's a handy choice. I'm somewhat familiar with AVR style C and I like parts of it and parts I don't. AVR's interrupts and the gcc/libc api for them are still one feature I'm pretty hazy on.

I finally ran into a nice tutorial on the timer system. It won't go through everything but that's what datasheets are for. Instead, it walks through creating various blinkers in different ways using delays and timers. In the end I had a running cylon light using a timer interrupt and an ISR that counts up and down plus an endless loop that writes the result to a GPIO port, lighting one LED at a time.

2009-05-21

Guitar Hero

If I'd made Guitar Hero, I'd probably added some instrumentation. A way to check a replay and see exactly why some part isn't working out. What's early or late and what's expected. Without that it's all guesswork.