Bootload bare chips using Bit Bang - any pointers?

Hello All

I am fairly new to the arduino world, having been introduced to it through building a Reprap 3D printer.

Now that I have that working I wish to move into robotics and micro-controller programming.

I have all the components to breadboard the arduino and have ATtiny2313 and ATMEGA328 chips.

Now I don't have any AVR programmers but do have a USB-TTL cable as part of my printer setup. I see I can use this to burn the boot loader onto my AVR chips using bit-bang mode.

Now I don't know where I will find or create the boot loader, or what is the most up to date information on using bit-bang mode. I have arduino 21 installed on my computer (Windows Vista 32bit) and have used that successfully to program my printer motherboard and extruder controller.

Of course, my preferred method would be 'download this and run it' but it does not seem as simple as that.

If anyone can point me to the most up to date documents for burning a bootloader using a USB-TTL cable and bit-bang I would appreciate it. The more spoon-fed approach would be appreciated :slight_smile:

I guess I could use my Reprap motherboard (sanguino) as an ISP but I am hesitant to do that as I am afraid I may damage it and that will cost to replace.

Cheers

bump

anyone?

I don't know anything about the bit banging method but you can buy a programmer for $20 and get a bootloader for the 328 from the IDE installation.

I doubt you'll find a loader for the 2313 and anyway it really hasn't got enough flash for one.


Rob

AgeingHippy:
Hello All

Hello One.

If anyone can point me to the most up to date documents for burning a bootloader using a USB-TTL cable and bit-bang I would appreciate it. The more spoon-fed approach would be appreciated :slight_smile:

http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html

For the ATtiny2313 I suggest either buying an ISP (I really like the Pololu USB AVR Programmer) or use the ArduinoISP Sketch to turn one of your ATmega328 processors into an ISP. Trying to build a bootloader for the 2313 is an exercise in futility1.

1 Apparently, the folks at Atmel agree. The word "bootloader" is conspicuously missing from the datasheet. :wink:

Hi Coding Badly

Thanks for your reply.

I would like to clarify some points you make. Show my ignorance here :slight_smile:

You mention programming the 2313 with an ISP programmer since loading a bootloader is 'exercise in futility' as you say.

This implies one can program these chips without first putting a bootloader on?

If this is so, why would one put a bootloader on in the first place? Or is it because one needs either a chip with a bootloader OR an ISP programmer?

I am thinking I might try using my Reprap motherboard (Sanguino with Atmega644) as an ISP instead of trying the bitbang approach.

Cheers

AgeingHippy:
Thanks for your reply.

You are welcome.

You mention programming the 2313 with an ISP programmer ... This implies one can program these chips without first putting a bootloader on?

Yes. That is the purpose of an ISP; to program a processor that does not have a bootloader. Using an ISP it is possible to program any AVR processor an Arduino user might use. In other words, once you have something functioning as an ISP, you can use it to program your 2313 processors as well as your 328 processors.

If this is so, why would one put a bootloader on in the first place?

The Arduino folks decided serial communications is a good way of transferring data between the Arduino and the host computer. In other words, they decided to use two pins for serial communications.

ISP communications is through three different pins (MISO, MOSI, and CLK).

So, the choice is to use the existing serial port to upload Sketches or to use an additional three pins to upload Sketches. By using the serial port, the three ISP pins are available to use any way we wish.

Or is it because one needs either a chip with a bootloader OR an ISP programmer?

I don't understand what you're asking.

I don't believe that it is possible to bit-bang program any AVR using the FTDI "serial cable." The bit-bang method I saw used the "programmed IO" pins on the FTDI CHIP that are not accessible using the cable. (I suppose that it OUGHT to be possible. There are enough pins.)

I also recommend getting a USB-based ISP programmer. An ISP programmer will allow you to program almost any AVR chip. A bootloader lets you add code to a chip using a simpler communications path, but not all AVR chips support a bootloader. A USB programmer like Adafruit's USBtinyISP is comparable in price to a serial cable, and is a good investment. (or get an Arduino and use the ArduinoISP sketch. Also a good investment.)