Hello, I'm new to the whole robotics thing but I plan to make it my career path. I just finished the circuit for the $50 robot and tested it with a CBL Multimeter. As far as I know, everything is fine. The problem comes when I attempt to upload a program to the chip. I keep getting error 24 with ponyprog and I can't find the problem. I must have checked everything a dozen times. I tried using AVRdude with the following command.

I didn't try to do anything but upload the program. I didn't even try to recompile it, I just used the photovore hex file that was on this site. I am using the cheaper programmer with ponyprog 2000. I can't post any photos but I've traced the circuit many times and followed it in comparison to the photos posted by others. I can see nothing wrong with the circuit itself. Is there any special way I should go about testing the circuit to see if it's a wiring issue?

Logged

"Give a man a fire, he's warm for a day. Set a man on fire, and he'll never be cold the rest of his life." - Unknown

If you didn't try to program fuses, the only other way you can still brick it is to try and program while the mcu is either off or at a really low voltage. (on rare occasions fuses can get corrupted during a bad programming)

Are you sure you are on com1? (check in system devices)

Are you using a USB to serial adapter? (it'll often cause cheap programmers to fail)

I'm not using a usb to serial adapter. There are two com ports on my computer labeled com1 and com2. I have tried both settings with both ports with 0 results. What exactly should I look for in system devices? The existance of com1? It's there and "working properly." There is also an lpt1 port. I imagine this isn't it but tried it anyhow. Failure.

I have the battery plugged in and all the voltages look fine. Actually no, scratch that last comment. I just checked again and the sensor bus is at 2.75 V with the chip in and 2.95 with the chip out. I don't get it. The voltage was fine before. The battery currently measures 6.8 V. All the connections still look fine though. Could this be the problem? Maybe I somehow fried my 5v regulator. I know it was fine before. I got a measurement of about 4.94v before.

« Last Edit: October 20, 2009, 07:50:52 PM by AtomicWaste »

Logged

"Give a man a fire, he's warm for a day. Set a man on fire, and he'll never be cold the rest of his life." - Unknown

Yea that voltage problem sounds like it. Check the regulator without any wiring except power and ground - if its still not working, then its the problem. As such, hit it with a hammer a few times as an example for all the other regulators that might decide to otherwise stop working.

In trying to make my quest to build this cheaper (unsuccessful), I ended up with free samples of three Voltage regulates from TI, would one of them work?The bags are labeled:IC VOLT REG POS 5V .5A DPAKIC POS-VOLT REG 1.5A 5V D2PAK-5IC POS-VOLT REG 5V D2PAK-5

Logged

"Give a man a fire, he's warm for a day. Set a man on fire, and he'll never be cold the rest of his life." - Unknown

well, I swapped in the last one, destroyed it like you said (helps with the anger), and checked the voltages. The servo bus reads 6.77. The sensor bus exactly 5 with a very occasional fluctuation to 5.02. Power Pins 7,20,21 read 5v as well the grounded pins 22 and 8. The programmer header also reads 5v. and yet...

I still can't program it.

I get the same errors in ponyprog 2000 and avrdude. What could possibly be wrong? How tight is the chip supposed to be in the DIP socket. I don't think I can push mine any deeper into the socket but it comes out easily. All the pins appear to be making connection though.

Is there any way I can make sure the atmega8 is powered up?

This site mentioned a similar problem.http://forums.obdev.at/viewtopic.php?f=8&t=2042. I guess I have no choice but to pay another $5 for shipping to get another atmega8. Should I pick any thing else up while I'm at it? I have a low budget now (after spending $120 on this thing) but I'm not the type to just give up and throw it in a corner.

Thanks for bearing with me so far. Any other ideas?

« Last Edit: October 22, 2009, 01:04:38 AM by AtomicWaste »

Logged

"Give a man a fire, he's warm for a day. Set a man on fire, and he'll never be cold the rest of his life." - Unknown

Hmmm well there is still the chance that you bricked it during the low voltage problem. If you order another, also get an ATmega168 so you can do the upgrade. Mouser.com will probably have cheaper shipping.

If the ATmega seems kinda loose, bend out the pins a tiny bit so that it firmly fits.

Using a multimeter, measure the metal pins directly on the chip, then the traces on your board, and see if there is a good connection.

Sorry It has taken me such a long time, I was busy, had to wait for cash, and had to wait on parts.

Thank you for all your help, I replaced the atmega8 and was amazed to see that the thing worked. Like you said, I got an atmega 128 and a 328 for later, I have yet to test either.

I still have two problems though. The first, the LED. I have checked every schematic and picture I could find, I am sure I have the voltages right, and yet, no light. I touched battery wires directly to the LED (I know, bad idea, but, It didn't blow up) and it came on so I know it works. I also plugged in a larger LED and saw a slight blink on that one upon turning on the robot, but only then. What size resister should I have used?

The second and more important problem involves the turning. Even when I place a flashlight over the one sensor and cover the other, all I get is a slight jerk, then the whole unit starts moving forward again. I am pretty confident my connections are all tight and I've graphed the sensor data on a TI-83 plus so they must be working to some extent. Again, what size resister should I have used?

Logged

"Give a man a fire, he's warm for a day. Set a man on fire, and he'll never be cold the rest of his life." - Unknown

...The second and more important problem involves the turning. Even when I place a flashlight over the one sensor and cover the other, all I get is a slight jerk, then the whole unit starts moving forward again. I am pretty confident my connections are all tight and I've graphed the sensor data on a TI-83 plus so they must be working to some extent. Again, what size resister should I have used?

The first, the LED. I have checked every schematic and picture I could find, I am sure I have the voltages right, and yet, no light. I touched battery wires directly to the LED (I know, bad idea, but, It didn't blow up) and it came on so I know it works. I also plugged in a larger LED and saw a slight blink on that one upon turning on the robot, but only then.

The LED is not a power indicator - its connected to an I/O pin and you must write the code to make it turn on the LED. To do this you have to set the pin to an output pin and then make it go low. (Yes - low) Since the LED is connected from the 5V supply via the resistor to the pin. So setting the pin low will cause current to flow through the LED.

Well, I solved the turning problem. It appears that the atmega8 bowed a little and the pins weren't connected as tight as I thought. I little push and it worked fine.

Sorry typo, I got the 168.

As for the LED, I know it's not a power indicator, the program admin passed out does turn the LED on right?

The LED is not fried. I attached the end farthest from the controller directly to the source of the motor bus with a spare wire and it lit. I tried the same thing again except I passed it through the resister and it still lit. It only lights when I give it the 6.6v power though. I just don't think that the 5v being supplied to it from the atmega8 is enough to light it. I might decide to just turn it into a power indicator and forget about it.

Another odd thing, I took a second led and went down the outputs (connecting the chip to source)to see if it would light up, It did as expected on the two servo ports, but it also did on the two unused ports, yet for some reason, it did not light from the port the actual LED is plugged into. I can think of only two possible reasons why. First, the program isn't turning it on, I didn't even recompile the included hex file so I don't think that is why; and second (more likely), the real LED is already using all the power,and 5v just is not enough to light it.

I've considered attaching a transistor up to it and wiring it through the servo bus instead, that is after al,l the only way it appears to light. Would that work?

Logged

"Give a man a fire, he's warm for a day. Set a man on fire, and he'll never be cold the rest of his life." - Unknown

Well, I solved the turning problem. It appears that the atmega8 bowed a little and the pins weren't connected as tight as I thought. I little push and it worked fine.

Gald to hear it's sorted .

Quote

The LED is not fried. I attached the end farthest from the controller directly to the source of the motor bus with a spare wire and it lit. I tried the same thing again except I passed it through the resister and it still lit. It only lights when I give it the 6.6v power though. I just don't think that the 5v being supplied to it from the atmega8 is enough to light it. I might decide to just turn it into a power indicator and forget about it.

The fact it is not fried is more luck than judgement I'm afraid. You should use a current limiting resistor, without it you are shortening the life of your LED and risking your micro too. From what you describe here it sounds like the resistor you are using may be too large. What value are you using? Did you calculate it? See the Admin's link above.

Quote

Another odd thing, I took a second led and went down the outputs (connecting the chip to source)to see if it would light up, It did as expected on the two servo ports, but it also did on the two unused ports, yet for some reason, it did not light from the port the actual LED is plugged into. I can think of only two possible reasons why. First, the program isn't turning it on, I didn't even recompile the included hex file so I don't think that is why; and second (more likely), the real LED is already using all the power,and 5v just is not enough to light it.

The micro is only capable of supplying a certain amount of power from each pin, this is enough to drive 1 LED. Be careful about overloading ports as you could kill your micro. It is always better to use your meter to read voltages round a circuit. Also testing all the pins is fairly pointless unless you know specifically how each pin is programmed to behave.

Quote

I've considered attaching a transistor up to it and wiring it through the servo bus instead, that is after al,l the only way it appears to light. Would that work?

Yes it would, but it is not necessary. Any output pin on the micro should be capable of driving an LED directly if things are correctly configured. Again see Admin's link above to the LED page.