How to make an Arduino-compatible minimal board

I have done a fairly lengthy post about how to make a breadboard "Arduino-compatible" setup ...

With the aid of an FTDI cable you can program your breadboard from the Arduino IDE, just like a normal board:

The post describes wiring, how to install the bootloader, and other details:

I just got a FTDI cable (yea behind the times) and read in some very old post that RTS wouldnt work for reset, is that changed?

http://arduino.cc/playground/Hacking/FTDIAutoReset

You've got me worried now! It's working, but maybe it shouldn't be ...

Well with the cable I have, which I think I got from Adafruit, this is what I see on the RTS and Reset lines (ie. before and after the capacitor):

It looks like RTS is going low (and stays low) which causes Reset to pulse low for about 1 mS.

Osgeld:
I just got a FTDI cable (yea behind the times) and read in some very old post that RTS wouldnt work for reset, is that changed?

Arduino Playground - FTDIAutoReset

I believe the very first arduino board designed to have a auto-reset function used the RTS signal. On later versions they changed the hardware to use DTR instead, but for legacy compatibility reasons had the IDE pulse both DTR and RTS. Not sure that is still the case or not as sometime in the version changes they handed off the activation of the control signal(s) from the IDE directly to AVRDUDE directly. But Nick's example implies the RTS is still pulsed.

I couldn't get it to work at all if I moved the pin to the "free" spot on the FTDI header (the one I have labelled CTS). A check with the scope appears to show it is not pulsed.

well yea CTS was never in the equasion, its been typically on DTR (or apparently RTS back in the day?), which is not broken out on FTDI cables

you would have to cut open the USB end of the cable and find DTR, I was lazy and reset never worked with my MCP2200 (or whatever microchips pic made USB bridge thing is) so I just got used to hitting the button since my POS dumpster computer does not have a serial header broken out (though the pad's are on the mobo, its wonky as it is and not worth messing with as its being replaced soon)

That's a very nice set of instructions. Is the Programmer sketch based on other code such as Optiloader or Adaloader, or is it a new ground-up rewrite? I've been trying to use Adaloader to re-write an ATmega8U2 chip without success (I believe the problem is related to the flash page size). Do you think your Programmer sketch could be adapted to other chips?

It's a complete rewrite based on reading the datasheets.

Because it programs the Atmega2560 I believe it handles flash page sizes correctly (until you exceed 0xFFFFFF).

It should be adaptable to other chips because the programming information is in a table.

Hmm, very nice indeed! Time for a printout...

Has this issue been resolved anywhere? regarding which pin to use RTS or DTR for auto Reset?

What I described on that page works for me, if that answers your question.

I will plug it in tonight and post what I find, if its working for nick I would bet it would work for me as well

Awesome write-up Nick! I learned a few things, and the pictures are excellent!

How about a '1284 version Nick :slight_smile:

Do you mean the bootloader, or the whole thing?

I've just ordered the processor, I'll give it a try.

Nick, that flash programmer is beautifully written. If you don't mind me asking, do you have some project in mind, or is this just something you've done for the hell of it?

Anyway I used it to write to an application to an 8U2 and it worked first time. No worries with 64 byte flash pages.

So now I can use a single Uno to update itself: Nick's sketch running on the 328 chip, to load my Arduino-serial/ArduinoISP mashup into the 8U2. Followed by avrdude plus the updated 8U2 to rewrite the 328's bootloader.

Just for interest, these are the changes I made:

1,5d0
< // Modified 9th May 2012 by Tim Giles
< // Added ISP application for 8U2 chip on Uno boards
< // Added "autonomous" mode for use in case no serial input is available:
< // This mode writes the binary indicated by the signature, verifies it, writes the fuses, and then stops
< 
47,48c42
< #define INCLUDE_MD5SUM false  // make false if you are running out of program memory
< #define AUTONOMOUS true  // make true if running without user control (no serial input)
---
> #define INCLUDE_MD5SUM true  // make false if you are running out of program memory
120d113
< #include "application_atmega8U2.h"
182,190c175
<   { { 0x1E, 0x93, 0x89 }, "ATmega8U2",    8 * kb,   512,
<         atmega8U2_usbisp,   // loader image
<         0x0000,             // start address
<         6060,         // size of loader
<         64,           // page size (for committing)
<         0xFF,         // fuse low byte: external clock, max start-up time
<         0xDF,         // fuse high byte: SPI enable, boot into bootloader, 8192 byte bootloader
<         0xF4,         // fuse extended byte: brown-out detection at 2.7V
<         0x2F },       // lock bits: SPM is not allowed to write to the Boot Loader section.
---
>   { { 0x1E, 0x93, 0x89 }, "ATmega8U2",    8 * kb,   512 },
376,378d360
< #if AUTONOMOUS
<   // skip Lilypad option
< #else
403d384
< #endif // AUTONOMOUS
405,408d385
<   char command='G';
< #if AUTONOMOUS
<   // skip verify-only option
< #else
409a387
>   char command;
414d391
< #endif // AUTONOMOUS
585,587d561
< #if AUTONOMOUS
<   while(1); // wait forever
< #else 
591d564
< #endif // AUTONOMOUS

tim7:
Nick, that flash programmer is beautifully written.

Thanks!

If you don't mind me asking, do you have some project in mind, or is this just something you've done for the hell of it?

Just learning more about the way this stuff works. My next project is to upload a file from an SD card.

Anyway I used it to write to an application to an 8U2 and it worked first time. No worries with 64 byte flash pages.

I see you changed the address to write the "real" program rather than the bootloader. Glad that worked out OK. And you got rid of the interactivity. I thought that might have to happen. :slight_smile:

So now I can use a single Uno to update itself: Nick's sketch running on the 328 chip, to load my Arduino-serial/ArduinoISP mashup into the 8U2. Followed by avrdude plus the updated 8U2 to rewrite the 328's bootloader.

Glad my work is useful. It's nice to get some positive feedback.

Hi,
Is there any difference between the Lillypad boot loader and Uno boot loader other than fuse settings for the internal/external clock and its speed ?

Thanks

Duane

rcarduino.blogspot.com

The Lilypad loader is a lot larger, I don't know why.

'cause it runs at half-speed, so you need twice as much :wink: