Through the hole DIY Arduino: how to upload sketches?

Hi, I've been playing in Eagle 6.2 the last couple of days and made my own through the hole Arduino. I will use it to control a small robot, the board must power a couple of servos and sensors. I used a LM2576 5V 3A regulator that should be powerful enough. The schematic I have made is attached, can someone take a look at it and tell me if I didn't make any mistakes? In the schematic there is a small 100µH inductor (L2) connected between VCC and AVCC. I saw this in the schematic of the Arduino Severino, do I really need this?
The board only has an ICSP 6 pin connector, can I use this to upload sketches? What programmer would I need to do this? Or are there other ways to upload sketches without removing the microcontroller? Are there programmers that I could connect to my board which I could use for the serial monitor? Do I need another/different header for this? This would help a lot for debugging code. I already have a couple of ATmega328P-PU's that I have bootloaded myself on a breadboard with an Arduino Duemilanove.

ATmega328P-3A.pdf (24.7 KB)

You can use the Duemilanove to upload sketches through the ICSP header. Hook it up like you would to burn a bootloader. Put ArduinoISP sketch on the Duemilanove. Select "Arduino as ISP" under Programmers. Select Upload Using Programmer from the File menu to upload your sketch.

An alternative is to buy a "FTDI Cable" and put a serial header on your board. The FTDI cable does the USB-to-Serial. Then you can use the bootloader and serial monitor like you do with the Duemilanove.

Ah, didn't know about ftdi cables :blush:
I've added a 6 pin ftdi header to my schematic. Connected GND/VCC, TX/RX to the corresponding pins on the ATmega and the DTR pin through a 100nF cap to the reset pin. I hope that will work if I buy a cable like this?
http://www.ebay.co.uk/itm/USB-TTL-5V-Serial-Cable-FTDI-FT232RL-Chipset-Arduino-UNO-mini-/270873825130?pt=US_Parallel_Serial_PS_2_Cables_Adapters&hash=item3f11568f6a

I've attached the updated schematic.

ATmega328P-3A.pdf (26 KB)

The cable looks OK. You have Tx/Rx around the wrong way. Compare:

Oh yes, TX/RX must be connected to RX/TX on the programmer. Thanks :slight_smile:

Bajdi:
there is a small 100µH inductor (L2) connected between VCC and AVCC. I saw this in the schematic of the Arduino Severino, do I really need this?

If you want the highest quality of ADC conversion, then that inductor is helpful in filtering noise induced by the Atmega itself. Similarly, you probably want a de-coupling capacitor between GND and AVCC on the analog side, as well as the capacitor between AREF and GND for the option of external reference.

If you're not going to be using the ADC, or if having that tenth bit be super accurate is not that important to you, then the inductor can be ignored. Personally, I only use the top 8 bits of the ADC, and I just have a 1 uF capacitor between AVCC and GND, and use AVCC for my reference, and it does fine for what it needs to do.

I would add a reverse biased diode such as 1N4148 from reset pin to +5V also, helps with preventing occasional lock up when reset is driven & released.
(resulting voltage spike supposedly makes the uC think it is going into high-voltage programming mode).
Connect CTS on the header to GND, lets a part such as FTDI Basic know the slave is ready to receive data.

And, if we're into super-tweaks:

  • a 1 MOhm resistor in parallel with the crystal may improve stability and resilience
  • you may want to buffer the MOSI/MISO signals between MCU and header
  • you may want TVS diodes (6.8V type) on all externally accessible header pins
  • you may want a polarity protection diode, and perhaps a polyfuse resettable fuse, on the power input