Go Down

Topic: Arduino translated to AVR? (Read 12 times) previous topic - next topic

Coding Badly

Uploaded successful!


Argh!  Stupid brain!  What I read was that you successfully uploaded to the ATtiny85.  Sorry about the confusion.  Give me a minute to review...

Coding Badly


Try this...

• Prepare the Uno exactly the same way you did the last time (upload the modified ArduinoISP sketch; connect the capacitor)

• Load and prepare the same Blink sketch you have been using (or copy-then-paste the following)...

Code: [Select]

/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.

  This example code is in the public domain.
*/

void setup() {               
  // initialize the digital pin as an output.
  // Pin 13 has an LED connected on most Arduino boards:
  pinMode(0, OUTPUT);     
}

void loop() {
  digitalWrite(0, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(0, LOW);    // set the LED off
  delay(1000);              // wait for a second
}


• Ensure the correct board is selected [ATtiny85 @ 8 MHz (internal oscillator; BOD disabled)]

• Ensure the correct programmer is selected (Arduino as ISP)

• Ensure the correct serial port is selected

• Click Verify to ensure the sketch compiles.  If it does not compile, resolve any problems.

• Click the reset button on the Uno.  The LED on pin 13 will blink a few times.  Wait for the blinking to stop.

• Click Upload


If that works, do this...

• Click the reset button on the Uno.  The LED on pin 13 will blink a few times.  Wait for the blinking to stop.

• Click Tools / Burn Bootloader


If that works, do this...

• Click the reset button on the Uno.  The LED on pin 13 will blink a few times.  Wait for the blinking to stop.

• Click Upload


At this point, if everything went well, the ATtiny85 should be toggling pin 0 about once a second.

Erni

#37
Jun 11, 2012, 01:20 pm Last Edit: Jun 11, 2012, 01:50 pm by Erni Reason: 1
I have tried the modified sketch in reply #30 but I get this error when I try to burn bootloader or upload blink sketch,
and the Error Led pin8 is on

Code: [Select]

avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
        Copyright (c) 2007-2009 Joerg Wunsch

        System wide configuration file is "D:\Arduino_1_0\arduino-1.0-windows\arduino-1.0\hardware/tools/avr/etc/avrdude.conf"

        Using Port                    : \\.\COM20
        Using Programmer              : stk500v1
        Overriding Baud Rate          : 19200
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Recv: . [15]
avrdude: stk500_getsync(): not in sync: resp=0x15

avrdude done.  Thank you.



I have tried to lower the Baud rate to 19200 (as far as I remember this was an advice given in another thread)


To veryfy that my setup and connections are OK, I tried the exact same setup in version 0021, with success, burning bootloader, uploading blink sketch worked as expected.

I have checked the boards.txt in the ver. 1.0 installation, it looks like this:

Code: [Select]

###########################################################################

attiny85at8.name=ATtiny85 @ 8 MHz  (internal oscillator; BOD disabled)

# The following do NOT work...
# attiny85at8.upload.using=avrispv2
# attiny85at8.upload.using=Pololu USB AVR Programmer

# The following DO work (pick one)...
attiny85at8.upload.using=arduino:arduinoisp
# attiny85at8.upload.protocol=avrispv2
# attiny85at8.upload.using=pololu
#attiny85at8.upload.using=arduino:usbasp

attiny85at8.upload.maximum_size=8192

# Default clock (slowly rising power; long delay to clock; 8 MHz internal)
# Int. RC Osc. 8 MHz; Start-up time PWRDWN/RESET: 6 CK/14 CK + 64 ms; [CKSEL=0010 SUT=10]; default value
# Brown-out detection disabled; [BODLEVEL=111]
# Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]

attiny85at8.bootloader.low_fuses=0xE2
attiny85at8.bootloader.high_fuses=0xD7
attiny85at8.bootloader.extended_fuses=0xFF
attiny85at8.bootloader.path=empty
attiny85at8.bootloader.file=empty85at8.hex

attiny85at8.build.mcu=attiny85
attiny85at8.build.f_cpu=8000000L
attiny85at8.build.core=tiny

###########################################################################

attiny85at1.name=ATtiny85 @ 1 MHz  (internal oscillator; BOD disabled)

# The following do NOT work...
# attiny85at1.upload.using=avrispv2
# attiny85at1.upload.using=Pololu USB AVR Programmer

# The following DO work (pick one)...
attiny85at1.upload.using=arduino:arduinoisp
# attiny85at1.upload.protocol=avrispv2
# attiny85at1.upload.using=pololu

attiny85at1.upload.maximum_size=8192

# Default clock (slowly rising power; long delay to clock; 8 MHz internal; divide clock by 8)
# Int. RC Osc. 8 MHz; Start-up time PWRDWN/RESET: 6 CK/14 CK + 64 ms; [CKSEL=0010 SUT=10]; default value
# Divide clock by 8 internally; [CKDIV8=0]
# Brown-out detection disabled; [BODLEVEL=111]
# Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]

attiny85at1.bootloader.low_fuses=0x62
attiny85at1.bootloader.high_fuses=0xD7
attiny85at1.bootloader.extended_fuses=0xFF
attiny85at1.bootloader.path=empty
attiny85at1.bootloader.file=empty85at1.hex

attiny85at1.build.mcu=attiny85
attiny85at1.build.f_cpu=1000000L
attiny85at1.build.core=tiny

###########################################################################


Edit:
This is the thread about lowering the baud rate
http://arduino.cc/forum/index.php/topic,94609.0.html

and this about changing the delay in the heartbeat
http://arduino.cc/forum/index.php/topic,108270.msg813132.html#msg813132

but as far as I can see this is implimentet in the modified sketch

Drc3p0



If that works, do this...

• Click the reset button on the Uno.  The LED on pin 13 will blink a few times.  Wait for the blinking to stop.

• Click Tools / Burn Bootloader

I went through the steps as indicated, and when I tried to burn the boot loader, I received an error message, which was the same error message that I had posted previously, and it also happens to be the same as the error message that Erni posted. 

Coding Badly


Does this version work any better?

Go Up