[HH] [Fwd: programming an ATtiny13 in AVR Dragon]

Greg London email at greglondon.com
Sat Apr 21 22:06:02 EDT 2012


I was able to use the AVR  Dragon to program an ATtiny13
using AtmelStudio6 on a windows7 virtualbox running insdie
my Ubuntu system.

HOORAAAY!


It's way more complicated than programming
an arduino with a bootloader.

And I swear Atmel doesn't want anyone to actually figure
out how to program an ATtiny13 on the AVRDragon, because...

DAMN

does their documentation suck.

I should probably write this up in an orderly "howto"
and put it on the web. Cause as far as I can tell,
this kind of documetn doesn't exist.

Anyways, I hope that the process will be quite a bit
more "downhill" after this point.

Greg


---------------------------- Original Message ----------------------------
Subject: programming an ATtiny13 in AVR Dragon
From:    "Greg London" <email at greglondon.com>
Date:    Sat, April 21, 2012 8:49 pm
To:      email at greglondon.com
--------------------------------------------------------------------------

It worked!

I am using Ubuntu 10.04 LTS - the Lucid Lynx

>From Ubuntu I created a virtual box
Oracle Virtual Box 4.1.12

Inside the virtual box, I installed Windows 7.
And installed all the service updates.

In windows7, I  installed Atmel Studio6

I purchased an AVR Dragon.
I soldered a 40pin zif and male headers in all the empty spaces.

I created a little protoboard of female connectors to implement
Device Sheet SCKT3400D1, which is the High Voltage Serial Programming
connections for ATtiny13a, among others.

I created a new C project in atmel studios6

I entered the following code:


#include <avr/io.h>

volatile uint8_t i=0;

int main(void)
{
  DDRB= 0b00001001;
  PORTB=0b00000000;

  while(1){
     PORTB=0b00000001;
     for(i=0;i<254;i++);
     PORTB=0b00001001;
     for(i=0;i<254;i++);
  }

  return 0;

}


This should flash pin B3.

In atmelStudio, I select
Build->Build Solution

It says "Successful".

I put an ATtiny13a chip into the ZIF socket of the AVRDragon.
And I plug in the Socket for HVSP.

I plug the USB cable into the PC and the AVRDragon
The red and green LEDs both come on.

In AtmelStudio, I select Tools->Device Programming

I select the following:
Tool->AVR Dragon
Device ATtiny13A
Interface HVSP
then click "Apply"

The LEDs' flash and everything seems OK.
I read the device ID and it says 0x1E 0x90 0x07
I read the target voltage and it says 5.0v

Under "Memories", I select the "..." button
then browse through to find the HEX file from the project I just built.
I click "program".


Under "Fuses",  BODLEVEL=> DISABLED
And the following have checkmarks by them:
SPIEN, CKDIV8,
SUT_CKSEL is set to "INTRCOSC_128KHZ_14CK_4MS

I click "Program" everything says "OK"
Starting operation write registers
Writing register HIGH...OK
Writign register LOW...OK
Write registers...OK
Starting operation verify registers
Verify register HIGH...OK
verify register LOW...OK
verify regisers...OK

I close the "Device Programming" gui,
I unplug the USB cable from teh AVR Dragon,
I remove the chip from the ZIF and
plug it into a breadboard.

The breadboard schematic has +5v to pin8,
ground to pin4, a pullup resistor on pin1 (reset),
and an LED attached to pin 1.

THe LED blinks about 3 times a second.





-- 





More information about the Hardwarehacking mailing list