SukkoPera / avr-fusebit-doctor

Repair dead ATmega and ATtiny microcontrollers
39 stars 11 forks source link

So I built this and here are the issues I encountered #1

Open nickd4 opened 1 year ago

nickd4 commented 1 year ago

In my build the tracks were a bit skinny due to a problem with my etchant and I decided to press ahead anyway even though I ended up having to do quite a bit of debugging to fix broken tracks and such. If doing it again, I would start by checking every track by multimeter against the PCB diagram, I put off doing this at first as I was thinking I'd have to go by the schematic which would be much slower.

In the process of fixing the PCB issues I would connect the power wires, test, disconnect the power wires, put it back under the microscope to look for opens, repair tracks etc, and repeat. And at some stage I accidentally reversed the 12V power :( Things appeared to still work, but eventually I realized the BC557's and possibly the BC548 had become leaky, I avoided replacing them for a long time :(

My debugging method for the BC557s and BC548 was to remove doctor chip and probe patient socket's RESET and VCC lines while connecting the transistor base resistors to GND and VCC and verify that the transistor can apply the +5V and +12V and that it goes away when transistor base is open or in inactive state. (I used a dummy load, but the circuit already has pulldowns installed anyway).

So all of this tedious debugging wasted a day and a night, but eventually I was satisfied that the hardware was correct, at least I could not find any more issues by very careful inspection and probing. And the build mostly works, BUT, I still seem to have some residual issues and I will list them here.

  1. Unreliable starting, and I reckon this is because RESET does not have a capacitor installed to debounce the switch. It would depend on how much stray capacitance is in your circuit and switch and how bouncy your switch is, but keep in mind that short reset pulses with clock running are illegal. So I installed a 1.0 nF capacitor across the switch (AVR has Schmitt input for RESET so slow rise is OK). I believe my fix has made the problem go away, but would have to remove and re-test to be really sure.

  2. Unreliable with HVPP parts, it will work for a while (press switch say 10 times) and then stop working for a while (press switch say another 5 times and eventually it will come good again). And I reckon this is because the patient AVR does not have its AVCC (and AGND on older parts that have a separate AGND) connected properly. HVSP is reliable for me and I suspect it's because those smaller pin count parts that rely on HVSP mode, do not have separate analog supply pins. Also it may depend on which parts you are using, the original author mentioned that not all parts have been tested. I happen to have a lot of AT90S2313, AT90S4433, AT90S8535 in stock (very old parts as I was an early adopter), these chips have separate AGND and don't work without it. So that may be why the problem wasn't reported earlier. OTOH, I also see the problem with an ATMEGA8 so perhaps the issue is actually with my build.

  3. Refuses to erase chip, even though I have the "allow erase" jumper installed and have probed it carefully to be certain the circuit is built correctly. I suspect a firmware issue, but again it may be my build. :( To debug this I may create a diagnostic firmware that reports the state of all lines as seen from the chip, with the pull-ups enabled. I could then try shorting each line to ground one at a time to test it.

At this stage I haven't finished debugging issues 2 and 3 due to lack of time and hardware. (I need to grab some different sized sockets from the office and try wiring their AVCC, AGND and possibly even AREF and then use them as interposers, I don't have any sockets at home because I normally just cut off the right amount of SIP socket and construct my own sockets since SIP socket is more versatile). But I decided to make a report anyway, as others might have encountered similar issues. Let me know!

All going well, I'll probably re-make this in KiCAD and do an open source firmware. I really love the way the author has designed this, even the removal of 9 pins from the 40-pin patient socket was kind of clever when you look at his layout, but unfortunately I need those pins back to add the AVCC/AGND connections. So I'll probably end up redoing the layout and shuffling the pins a bit. I may also redesign the RESET/VCC transistor part and clean-room the rest, in which case we could open source it fully.

SukkoPera commented 1 year ago

Thanks a lot for your testing and detailed review! I'm not sure this board is suitable for hand-etching, I don't know if the tracks are thick enough. I only have a single one, professionally-made and it seems to work fine, but I think I've only used it a couple of times.

It would be great to have a fully open alternative. I don't really like the need to remove those 9 pins, so please avoid that if you remake this from scratch :).

Good luck!

nickd4 commented 1 year ago

Thanks for the feedback, and for putting the repo up. I hope it can become a hub for maintaining the project as far as feasible, hopefully you can donate a little time for approving PRs, closing issues etc (otherwise I am happy to assist).

I think it is acceptable for hand etching, the feature size is not too small and the oval pads help a lot. However, what it requires is (1) an aggressive etchant so you etch quickly and remove before there is significant under etch, and (2) etch compensation to enlarge the mask slightly to compensate for under etch. But in my build of this project the etching took a whole hour :( And there was significant under etch, this also happened recently with another project and wasted a lot of time so I switched to a different chemistry with initially good results but then a turn for the worse when reusing the new etchant.

The way I prepare masks normally is with KiCAD exporting to Gerber, then a Linux utility (maybe called gerbview or something like that) to convert to 1200dpi PNG bitmaps. Then I run a Python utility I wrote that adds the etch compensation, basically wherever it sees a dark pixel in the input image it "ors" in a 4x4 circle in the output image. So every track gets 3 pixels wider and every inter-track space gets 3 pixels narrower. This works for me normally. However, in this case I did not apply my procedure and just used the provided images.

SukkoPera commented 1 year ago

Sure, I will approve PRs but I can also add you directly as a project collaborator if you prefer.

I have never done home-etching, I really don't want to mess with chemicals, I wouldn't know how to do it safely enough :).

AlucardXP commented 1 year ago

@nickd4 When I originally came across the project, there was also a tutorial on how to etch your own boards. Mine came out decent with the method that I used (laser print onto a glossy magazine page, transfer the ink to copper clad, etch with sketchy radio shack solution). I had a lot of issues with the traces being unreliable. There were also a lot of ground areas that were too close to other traces.

Now that its been over 10 years later, I went to revisit the project I was working on (recovering a locked AT90S2313 with a disabled RESET pin). Most my traces test ok but it won't work anymore. Most likely due to thin traces. With how cheap you can get circuit boards printed and cut, it may just be time to redesign the board and upload a version that anyone can use to get printed.

fusebit_dr