It's my first standalone project on a board I designed and fabricated using one of those desktop CNC routing machines.
Now I'm trying to upload the sketch to the ATMEGA2560-16AU using FTDI. And not having much joy
When I say standalone, it also has some L298 motor controllers, some opto-isolated inputs and a buck power supply, but nothing too complicated.
There should be a photo link here:
If you can view the photo you might notice I totally forgot to add the ICSP header, and had to add it in afterwards.
I used Nick Gammon's Atmega_Board_Programmer on an Arduino Mega2560 to flash the bootloader.
To do this I cut the 5v power supply trace from the board, so that the target chip was powered from the Arduino Mega. The programmer reports that it was successful.
I have an LED connected to pin 26 on the MCU (Arduino pin D13) which repeatedly flashes twice. I guess that means it is waiting for a a sketch to be loaded?
Now the next step, uploading the sketch (using a FTDI adaptor) times out.
I have tested that my FTDI adaptor is working using another board I had lying around, iBoard Pro by Itead Studio. No problems there.
I have checked the fuses are set correctly using Nick Gammon's Fuse Calculator (see attached)
I have the reset pin connected with a series cap (100nF) and a 10k pullup. I have checked with with a scope, and it definitely pulls to zero, and then rises to about 4.9v after 2.5ms.
Could this be too fast? i.e. not long enough to cause a full reset?
I have enabled the clock output on pin PE7 (set low fuse to BF) to make sure my crystal is working correctly... looks like a pretty solid 16MHz signal.
The only hint I have is that pin2 (RX0) is permanently pulled low. It pulls the TX of the FTDI low as soon as it is connected. I have tested with a multimeter, it is not shorting on any other pins and I have 1.8 MOhms to ground (this is similar to the iBoard Pro I successfully uploaded to earlier).
Is there some fuse or enable bit I am missing that enables serial port 0?
I reflowed the chip using solder paste and a hot air pencil. I was careful not to use too much heat for too long... could I have cooked the chip and only affected Serial 0?
Surely the other functions (flashing pin 26, clock output on PE7) would also be affected if that was the case?
Any help (from anyone who has actually built a standalone AVR) would be greatly appreciated.
Atmega Fuse Calculator.txt (886 Bytes)