Arduino on Breadboard weird bootloader error

Hi all! I am new to this forum, I registered because an error encountered with my DIY arduino.

I am using a Macbook Pro running Arduino IDE under Mac OSX Snow Leopard.
Last week I assembled an Arduino on a breadboard with an ATMega168. Uploaded the bootloader using USBTiny, then adding serial connections with my PL2303 USB-Serial cable and a 74LS04 HEX inverter. I added auto-reset, too. (Also added 10k pullup resistor.)
It worked PERFECTLY! Auto-reset worked perfectly, too. When I pressed the upload button in the IDE, my code uploaded without any bugs. (Selected Duemilanove with Atmega168 from the tools menu).

I used that MCU up in an embedded project, so I had to replace it with another one. I bought a brand new ATMEGA328 MCU. I did exactly the same with it, but did not work.
Tried to burn bootloader with board selected as UNO, and then try to upload as UNO, without any success.
Tried to burn Duemilanove bootloader and upload as Duemilanove, without any success.
Also tried to add different upload speeds in boards.txt (19200,57600,..), without any success.

I was wondering if there's something wrong with my Atmega328p, so I uploaded the Blink sketch to it without bootloader, directly with USBTiny. Blinked PERFECTLY!

The weird thing is coming now:
I tried a loopback test from arduino IDE, while the blink sketch was running, and it worked perfectly. I just got back the bytes I sent.
Then when I saw that there's no problem with my serial connection, I burned the UNO bootloader again. Performed a loopback test again, and it FAILED. I got back nothing.

Before anyone asked: Auto-reset seems to work, because TxLed blinks up right after my code is compiled. But I also tried adding and pressing a reset button manually.

Can it be a problem with the bootloader? Or fuse bits? Or what?
I am trying tricks again and again with no success, and I'm getting a "little-bit" frustrated.

Any help would be appreciated. :slight_smile:

I've got some news, maybe it can help anyone with a problem like this.
Somehow the voltages of the 74LS04 were not good for this Atmega. The high on the Rx was too low for the mcu. Now, I assembled my own TTL inverters on both rx and tx pins, and now the code uploads.
It is still not perfect, because auto-reset doesn't work, but half success, if I press the reset button, there's no problem in the uploading process.

Are you using the sparkfun FTDI breakout? If you are, the tx and rx leds are reversed, so the signals coming from the computer flash the tx led and the signals from the atmega flash the rx led. A flash on the tx led doesn't necessarily mean that auto-reset is working. Try holding down the reset button until the tx led blinks once and immediately releasing it - that's how I do it without auto-reset (on duemilanove bootloader).

Thank you for the answer.
I have soldered my own DSUB-9 connector with the lines necessary, I plug the dsub9 in the PL2303 usb to serial cable, and the rx and tx lines to my board.
It's working now with my own 2n3904-based NOT gates, they have less voltage tolerances than the 74LS04. The HIGH voltage of this gates is at about 4.8V, and the 74LS04's HIGH voltage is t about 4.2-4.3. THis looks like my previous atmega168 worked with these signal voltages, but my new atmega328 needs less-tolerance inverters.

AUTO-RESET:
It's not working. Is it possible, that I have to use a bigger capacitor on the DTR line? I use now 0.1uF ceramic capacitor. That's the biggest I have now at home, maybe I'll try to connect them parallel. Tried 1uF electrolitic capacitors, but no success, maybe because it's polarized.

I read you guys post, I wonder if you disconnect the reset circuit from the reset pin of the chip, may be it will upload, I have a similar problem. See my post on "Installation & Troubleshooting" Anyway that will be my guess.