Difference between revisions of "ATtiny13"

From ThorstensHome
Jump to: navigation, search
Line 1: Line 1:
 
This is an example how to upload a program to the ATtiny13 microprocessor so that it will act as autonomeous computing device. An example is [http://www.elektronik-labor.de/Lernpakete/Kalender11/JingleBells.html playing jingle bells].
 
This is an example how to upload a program to the ATtiny13 microprocessor so that it will act as autonomeous computing device. An example is [http://www.elektronik-labor.de/Lernpakete/Kalender11/JingleBells.html playing jingle bells].
  
= What you need =
+
= Have =
 
* an ATtiny13  
 
* an ATtiny13  
 
* an ft232r chip
 
* an ft232r chip
 
* SUSE Linux 12.2. Other distributions may work similar, but you are on your own
 
* SUSE Linux 12.2. Other distributions may work similar, but you are on your own
  
= What you do =
+
= Know =
 +
The ATtiny13 looks like this:
 +
            ------
 +
  PB0(MOSI)-|ATtiny|-GND
 +
  PB1(MISO)-|  13  |-
 +
  PB2 (SCK)-|      |-
 +
        VCC-|    o|-RES
 +
            ------
 +
 
 +
= Do =
 
* install avrdude's dependencies:
 
* install avrdude's dependencies:
 
  yast -i bison
 
  yast -i bison

Revision as of 07:36, 3 January 2013

This is an example how to upload a program to the ATtiny13 microprocessor so that it will act as autonomeous computing device. An example is playing jingle bells.

Contents

Have

  • an ATtiny13
  • an ft232r chip
  • SUSE Linux 12.2. Other distributions may work similar, but you are on your own

Know

The ATtiny13 looks like this:

            ------
 PB0(MOSI)-|ATtiny|-GND
 PB1(MISO)-|  13  |-
 PB2 (SCK)-|      |-
       VCC-|     o|-RES
            ------

Do

  • install avrdude's dependencies:
yast -i bison
yast -i flex
      ------
 RTS-|ATtiny|-GND
 RXD-|  13  |-
 TXD-|      |-
 VCC-|     o|-DTR
      ------
  • connect the FTDI chip with the computer
  • unload the ftdi driver:
rmmod ftdi_sio
  • I told avrdude to output the first byte
tweedleburg:~/at/avrdude-5.10 # ./avrdude -cft232r -pt13 -P/dev/ttyUSB0 -U hfuse:r:-:h -B 1
avrdude: BitBang OK 
avrdude: pin assign miso 1 sck 0 mosi 2 reset 4
avrdude: drain OK 

ft245r:  bitclk 4800 -> ft baud 2400
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9007
avrdude: current erase-rewrite cycle count is -158 (if being tracked)
avrdude: reading hfuse memory:

Reading | ################################################## | 100% 0.01s

avrdude: writing output file "<stdout>"
0xeb

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

Which is basically what I expected.

and this:

tweedleburg:~/at/avrdude-5.10 # ./avrdude -cft232r -pt13 -P/dev/ttyUSB0 -U flash:w:blink2.hex -B 1

Now draw RES and the thing will start blinking :)))

tweedleburg:~/at/avrdude-5.10 # ./avrdude -cft232r -pt13 -P/dev/ttyUSB0 -e -U flash:r:-:i -B 1

Know-how

This does not fit into this article any more but I found it out: Read the flash:

tweedleburg:~/at/avrdude-5.10 # ./avrdude -cft232r -pt13 -P/dev/ttyUSB0 -U flash:r:-:h -B 1

TroubleShooting

Symptom
avrdude: /dev/ttyUSB0 open failed 
Solution
Unload the driver blocking /dev/ttyUSB0, in my case:
modprobe -r ftdi_sio

See also