Go Down

Topic: Arduino ISP and ATTiny2313 with external crystal (Read 70 times) previous topic - next topic

DrWolf

I have attiny2313 and arduino mega2560. I need to program mk with external crystal using arduino as isp programmer. I googled a lot but all, that I found, is examples how to program attiny2313 using internal oscillator 1 or 8 MHz.

Also I found fuse calculator and examples how to set fuses in boards.txt but it requires to set bootloader and some other specs and I don't want accidentally lock my attiny2313 with incorrect fuses or incorrect bootloader.

Is it possible to program attiny2313 with external crystal over arduino, or I need to buy external programmer? If yes, what changes I need to do in boards.txt, does it really need bootloader, or probably its possible to flash attiny without it?


dr_watson

Hi,

Attiny chip isnt that exp, I say go for external crystal and try , I have posted my lesson learnt with Atmega8 using both crystal and without it ( its not that reliable without one ).
Share your exp with us , the circuit is not that complicated. Use an old version I did with 0022 and it worked pretty well without having to modify any sorta file.

Thanks

hiduino

#2
Mar 27, 2015, 10:32 am Last Edit: Mar 27, 2015, 10:34 am by hiduino
You can use your mega2560 with ArduinoISP as a programmer.

You can start with this tiny core, https://code.google.com/p/arduino-tiny/

Then update the boards.txt file to add a definition for a 2313 with external crystal, low fuse=0xFF.

For IDE 1.0.x:
Code: [Select]

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

attiny2313at8.name=ATtiny2313 @ 8 MHz External Crystal

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

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

attiny2313at8e.upload.maximum_size=2048

# Default clock (slowly rising power; long delay to clock; 8 MHz internal)
# Ext. Crystal Osc. 8 MHz; Start-up time: 14 CK + 65 ms; [CKSEL=0100 SUT=10]; default value
# Brown-out detection disabled; [BODLEVEL=111]
# Serial program downloading (SPI) enabled; [SPIEN=0]
# Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]

attiny2313at8e.bootloader.low_fuses=0xFF
attiny2313at8e.bootloader.high_fuses=0x9F
attiny2313at8e.bootloader.extended_fuses=0xFF
attiny2313at8e.bootloader.path=empty
attiny2313at8e.bootloader.file=empty2313at8.hex

attiny2313at8e.build.mcu=attiny2313
attiny2313at8e.build.f_cpu=8000000L
attiny2313at8e.build.core=tiny
 


For IDE 1.6.x:
Code: [Select]

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

attiny2313at8e.name=ATtiny2313 @ 8 MHz External Crystal

attiny2313at8e.upload.tool=arduino:arduinoisp
attiny2313at8e.upload.maximum_size=2048
attiny2313at8e.upload.maximum_data_size=128

# Default clock (slowly rising power; long delay to clock; 8 MHz internal)
# Ext. Crystal Osc. 8 MHz; Start-up time: 14 CK + 65 ms; [CKSEL=0100 SUT=10]; default value
# Brown-out detection disabled; [BODLEVEL=111]
# Serial program downloading (SPI) enabled; [SPIEN=0]
# Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]

attiny2313at8e.bootloader.low_fuses=0xFF
attiny2313at8e.bootloader.high_fuses=0x9F
attiny2313at8e.bootloader.extended_fuses=0xFF
attiny2313at8e.bootloader.tool=arduino:avrdude
attiny2313at8e.bootloader.file=empty/empty2313at8.hex

attiny2313at8e.build.mcu=attiny2313
attiny2313at8e.build.f_cpu=8000000L
attiny2313at8e.build.core=tiny


DrWolf

hiduino, thanks, this is just what I'm looking for!

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy