jump to navigation

Hardware bites, hard 2006 May 9 20:13

Posted by diamond in : Work , 1 comment so far

One of the (many) projects i’m currently working on involves some devices based on the atmega128 microcontroller. A quite powerful and sophisticated piece of kit.

I’ve been trying to run some tests on the device over the last week. These efforts have been going worse as time goes on. The output from it has been steadily moving towards complete gibberish during the testing. It started off with just part of the data being nonsense. Over a couple of days, it spread until most of the data is gibberish. I eventually came to the conclusion that the firmware on the device has gotten corrupted, something suggested also by tyndall (the folk who created this device).

So, i dug up a copy of the firmware, hooked up the JTAG programming cable, and downloaded the new firmware. So far so good, or at least so i thought. The output of the device was now completely gibberish. I could see none of the structure of the packet format. Hum. Then i noticed that atmel’s (the makers of the atmega128) programming software could no longer talk to the device. Eek.

After some panic, some wild speculation, and finally some talking to tyndall, it became apparent that the problem is thus: there are a number of options on the atmega128 called fuses. These fuses are set in particular patterns to enable/disable certain functions. One particular fuse is for enabling/disabling JTAG programming. Would you like to guess which it defaults to? That’s right, disable. *cringe*

After discussing the issue with cjb, emailing tyndall saying what amounted to ‘…. help?’, discussing the reply with cjb some more, i realised that there was another way of programming the chip. It apparently has an SPI programming port too. I spent most of today trying to follow the board schematics, the chip pinout diagrams, and SPI cable schematics on the net to try and figure out how one could access such.

I think i’ve finally figured it out, and i have a part list of about 10 components (resisters, diodes, a transistor, a d-sub9 connector etc) that i’ll pick up in maplins tomorrow and attempt to create my own SPI cable. In software, the worst you’d ever have to do is wipe it all and start again. Oh if it only were that easy with hardware. I spent most of the time vastly out of my depth, looking up initialisms, and pestering cjb for help as i floundered around. Thanks mostly to his amazing patience, i didn’t drown during the floundering, just swallowed a lot more water than i had planned on. <insert summarising sentence here>