So I've been dealing with microcontrollers for a while, and have made multiple PCB's running arduino code for various custom gizmos. This one has me stumped, just wondering if anyone has any insight or can spot something obvious that I've missed.
I designed and had printed a atmega 328p board, with 16mhz resonator, FT230X USB interface chip, and some regulators and sensors with the intent of making an IMU to control some servos. The first one worked just fine- after bootloading through another arduino, you can load programs through the USB port just like an offical arduino.
The relevant parts of the schematic are here:
There are some 3.3V sensors on the I2C bus and status LED's as well but I'm pretty certain they can't have caused this particular bug and omitted them for clairity. I set the PROG and RTS-RST solder jumpers to bootload, then desolder them both afterwards. The USB_POW jumper allows the board to be bus powered- thought I'd need it, but turns out it should be always left connected.
The second one I made is giving me a serious headache. It accepted the bootloader the first time with no problems, using the stock ArduinoISP program using Arduino IDE 1.0.5 r2. I can then upload programs through the ArduinoISP, which run perfectly fine. Arduino IDE recognizes the board when plugged into the USB port, but is unable to upload any programs. I get the following error in "verbose" mode:
Using Port : \.\COM19
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Recv:
avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude done. Thank you.
So that means not communicating, right? My first move was to load a simple serial program that repeats a sent character, to test if the USB bridge was working, and it was. Echoed the sent character with no problems whatsoever at multiple baud rates. Then I took a look at the reset circuit, figuring it just wasn't resetting properly. Using an oscilloscope, I verified that the reset pin on the ATMEGA328p was being pulsed low briefly, which it was, and check that it was the same waveform as the working unit, which it was. I then tried several different values of C1, 1uF and 10uF, to make sure I didn't have a marginal solution that barely worked before, with no success.
I've also re-burned the bootloader, tried using different board's bootloaders (arduino uno and arduino pro mini, 5V 16MHz), re-soldered every relevant connection, and verified that the EEPROM settings on the FT230X USB bridge chip are the same. I've tried using different USB ports, and re-numbering the USB COM port in the device manager to several different numbers with no success, ie from COM19 to COM2 and COM9. I also continuty tested the RX, TX, RTS and CTS lines from the FT230X to the ATMEGA328p. Lastly, I looked at the 328 RX line with a scope and verified that it was getting the same initial serial data as the working unit. I also cleaned the little flux I had (board is SMD, solder pasted with a stencil and looks phyically very clean) off with alcohol and a toothbrush.
I cloned the settings of the FT230X on the working board to the non-working one using FT_prog, so I'm sure that's not the issue. I didn't change anything besides upping the maximum current to 200mA, a few ID fields, and the two connected CBUS ports to tristate and TX/RXLED#.
In short, I've got a board that I can't program via USB. I can program it through ArduinoISP, the USB bridge is working, and everything else I've tested looks good, and identical to a working unit. It's not the end of the world if I just have to desolder the sensors and blame it on a defective component but I'm hoping to learn what I did wrong. Thanks for reading, I know this was pretty long