I have two arduino Duemillanove boards both with ATmega328. Problem is with the second board. I can't upload any program with it. It always returns error:
avrdude: stk500_getsync(): not in sync: resp=0x00
Now the strange thing is that I can upload to both chips with first board. Then I put chip with program in second board and it works. Even USB serial connections work both ways.
In next few days I'm going to try to make a parallel programmer and try to upload using it, but then I'm out of ideas.
Sounds like possibly the second board is having a auto-reset problem, thus not resetting the board to activate the bootloader when you first press upload on the IDE. Try using the manual reset when uploading and see if the works. Press and hold down the reset switch, then press upload on the IDE, and when you see the compiled sketch size reported on the IDE release the reset switch.
Well then I'm stuck for a cause. You said the chip works in the first board and the loaded sketch runs if placed into the second board (proving the chip has a good bootloader) and if the sketch uses serial communication it works in both boards (proving the USB serial converter is functioning).
So I'm out of possible causes for those symptoms, sorry.
EDIT: Maybe one last test, run the loop back test on the suspect board (it's a sticky around here somewhere) cause perhaps the USB serial is only functioning in one direction, and your 'test sketch' only sends data to the PC but doesn't test the ability to receive data from the PC?
I had a similar problem but it was with an Arduino clone. Some how the uart was not recognized in the 1.0 IDE, but the skripts could be downloaded using an earlier rev or the chips interchnged with one that had a downloaded sketch with no problem.
If you have two authentic Duemillanove purchased at the same time, this sounds unlikely, but It might be worth a try loading a pre-1.0 rev and trying it.
I have found and tried the loopback test and sucessfully passed. I will try to use the old revision in a minute. I hope this work because it is indeed a chinese clone.