Need some help in the Ghetto (AVR programming)

So I got my old printer cable cut up and wired to a tidy DB9 connector, and I've rechecked all the wiring about 6 times, comparing my connections to all the pictures and the pinout schematics from the ATMEL website, and I'm convinced that everything is correct ( that's obviously the problem right there). Running WINAVR, compiling the LED_Demo program goes fine, but the software is not able to communicate with the ATTiny2313. I tested the connection with the avrdude commands (avrdude -p t2313 -c dapa -P lpt1 -n -v) and the results suggest that communications are just not happening. I tested the parallel port by hooking up the printer, and that went fine. I'm out of ideas as to what to check. Any help out there?

sort by: active | newest | oldest
1-10 of 14Next »
CTroyer (author) 9 years ago
The latest ; AVR Freaks.net has an excellent article by 'Plons' that describes the problems I've been having. So I built the programming cable to the specifications there. I'm still seeing no communication with the ATtiny. I suspect that I destroyed part of my parallel port with hot swapping the cable. Now I wait for my new oscilloscope to arrive from ebay. It's amazing what's out there. When I find out what's going on - I'll post some more. If I ever manage to blink an LED, I'll post to the original instructable.
CTroyer (author) 9 years ago
After reading six more websites that all insist that the dapa approach works, I rebuilt my cable, this time with the 150 ohm resistors in place, about 8 inches long, everything tidy and secure - sending data to the chip through avrdude looks like it's working, but always comes back with errors the the write didn't actually happen. Messing around with avrdude in terminal mode, it looks like I can erase the eeprom or flash data, but any kind of a write fails. I tried adding a delay with the -i switch; it did make things go very slowly, but no improvement on the results. Dang.
gmoon CTroyer9 years ago
You're sharing the gnd with the Vcc source and the DAPA cable, right?

I've been able to read data through the DAPA interface with no power applied to the AVR at all...some sort of parasitic voltage through the cable...but writes fail...
CTroyer (author)  gmoon9 years ago
Yes, there is one ground wire connected to the ground on my power supply and pin 10 of the 20 pin socket. That pin is connected to the ground (pins 18-21 on my parallel port.) I also added a power indicator LED on my board, as I found out today that the fuse was blown on my power supply. It hums just the same without the fuse, but it doesn't provide any output....According to the AVRfreaks wiki, the clock rate on an ATtiny2313 fresh out of the tube is 1MHz, so the baud rate in avrdude needs to be set low. Baud rate needs to be less than 1/4 the clock frequency of the chip for synchronization to work; I tried with -b 60 -i 1000 and still got nada. Took a while though....The fun thing I found out last night is that avrdude 'looks' like it is writing and reading whether a chip is present in the socket or not. The data 'read' from the chip always come back as zeroes. Ah well, back to the wiki. There was some interesting discussion of the lock bits, but I think my problem is more fundamental....
gmoon CTroyer9 years ago
It was just a thought. You mention "socket"...so it's on a project board of some sort, with an ISP connector? At this point, I'd move the AVR to a solderless breadboard with power and ISP connections only, and try that.
CTroyer (author)  gmoon9 years ago
By 'socket' I mean the 20 pin connector that the AVR sits in. I haven't purchased a solderless breadboard yet, so I'm wiring things up on a project board, much like the one in the instructable. I have a battery pack set up with 3 'C' cells ( I thought that was appropriate, as I'm also programming in C) , a switch, and a power on indicator LED, and that's it. I just wired the switch in tonight; when I relocated the wire for the power on indicator, I found that the LED has power when I plug in the DB25 connector, without the battery pack switched on. There is 1.75 volts coming from one of the other 4 wires, through the chip, lighting the power indicator, and going back to ground. I thought that was curious, so I checked voltages at each pin with the dapa cable plugged in and unplugged, with and without external power supplied. I'm headed over to the AVR freaks forum to ask what the voltages should be with this sort of cable and chip. I also got the address range for the parallel port squared away. I had to start calling it LPT3 and manually change some settings in Windoze, and now instead of reading all zeroes, I can read endless strings of f's......YAY progress!
gmoon CTroyer9 years ago
I think the voltage you're seeing on an unpowered (but ISP connected) AVR is the "parasitic" effect I mentioned above. The AVR will even respond to some ISP commands, but there's not enough voltage or current to write to the flash mem. Good luck on the rest. On my end, I can say for sure the DAPA cables work.
CTroyer (author) 9 years ago
Dang, looks like I failed to post my last comment. To sum up, I tried reducing the power supply to a pair of 'C' cells - got exactly the same results as before "AVR device not responding - initialization failed rc= -1" Tried a new 2313, same result. Swapped back to an old one tried reversing the polarity. Got hot enough to almost burn my fingers. Latest attempt was to bypass the tidy DB9 and solder directly to the chip socket. Still no go. I'm ready to try a slightly more complicated arrangement from the AVRwiki site. (But still cheap....)
gmoon CTroyer9 years ago
Here's a nice tutorial on AVR programming with a DAPA cable. It was the link that got me started.

It's Linux-oriented, but maybe the pictures and schematics will help you double check your cable and setup.... It's not the 2313, but the ISP pin names (MOSI, MISO, etc.) are the same.
gmoon gmoon9 years ago
One more thing--there's a definitely limit to the length of a DAPA cable, and it's approx. 70cm. My working cable is about half that length.
1-10 of 14Next »