I spend the last 4 days trying to get an ATMEGA8 programmed using my own programmer (I’m in South Africa; a proper programmer would take minimum 1 week to arrive from overseas without customs delays etc, and my mid-semester break in which I decided to experiment with AVRs is only one week long. If I could have, I would have ordered a proper programmer in time).
I’ve tried AVRfreaks but could not get a solution yet.
I checked the programmer circuit many times, and I verified that the circuit is powered and the MISO, MOSI, SCK etc are correctly connected to the target AVR. The parallel port is also working and if I connect an LED to MISO, it drops low briefly before glowing dimly again. I also tried a different ATMEGA8 in case the first one was broken.
avrdude and Ponyprog report that the “device is not responding” and that I should check the connections.
Any help would be appreciated.
P.s. This is by far the most unusably buggy forum I have ever used. I had to battle for more than 10 minutes to post something. “Invalid session”? “get Lost_register”? That is a small subset of the errors I keep on getting.
cahofmeyr3:
I checked the programmer circuit many times, and I verified that the circuit is powered and the MISO, MOSI, SCK etc are correctly connected to the target AVR. The parallel port is also working and if I connect an LED to MISO, it drops low briefly before glowing dimly again. I also tried a different ATMEGA8 in case the first one was broken.
This jumps out at me. When I did the same test, I found:
RESET (pin 1 on CPU): Normally high, but goes briefly low when programming.
SCK (pin 19 on CPU): Normally low, but goes briefly high when programming.
MISO (pin 18 on CPU): Always low, even when programming.
MOSI (pin 17 on CPU): Normally low, but goes briefly high when programming.
I’m not sure why MISO would glow dimly when the chip is not being programmed. I tried this again on my breadboard, and MISO is normally low, but glows dimly when programming (I believe it is echoing what comes in on MOSI).
Also, I wonder if you could take a photo of your target board from a slightly higher angle. The connections on the target board are not very clear in the second photo above.
I also tried the setup on a different PC now, running Ubuntu. This time I got the same error (device not responding), but the LED on MISO did not even blink.
RESET (pin 1 on CPU): Normally high, but goes briefly low when programming.
SCK (pin 19 on CPU): Normally low, but goes briefly high when programming.
MISO (pin 18 on CPU): Always low, even when programming.
MOSI (pin 17 on CPU): Normally low, but goes briefly high when programming.
I tested SCK, MISO and MOSI. SCK and MOSI were low and did not change while programming.
This sounds like a problem with the programmer. The operation of the programmer should go something like this (see 27.8.2 in the datasheet):
RESET is normally high, but is pulled low and held low to put the CPU in programming mode.
SCK is a serial clock generated by the programmer, in time with programming bits sent on MOSI. When programming, you should see a regular train of pulses on SCK, and data on MOSI.
The CPU will echo back on MISO.
It sounds to me like you’re not seeing signals on either SCK or MOSI, which make me think the program isn’t even making it as far as the CPU.
Edit: It’s hard to see clearly what’s going on in the above photos of the programmer. If you can post top/bottom photos without the programming cable attached, I’ll see if I can find anything. Maybe a second pair of eyes will do it.
I’m very new to all this, so I’m starting to think there’s some basic fundamental assumption about this whole thing that I’m getting wrong. Then again there are so many unknowns, a problem could creep in anywhere. For example: could I easily have damaged one of the heat-sensitive IC components while soldering them to the veroboard?
This evening I once again verified that the programmer circuit matches the schematic exactly, and that the veroboard tracks are cut in the correct places. I have by now tested it on 3 different computers with no luck.
Wow, I’m not sure I’ll be much help debugging the programmer. I definitely can’t do anything without seeing the other side, but even then I’m not sure I can make sense of the incoming wires.
However, what you’ve said about MISO, MOSI, and SCK definitely seems to indicate something before the target board–either in the programmer or in the software end of things. You could perhaps narrow it down by taking a look at the signals coming into the programmer. What do you see there?