Hi, I’m not new to electronics but I am new to both arduino and atmel chips. I have an arduino uno which I’ve used to program only itself and had no problems with. I have tried to search the forum for a solution but haven’t found one, only part solutions to some of my problems which have all been solved now, just this final major hurdle to go…
This is a long one so you might want to get a snack for the journey :)
I’m having extreme difficulties programming my newly bought blank Atmega 328p-au TQFP chip that I’ve mounted on a PCB.
The PCB is not fully populated at this point, just the MCU, reset pull-up resistor, resonator and wires for the i/o programming and power lines.
So effectively all that’s in the circuit is:
Atmega 328p-au TQFP chip (Farnell order code: 1715486):
Pin1,2,9,10,11,12,13,14,19,20,22,23,24,25,26,27,28,32: Not Connected
Pin 3,5, 21: Ground
Pin 4, 6, 18: +5V
Pin 7: XTAL 1 Pin 8: XTAL 2
(these pins are connected together via a 1M resistor and then to a 16MHz resonator with 3 pins, central connected to ground, other two pins connected to 7 and 8 of MCU. It has internal capacitors so no need for externals, according to datasheet! http://www.farnell.com/datasheets/95544.pdf )
Pin 15: MOSI Pin 16: MISO Pin 17: SCK Pin 29: RESET (connected to RESET header pin and then via a 10k resistor to +5V)
Pin 30: RXD Pin 31: TXD
I’ve checked all the pins and outputs with a multimeter continuity check and everything appears fine, no dry joints or short circuits, all pin to pin resistances are as low as expected and resistor values correct.
I have used the ArduinoISP file, optiloader (Bill Westfield) and an alternative version of ArduinoISP from Nick Gammon (http://www.gammon.com.au/forum/?id=11637) and they all install the bootloader fine (and Nick’s program reads it back to confirm it’s on so it definitely works with the MOSI/MISO).
However, when I then try and program the MCU with a sketch using the Arduino IDE I get this error:
avrdude: stk500_getsync(): not in sync: resp=0x00
Using a number of different combinations of Board and Programmer selected (all the tutorials just say Arduino Uno and AVRISPmkII but as I’m desperate I’ve tried them all in different combinations). I did put a capacitor across the Arduino reset and checked that it wasn’t just reprogramming itself (Blink is such a useful tool!) so it’s not that.
I also reloaded the bootloader with an option for using the 8MHz internal clock (Nick’s program gives two options, 8Mhz internal or 16Mhz external) and tried again but using the lilypad328 as the board (his suggestion) with no success (I also tried the other boards again just incase, same result). I then reloaded the 16Mhz external version and verified this using his program to see that it had installed correctly.
I then tried with a standalone USB to serial board (http://onecall.farnell.com/ftdi/mm232r/development-kit-usb-uart-module/dp/1146037), after loading the bootloader with the above system. I connected up the board to give a 5V output (confirmed with multimeter) and then connected the RTS pin from the serial board via a series 0.1uF capacitor to my reset pin, and the serial TXD and RXD to the MCU’s RXD and TXD respectively (I also tried it the other way round on the off chance, it gave the same error).
Serial TXD > MCU RXD Serial RXD > MCU TXD Serial RTS > 0.1uF > MCU RESET (still also connected to the 10k to +5V) Serial VCC5V > MCU +5V Serial GND > MCU GND
When I connect up the serial output to the MCU and try and program anything (even tried BareMinimum) I get the same error.
I am using Board>Arduino Uno and Programmer>AVRISPmkII. I have the correct serial port selected (port 10 for breakout, port 9 previously for arduino), I have also tried using Board> Arduino Duemilanove and tried Arduino Nano (both with 328 obviously) and got the same result.
I have tried the same sequence with Programmer>AVRISP and USBasp and USBTinyISP on the off chance and all give the same result.
Does anyone else have any idea what else I could try and/or how to fix this problem?
The only thing left that I’m doubting is the resonator but the schematic for the arduino has a similar setup so I can’t see why that would be an issue, and wouldn’t that stop me re-programming the bootloader (which I’ve done several times) if the clock wasn’t working?
I’ve just borrowed an avr dragon and installed the software but have absolutely no idea how to use it. I’ve seen a couple of suggestions about checking fuses but I’ve no idea how to do that, the program by Nick gives me a load of hex numbers back but when I look on the 328 datasheet I can’t work out what they’re supposed to mean, it just says you should set the fuses but doesn’t give any values that match up with the hex numbers seen in the fuse output.
Thanks for reading if you got this far, and thank in advance for any help you might offer, no suggestion is too obvious! (I really am a pure newbie when it comes to this chip :/ )