Press "Enter" to skip to content

nuxx.net Posts

Building AVRDUDE Under OS X

NOTE: This doesn’t work right. See this update.

Since I don’t do much software development, it took me a bit to understand how to get AVRDUDE to compile with libusb under OS X. These steps here have been confirmed to work for AVRDUDE v5.5 and v5.6:

– Install libusb from MacPorts: sudo port install libusb
– Extract the AVRDUDE source, change to that directory.
– Set CPPFLAGS so the libusb headers can be found: CPPFLAGS="-I/opt/local/include" && export CPPFLAGS
– Set LDFLAGS so the libusb libraries can be found: LDFLAGS="-L/opt/local/lib" && export LDFLAGS
– In the AVRDUDE source directory, run configure as the MacPorts version does: ./configure --mandir=${prefix}/share/man
– Build it: make
– Win!

UPDATE: This doesn’t actually work. It builds, but attempting to access the AVR Dragon returns the following error: avrdude: jtagmkII_getsync(): sign-on command: status -1. This also occurs with the version of AVRDUDE in MacPorts, making me wonder what exactly the AVR MacPack folks had to do to make it build properly for OS X.

1 Comment

Sharp Cheddar, Edwards’ Berkshire Bacon, Garlic Mushrooms

Today's lunch is a sandwich of sharp cheddar, dryly sauteed garlic mushrooms, and Edwards' Berkshire Bacon.

This sandwich, along with a bottle of sugary Mexican Coca-Cola, is my lunch today. It was assembled this morning by Danielle while I showered, made from items cooked last night. The sandwich is made from a piece of generic French bread from the bakery at Nino Salvaggio in Clinton Township, sharp cheddar, mushrooms and garlic which were sauteed in extra-virgin olive oil and butter, and Edwards’ Berkshire Bacon purchased at Zingerman’s after the 27th Anniversary tasting.

This is an extremely good sandwich.

I can only think of a couple ways to make it better, and those would only be incremental improvements which aren’t really that important. Specifically, using freshly chopped garlic with the mushrooms, a less yeasty bread, and a bit more special cheddar.

UPDATE: Upon completion of this meal I have realized that it is missing something: chocolate. I could really go for some decent mint chocolate right now. Unfortunately, the bar of chocolate currently owned by me is sitting on the kitchen counter at home. This disappoints me greatly.

Leave a Comment

Programming Problem w/ AVR Dragon and ATmega8 in HVPP Mode

Over the weekend I received the jumpers for connecting the recently acquired AVR Dragon, so I decided to give it a go this weekend. Because the chips I’m using are programmed to use an external clock, the best programming mode for writing chips stand-alone is High-Voltage Parallel Programming, which doesn’t rely on an external clock.

After jumpering the board for HVPP per the SCKT3200A2 devicesheet in the official AVR Dragon documentation I tried it out on both OS X and XP, and it mostly works well, except for programming the EEPROM. For some reason, EEPROM seems to just not write, and thus validation fails. If I insert a chip with EPROM already programmed properly, validation will work, so reading is definitely working and nothing is (even partially) overwriting the existing data.

There are no problems writing the Flash or fuses, and since writing to both Flash and EEPROM use the same lines, I don’t think it’s something mis-jumpered. Nor do I believe the problem is the chip itself, since I’ve tried multiple chips which can be programmed in an STK200 (parallel port bitbang) programmer.

Here’s the command lines used with the AVR Dragon which errors while validating the EEPROM:

avrdude -p m8 -P usb -c dragon_pp -U lfuse:w:0x3f:m -U hfuse:w:0xdf:m -U flash:w:SDrive.hex:i -U eeprom:w:SDrive.eep:i

Here’s the one used with the STK200 clone, the same chip, and the same version of avrdude, which works just fine:

avrdude -p m8 -c stk200 -U lfuse:w:0x3f:m -U hfuse:w:0xdf:m -U flash:w:SDrive.hex:i -U eeprom:w:SDrive.eep:i

Here’s the actual error:

[Working stuff here cut...]
avrdude: verifying ...
avrdude: 8084 bytes of flash verified
avrdude: reading input file "SDrive.eep"
avrdude: writing eeprom (329 bytes):

Writing | ################################################## | 100% 36.51s

avrdude: 329 bytes of eeprom written
avrdude: verifying eeprom memory against SDrive.eep:
avrdude: load data eeprom data from input file SDrive.eep:
avrdude: input file SDrive.eep contains 329 bytes
avrdude: reading on-chip eeprom data:

Reading | ################################################## | 100% 33.60s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0x72 != 0xff
avrdude: verification error; content mismatch

avrdude: safemode: Fuses OK

avrdude done. Thank you.

If anyone has an idea as to what might be wrong here, I’d love to hear it. This is exactly the same problem I get on both Windows XP (avrdude v5.6 from WinAVR-20081205) and OS X (avrdude v5.5 from AVRMacPack).

