Attiny84 Part-2

From media_wiki
Jump to: navigation, search

ATtiny 84

                                    ___________
                      +5          1|           |14  GND
                      Pin 0 XTL1  2|           |13 Pin 10  Connect Green Led
                      Pin 1 XTL2  3|           |12 Pin  9  Connect Red Led
                      Reset       4|           |11 Pin  8 
                      Pin 2 TX    5|           |10 Pin  7 
                       in 3 RX    6|           |9  Pin  6 SCL 
                     Pin  6 SDA   7|___________|8  Pin  5 MISO 


ATtiny 84

                                     ___________ 
                      +5           1|           |14 GND 
                       Pin 10 XTL1 2|           |13 Pin 0 Connect Green Led 
                      Pin 9 XTL2   3|           |12 Pin 1  Connect Red Led 
                      Reset        4|           |11 Pin 2  
       TX on Serial cable Pin 8 RX 5|           |10 Pin 3   
       RX on Serial cable Pin 7 TX 6|           |9  Pin 4 SCL     
                      Pin 6 SDA    7|___________|8  Pin 5 MISO 


ATtiny 84 Part 2
Setup ATtiny 84 at 1MHz and write blink program and flash to chip to connect a RS232 interface.

  • Connect USBtiny to ATtiny 84 Target Board.
  • Test the connection to programmer: avrdude -p t84 -c usbtiny -v
  • Load Arduino IDE and change Board settings to Atiny Core by Spence Konde Version 1.1.2
  • Load +BlinkATtiny84_RS232 Arduino file. (Do not Flash at this time)
  • Find AVRDUDE on your laptop - Or download it from https://www.nongnu.org/avrdude/
  • Using AVRDude Set Fuses to 1MHz : (Skip if using a new chip it should already be set.)

* avrdude -p t84 -c usbtiny -v -U lfuse:w:0x62:m Disables External Clock on PB2 Enable Divide by 8 Clock (1MHz) Default setting

  • Flash Blink ATiny84 file to chip from Arduino IDE using "Upload Using Programmer under Sketch Tab"
  • Notice the blink rate. Open Putty and set the Baud rate to 4800 (38400/8=4800)
  • Using AVRDude Set Fuses to 8MHz avrdude -p t84 -c usbtiny -v -U lfuse:w:0xE2:m Disables External Clock on PB2 Disables Divide by 8 Clock (8MHz)
  • Notice the faster blink rate. Open Putty and set the Baud rate to 38400
  • Connect 16Mhz external clock board
  • Using AVRDude Set Fuses to 16MHz avrdude -p t84 -c usbtiny -v -U lfuse:w:0xff:m "Enable External clock on PB2 Enables (16MHz)
  • Notice the even faster blink rate. Open Putty and set the Baud rate to 76800 (4800* 16= 76800)
  • Using AVRDude Set ATtiny Chip back to 1MHz avrdude -p t84 -c usbtiny -v -U lfuse:w:0x62:m
  • Remove 16MHz Clock Board.
  • Notice the blink rate.Open Putty and set the Baud rate to 4800 (38400/8=4800)

arduino-ISP commands

avrdude -P com40 -b 19200 -c avrisp -p t84 -v -e -U efuse:w:0x05:m -U hfuse:w:0xD6:m -U lfuse:w:0xFF:m
avrdude -P comport -b 19200 -c avrisp -p m328p -v -e -U efuse:w:0x05:m -U hfuse:w:0xD6:m -U lfuse:w:0xFF:m
avrdude -c usbtiny -p m328p -v
avrdude -P com40 -b 19200 -c avrisp -p t84 -v
avrdude -P com40 -b 19200 -c arduino -p t84 -v

Part 2 Project completed.


ATtiny84 Class