AVR Programmer

Hi Everyone,
I hope this is the right section to post this.

I would like to create my own circuit to program ATTiny45 and Atmega8 chips.
I have an FTDI cable and would like some guidance to what circuit is required.

I was hoping I could connect RX to MISO and TX to MOSI directly, but it appears I need other components.

Many thanks,
Justin

[UPDATE] Sorry everyone, I've cause confusion here, the large chip I have is not an Atmega8, it is actually a AT89C2051.
I'm leaving the above unchanged so it doesn't make the posted replies seem off topic. :blush:

jgporteous:
Hi Everyone,
I hope this is the right section to post this.

I would like to create my own circuit to program ATTiny45 and Atmega8 chips.
I have an FTDI cable and would like some guidance to what circuit is required.

I was hoping I could connect RX to MISO and TX to MOSI directly, but it appears I need other components.

Many thanks,
Justin

A FTDI cable/module/or board mounted can only program avr chips if there is already a bootloader burned onto the chip. What is required if not using a bootloaded chip is a AVR harware programmer. Note that one simple AVR programmer is another arduino board running the IDE example sketch aruinoISP. Then wire the SPI pins required between the arduino board and the chip to be programmed.

Thank you, I will try build this using a Pro Mini, which interfaces with the FTDI cable... I will post results 8) :slight_smile:

I would like to create my own circuit to program ATTiny45 and Atmega8 chips.

Please refer to Nick's excellent tutorial (general concept):

ATtiny85-centric:
http://forum.arduino.cc/index.php/topic,185572.0.html

Ray

Hi,
Anyone know what pins the SCK, MISO and MOSI are for the AT89C2051?
I'm battling to find it with google :slight_smile:

Thanks,
J

My luck, moments after I post I find them:
Port Pin Alternate Functions
P1.5 MOSI (Master data output, slave data input pin for ISP channel)
P1.6 MISO (Master data input, slave data output pin for ISP channel)
P1.7 SCK (Master clock output, slave clock input pin for ISP channel)

:slight_smile:

Thanks everyone, I've managed to make my own programmer.

Tested it on the ATTiny45 and it works.

This programmer programs the 8 pin ATTiny and 20 pin Atmega8 (Still testing the Atmega8).

My references:
http://www.robot-italy.net/downloads/pighixxx/attiny.pdf

Hope this helps someone else!

J

If anyone is interested in the proto-board I used, you can find them here:

They are really useful!
J

Programming the ATTiny45 works like a charm.

I can't get it to program the Atmega8 (20- pin).
I've tried adding a 12Mhz crystal between pins 4 & 5 and both to 22pF caps to ground.

Any ideas?

J

Atmega8 (20- pin)

Someone sold you a short DIP ... by about 8-pins... did you break-off an ATtiny85 portion???
(Aprils' Fools)

Ray

LOL! funny :wink:

After resorting to RTFM (Read The manuFactures's Manual), I noticed I need 12V on the RSS.
I'm powering my mini pro via the USB... think this could be the problem?

J

jgporteous:
I was hoping I could connect RX to MISO and TX to MOSI directly, but it appears I need other components.

actually it is possible to use a serial port to directly program avr (see ponyprog etc) but arduino as isp is easier and more reliable. if you have trouble with m8 its most likely a wiring error because there is no difference between that and t45 regarding programming algorithm.

Hi,
thanks for that.
This is my wiring for the AT89C2051:
AT89 -> ISP : Description
1 -> 10 : RST
10 -> GND : GND
11 -> VCC : VCC
12 -> 13 : SCK
13 -> 12 : MISO
14 -> 11 : MOSI
4 & 5 are bridged with a 16Mhz Crystal, and each lead has a 22pF cap between it and to ground (i.e. 2 caps)
I have also tried a 12Mhz Crystal.

I've tested all connection with a multimeter and they are all making contact.

J

jgporteous:
I can't get it to program the Atmega8

sorry, i was replying to the m8 comment, ive no experience with trying to do atmel 8051 variants using arduino as isp. i dont know anybody who has succeeded there either. personally i use custom socket board and software to do those.

btw, nice adapter board.

Is it possible to connect a USB-FTDI to a circuit which has a 12V external power supply without damaging the FTDI component?

My thinking for the AT89, is to use the USB to FTDI to power 5V, and add 12V to the RST pin as suggested in the datasheet.

So to sum it up:
If I connect the GND of the FTDI with the GND of the External 12V, will that cause problems?
J

Is it possible to connect a USB-FTDI to a circuit which has a 12V

It would be advisable.

There are a number of ways to buffer serial TTL to RS232 levels. A MAX3232 IC, RS232 IC, or even a few transistors and resistors will get you there inexpensively... do the Google thing...

Ray

Hi Ray,

I mean the FTDI has 5V from the USB, the 12V would be an external source used on the target MCU.

J

FTDI has 5V from the USB, the 12V would be an external source used on the target MCU.

Essentially... RS232 is +12 and -12 level shifts. TTL serial is +5V and 0V. RS232 additionally is likely inverted which is why one can reprogram "inversion" on the popular FT232R chip used on many TTL-USB devices.

If the signal is +12 and 0V, then a resistor bridge could be utilized.

There are lots of circuits available to suit you needs. Breakout boards from Adafruit and Sparkfun, too.
Check out: RS-232 vs. TTL Serial Communication - SparkFun Electronics

A Deumilanove in my case I use it to programme almost all sorts of ATmega and ATTiny uCs.