For what it’s worth, I have posted this here on the AVR Freaks forum, but it doesn’t seem to be receiving any replies.

UPDATE: It seems that this is a problem with avrdude. I can program the chip with no problem in HVPP mode using AVR Studio. This would be a good time to have a logic analyzer. Maybe I could actually fix the problem.

2 Comments

Broken Black & Decker Screw Extractor

Black & Decker Screw Extractor which broke while being threaded into the hole for its first use.

To deal with the stripped cleat screw problem mentioned earlier I headed over to Home Depot, encountered a toilet, then bought a Black & Decker Screw Extractor Set (#16270). Also known as “easy-outs”, these conical, left-hand threaded tap-like devices allow you to drill out the head (or center) of a screw and then thread the extractor down inside and remove the screw. These are useful when you strip the head of a screw, have rusty parts, break screw heads off, and other things like this. That is, they are useful when they don’t snap on first use.

I drilled out the hole, set the extractor in the hole, attached a tap handle, then started turning the extractor to embed it in the screw and break the screw loose. Right as I did this, there was a subtle POP and the whole tip of the extractor broke off and remained lodged in the hole.

While I was able to drill out the other screws to a slightly larger size and use the broken extractor, the first screw now had a bunch of very hard metal stuck in the center of it. This particularly hard steel thwarted all efforts at drilling with the bits I had on hand, so I had to slot the screw with a cut-off wheel, then go at it with a screwdriver. One very large screwdriver and a surprising amount of torque later and all four screws were out.

3 Comments

Stripped Cleat Screws

Shimano SM-SH51 cleat in the bottom of my Sidi Bullet 2 shoes, with the 3mm hex head stripped out. Every screw did this when I went to change to Crank Bros Eggbeater cleats.

I just went to remove the Shimano SM-SH51 cleats from my biking shoes and the 3mm heads in each of the mounting screws stripped right out. I guess it’s time to go get some easy-outs and give drilling them out a go.

Leave a Comment

Broken Nipple

Broken spoke on the Mavic XC717-based wheels on my Specialized Rockhopper Disc.

Today while looking at my bikes and deciding which to try new pedals on I found that the the rear wheel on the Rockhopper Disc has a broken nipple, causing one of the spokes to be loose. I guess this means that I’ll be trying the pedals (more on these later once I have an opinion on them) on the Bianchi D.I.S.S. and taking the wheel in tomorrow.

While I normally like doing bike work myself, not having a truing stand, spare spokes, or spare nipples means that I can either take it in and pay $20 (or so) to get it fixed for riding this week, or spend 2x that (or so) and a tens hours of time (plus waiting for deliveries) and do it myself. I do wholly intend to be building bike wheels by the end of this summer, I want my bike up and working properly ASAP.

Leave a Comment

SIO Connectors!

Pile of 25 Atari SIO Connectors.

Today I just happened to find a package containing 25 brand new SIO connectors in the mailbox. Because of this I have reopened orders of wholly assembled SDrive NUXXs. I’ve also put the assembled devices on the SDrive NUXX ordering page, so they can be ordered by people without my manually sending invoices.

Leave a Comment

Two-Layer Simple PCB Routing

Top / component side of a PCB.   Bottom / solder side of a PCB.

While doing the PCB layout stuff for the SDrive NUXX, I’ve spent a lot of time trying to make the traces as simple and attractive as possible, while ensuring the components on the PCB are reasonably well spaced and thus easy for an average DIY person to solder. When I do this, I set up the board with two layers, with the top primarily being the ground plane, and the bottom holding as many of the other connections as possible.

After establishing part footprints and placement (mostly based on front / rear panel controls in the SDrive NUXX’s case) I then try to lay out the rest of the parts, fitting them together like Lego, taking into account things that need to be near each other (caps and certain things), and other stuff like that. Then I route the board, trying to keep as many traces on the bottom as possible and moving repositionable components as needed. Of course, surface mount parts often require their traces to be on the top, but generally most things can be kept on the bottom.

Once everything connected in a layout that is looking good I’ll turn off everything but the top and bottom layers and associated pads, vias, and airwires. I then look at every top layer trace, and if it’s not needed for an SMT part or crossing over a trace on the bottom, I’ll try to move it to the bottom.

Next I’ll turn alternate showing only the top or bottom layers, as shown above. On the left is the top (or component) side with its traces in red, and on the right is the bottom (or solder) side in blue. Looking at just one side at a time I can more easily see traces routed in unnecessarily complex patterns. Sometimes I’ll have stairstepped a trace or routed it around something when a much simpler, straighter path would do. I find that having more layers (documentation, part outlines, part names, etc) turned on while doing hand-optimizing causes me to keep traces of areas where they can safely go, particularly under other components. Hiding this information clutter lets me focus on the bare wiring itself making the task even easier.

After a few rounds of this I generally find that the result is a layout with simple, direct, and well organized traces.

Leave a Comment