Go Down

Topic: Arduino Tiny (Read 64 times) previous topic - next topic

MGeo

#15
Apr 30, 2011, 06:05 pm Last Edit: Jun 02, 2012, 04:30 pm by MGeo Reason: 1
Hello,

I'm working to get Arduino-Tiny up and running on an ATtiny85.  I think I have gotten as far as Burning the Bootload configuration to the ATtiny85 but am now stuck trying to upload my first sketch.  After the patch to AVRDUDE.CONF (see http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1274820597/90 reply #99, noting that reply #8 of this thread did not work for me either), I can successfully burn the bootloader config to the ATTiny85 (I think) with a "Done Burning Bootloader" in the IDE.  I am getting errors when I try to upload my first sketch.  I can compile my little blink.pde sketch, but when I upload, the errors I get in the IDE are:

Binary sketch size: 694 bytes (of a 8192 byte maximum)
java.lang.NullPointerException
   at processing.app.debug.AvrdudeUploader.getProgrammerCommands(Unknown Source)
   at processing.app.debug.AvrdudeUploader.uploadUsingPreferences(Unknown Source)
   at processing.app.Sketch.upload(Unknown Source)
   at processing.app.Sketch.exportApplet(Unknown Source)
   at processing.app.Sketch.exportApplet(Unknown Source)
   at processing.app.Editor$DefaultExportHandler.run(Unknown Source)
   at java.lang.Thread.run(Thread.java:619)

I am hoping someone here can help me out.

Thanks,
George

Extra Background
My setup is Arduino-0021 on an Windows XP laptop.  I am trying to copy Coding Badly setup exactly so I am using a Pololu USB AVR programmer, which I like so far.  The configuration utility for this programmer (pgm03a_config.exe) runs and reports back the programmer serial number, and I get a ready to program status (flashing yellow led) when I have the target board hooked up and powered up so I think the hardware is all working.  Programmer shows up fine at COM5, with the optional TTL serial port showing on COM6 in the windows hardware device manager window.  My target board has an ATtiny85 installed, with no external crystal/resonator.  I wish to use the internal oscillator to clock the ATtiny85 at either 1 or 8 MHz.  The board has an LED hooked up to pin 2 of the ATTiny85.

MGeo

Additional background #1:

C:\Program Files\arduino-0021\hardware\arduino\programmers.txt contents
Code: [Select]
avrisp.name=AVR ISP
avrisp.communication=serial
avrisp.protocol=stk500v1

avrispmkii.name=AVRISP mkII
avrispmkii.communication=usb
avrispmkii.protocol=stk500v2

usbtinyisp.name=USBtinyISP
usbtinyisp.protocol=usbtiny

parallel.name=Parallel Programmer
parallel.protocol=dapa
parallel.force=true
# parallel.delay=200

arduinoisp.name=Arduino as ISP
arduinoisp.communication=serial
arduinoisp.protocol=stk500v1
arduinoisp.speed=19200

pololu.name=Pololu USB AVR Programmer
pololu.communication=seria
pololu.protocol=avrispv2


MGeo

Additional Background #2:

excerpt from C:\Documents and Settings\gsmall\My Documents\Arduino\hardware\tiny\boards.txt
Code: [Select]

###########################################################################
#
# Example boards.txt from...
#
# http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1236434254/94#94
# http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1274754985/6#6
# http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1274820597/49#49
#
###########################################################################

attiny85at16.name=ATtiny85 @ 16 MHz  (external crystal; 4.3 V BOD)

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

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

attiny85at16.upload.maximum_size=8192

# Ext. Crystal Osc.; Frequency 8.0- MHz; Start-up time PWRDWN/RESET: 16K CK/14 CK + 65 ms; [CKSEL=1111 SUT=11]
# Brown-out detection level at VCC=4.3 V; [BODLEVEL=100]
# Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]
# Serial program downloading (SPI) enabled; [SPIEN=0]

attiny85at16.bootloader.low_fuses=0xFF
attiny85at16.bootloader.high_fuses=0xD4
attiny85at16.bootloader.extended_fuses=0xFF
attiny85at16.bootloader.path=empty
attiny85at16.bootloader.file=empty85at16.hex

attiny85at16.bootloader.unlock_bits=0xFF
attiny85at16.bootloader.lock_bits=0xFF

attiny85at16.build.mcu=attiny85
attiny85at16.build.f_cpu=16000000L
attiny85at16.build.core=tiny

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

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.protocol=avrispv2
# attiny85at8.upload.using=arduino:arduinoisp
attiny85at8.upload.using=pololu

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.bootloader.unlock_bits=0xFF
attiny85at8.bootloader.lock_bits=0xFF

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.protocol=avrispv2
# attiny85at1.upload.using=arduino:arduinoisp
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.bootloader.unlock_bits=0xFF
attiny85at1.bootloader.lock_bits=0xFF

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

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

attiny45at8.name=ATtiny45 @ 8 MHz

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

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

attiny45at8.upload.maximum_size=4096

# 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]

attiny45at8.bootloader.low_fuses=0xE2
attiny45at8.bootloader.high_fuses=0xD7
attiny45at8.bootloader.extended_fuses=0xFF
attiny45at8.bootloader.path=empty
attiny45at8.bootloader.file=empty45at8.hex

attiny45at8.bootloader.unlock_bits=0xFF
attiny45at8.bootloader.lock_bits=0xFF

attiny45at8.build.mcu=attiny45
attiny45at8.build.f_cpu=8000000L
attiny45at8.build.core=tiny

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

attiny45at1.name=ATtiny45 @ 1 MHz

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

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

attiny45at1.upload.maximum_size=4096

# 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]

attiny45at1.bootloader.low_fuses=0x62
attiny45at1.bootloader.high_fuses=0xD7
attiny45at1.bootloader.extended_fuses=0xFF
attiny45at1.bootloader.path=empty
attiny45at1.bootloader.file=empty45at1.hex

attiny45at1.bootloader.unlock_bits=0xFF
attiny45at1.bootloader.lock_bits=0xFF

attiny45at1.build.mcu=attiny45
attiny45at1.build.f_cpu=1000000L
attiny45at1.build.core=tiny


Coding Badly


The entry in programmers.txt is missing a letter...

pololu.name=Pololu USB AVR Programmer
pololu.communication=serial
pololu.protocol=avrispv2

Coding Badly


In the "boards.txt" file, change the "upload.using" entries for the ATtiny85 processor to these...

attiny85at16.upload.using=arduino:pololu

attiny85at8.upload.using=arduino:pololu

attiny85at1.upload.using=arduino:pololu


Please let me know if you do or do not get it working.  Thanks.

Go Up