Go Down

Topic: core13: An Arduino core for the Attiny13 *testers wanted* (Read 154919 times) previous topic - next topic

grigorym

Try Arduino ISP with boot-time selectable slow SPI
Tried already, no luck. Both burning bootloader and trying to upload says: "avrdude: Device signature = 0x000000 avrdude: Yikes!  Invalid device signature."

common_ground

#331
Mar 27, 2015, 07:25 pm Last Edit: Mar 27, 2015, 08:45 pm by common_ground
OK, i find solution for Arduino as ISP and ATTINY13 on 128 KHz :

open in some text editor:
Quote
sketchbook\hardware\tiny13\avr\boards.txt
Close IDE and change Attiny13 @ 128 KHz section with this :

Code: [Select]
attiny13.name=Attiny13 @ 128 KHz (internal watchdog oscillator)
attiny13.upload.tool=arduino:avrdude
attiny13.upload.using=arduino:arduinoisp
attiny13.upload.maximum_size=1024
attiny13.upload.maximum_data_size=64
attiny13.upload.speed=250

attiny13.bootloader.tool=arduino:avrdude
attiny13.bootloader.low_fuses=0x7B
attiny13.bootloader.high_fuses=0xFF

attiny13.build.mcu=attiny13
attiny13.build.f_cpu=128000
attiny13.build.core=core13


download zipped Arduino_slow_ISP sketch, then start IDE ( i tried on 1.6.1 only ) and install sketch on your arduino programmer ( i tried on breadboard atmega328 on 8MHz ) connect attiny13 as you usual do
and this version of - Arduino_slow_ISP sketch - is sufficiently slow to burn 128KHz fuse and upload sketch, and also change to other fuses as well, I just tried all options.

grigorym

OK, i find solution for Arduino as ISP and ATTINY13 on 128 KHz :
No change. I think it's time to try something new. Tomorrow I'll take another attiny13 to replace the current one and see if it is going to programmed, just in case I screwed something with schematic or managed to shortcut my poor attiny :). I will also try to find an AVR-fan-neighbor to borrow an external programmer.

common_ground

No change. I think it's time to try something new. Tomorrow I'll take another attiny13 to replace the current one and see if it is going to programmed, just in case I screwed something with schematic or managed to shortcut my poor attiny :). I will also try to find an AVR-fan-neighbor to borrow an external programmer.
Only if you damage attiny13.Try with new one.

I just lock one ATTiny13 with standard ArduinoISP and unlock with Arduino_slow_ISP , work 100%. That makes using Arduino as excellent ISP programmer of choice.
I'll make one to be permanent, no need to buy anything else.

smeezekitty

I program them at 128K all the time. I modified the Ardunio ISP program to run at a very low SPI rate
and it works with no problems. Make sure your wire connections are good.
Avoid throwing electronics out as you or someone else might need them for parts or use.
Solid state rectifiers are the only REAL rectifiers.
Resistors for LEDS!

grigorym

I program them at 128K all the time. I modified the Ardunio ISP program to run at a very low SPI rate
and it works with no problems. Make sure your wire connections are good.
I was planning to disappear silently, but bad conscience brought me back to report my stupidity. Common_ground, I was trying to recover with your slow ISP not the attiny13, but the 555 timer chip :)). Surprisingly, it refused to be programmed :). @@@@!

So, reporting. Slow version of Arduino ISP successfully sets the fuses back and programs the chip. After that I was able to switch back to ordinary Arduino ISP. I went the whole process once again: programming with ordinary Arduino ISP the fuses for 128KHz, loosing control of the chip, uploading slow version of Arduino ISP and reprogramming the fuses and the sketch back.

Thank you very much for your assistance and patience. I'll mention the solution on a couple of places, where beginners like me stumbled upon 128KHz option.

common_ground

#336
Mar 30, 2015, 02:08 am Last Edit: Mar 30, 2015, 03:16 am by common_ground
As for USBTinyISP programmers, we do not have to change default_bitclock only in avrdude.conf, but we can change the parameters directly from the IDE environment (at least from 1.6.1), without changing avrdude.conf.

Open arduino-1.6.1\hardware\arduino\avr\programmers.txt in some text editor and change usbtiny section with this :

Code: [Select]

usbtinyisp.name=USBtinyISP -B10 (Default)
usbtinyisp.protocol=usbtiny
usbtinyisp.program.tool=avrdude
usbtinyisp.program.extra_params=

############ > 4.8 MHz ##################

usbtinyisp_2.name=USBtinyISP -B2 (> 4.8 MHz)
usbtinyisp_2.protocol=usbtiny
usbtinyisp_2.program.tool=avrdude
usbtinyisp_2.program.speed=2
usbtinyisp_2.program.extra_params=-B{program.speed}

############ < 4.8 MHz ##################

usbtinyisp_4.name=USBtinyISP -B4 (> 0.6 <= 4.8 MHz)
usbtinyisp_4.protocol=usbtiny
usbtinyisp_4.program.tool=avrdude
usbtinyisp_4.program.speed=4
usbtinyisp_4.program.extra_params=-B{program.speed}

############ 128 KHz ##################

usbtinyisp_50.name=USBtinyISP -B50 (= 128 KHz)
usbtinyisp_50.protocol=usbtiny
usbtinyisp_50.program.tool=avrdude
usbtinyisp_50.program.speed=50
usbtinyisp_50.program.extra_params=-B{program.speed}

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


restart IDE and we have USBTinyISP options for diferrent bitclocks :



I just try some values and this is empirical result ( no upload error ) i get.

2us for > 4.8 MHz
4us for > 0.6 <= 4.8 MHz
10us - default settings for => 0.6 MHz
50us - for 128 KHz

Because i use often usbtiny for ATTINY85 too, upload speed improving the lot, for example :

Code: [Select]

avrdude: Using SCK period of 10 usec
avrdude: writing flash (8070 bytes):
Writing | ######################################### | 100% 21.05s
Reading | ########################################  | 100% 24.73s

avrdude: Setting SCK period to 2 usec
avrdude: writing flash (8070 bytes):
Writing | ######################################### | 100% 7.33s
Reading | ########################################  | 100% 8.19s


instead of 46 seconds I get the upload for 16 seconds for 8 Kb .hex file on 8 MHz attiny85.

smeezekitty

#337
Mar 30, 2015, 03:49 am Last Edit: Mar 30, 2015, 03:49 am by smeezekitty
With only 1K of memory, upload time isn't a big deal.
Avoid throwing electronics out as you or someone else might need them for parts or use.
Solid state rectifiers are the only REAL rectifiers.
Resistors for LEDS!

Ed1960

1.2K is a lot of bytes for a blink! The code must be not well optimized or sometin'  . You can do plenty of useful things with 1K of command space. For example, here is a code for a 10-LED light chaser (can convert it into Cylon eyes  or some other such blinking toy) and it compiles into only 562 bytes. In fact, there might even be some saving there still, I just didn't have too much time to optimize it.
Code: [Select]


I agree, 1.2k is a lot, i put an entire irrigation system in  some 700 bytes in an attiny13  AND it has a blinking LED :-)

gneil90


Marzogh

Can anyone share with their boards.txt file?
There are quite a few floating around the internet. Here's one I've made up. It works as of today on Arduino 1.6.3.

Code: [Select]

menu.cpu=Processor
menu.clock=Clock

attiny.name=ATtiny
attiny.bootloader.tool=arduino:avrdude
attiny.bootloader.unlock_bits=0xFF
attiny.bootloader.lock_bits=0xFF
attiny.build.core=arduino:arduino
attiny.build.board=attiny
attiny.upload.tool=arduino:avrdude
 
attiny.menu.cpu.attiny45=ATtiny45
attiny.menu.cpu.attiny45.upload.maximum_size=4096
attiny.menu.cpu.attiny45.build.mcu=attiny45
attiny.menu.cpu.attiny45.build.variant=tiny8

###############################################################
 
attiny.menu.cpu.attiny85=ATtiny85
attiny.menu.cpu.attiny85.upload.maximum_size=8192
attiny.menu.cpu.attiny85.build.mcu=attiny85
attiny.menu.cpu.attiny85.build.variant=tiny8

###############################################################
 
attiny.menu.cpu.attiny44=ATtiny44
attiny.menu.cpu.attiny44.upload.maximum_size=4096
attiny.menu.cpu.attiny44.build.mcu=attiny44
attiny.menu.cpu.attiny44.build.variant=tiny14

###############################################################
 
attiny.menu.cpu.attiny84=ATtiny84
attiny.menu.cpu.attiny84.upload.maximum_size=8192
attiny.menu.cpu.attiny84.build.mcu=attiny84
attiny.menu.cpu.attiny84.build.variant=tiny14

###############################################################
 
attiny.menu.clock.internal1=1 MHz (internal)
attiny.menu.clock.internal1.bootloader.low_fuses=0x62
attiny.menu.clock.internal1.bootloader.high_fuses=0xDF
attiny.menu.clock.internal1.bootloader.extended_fuses=0xFF
attiny.menu.clock.internal1.build.f_cpu=1000000L

###############################################################
 
attiny.menu.clock.internal8=8 MHz (internal)
attiny.menu.clock.internal8.bootloader.low_fuses=0xE2
attiny.menu.clock.internal8.bootloader.high_fuses=0xDF
attiny.menu.clock.internal8.bootloader.extended_fuses=0xFF
attiny.menu.clock.internal8.build.f_cpu=8000000L

###############################################################
 
attiny.menu.clock.external8=8 MHz (external)
attiny.menu.clock.external8.bootloader.low_fuses=0xFE
attiny.menu.clock.external8.bootloader.high_fuses=0xDF
attiny.menu.clock.external8.bootloader.extended_fuses=0xFF
attiny.menu.clock.external8.build.f_cpu=8000000L

###############################################################
 
attiny.menu.clock.external16=16 MHz (external)
attiny.menu.clock.external16.bootloader.low_fuses=0xFE
attiny.menu.clock.external16.bootloader.high_fuses=0xDF
attiny.menu.clock.external16.bootloader.extended_fuses=0xFF
attiny.menu.clock.external16.build.f_cpu=16000000L

###############################################################
 
attiny.menu.clock.external20=20 MHz (external)
attiny.menu.clock.external20.bootloader.low_fuses=0xFE
attiny.menu.clock.external20.bootloader.high_fuses=0xDF
attiny.menu.clock.external20.bootloader.extended_fuses=0xFF
attiny.menu.clock.external20.build.f_cpu=20000000L

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

attiny13.name=ATtiny13
attiny13.bootloader.tool=arduino:avrdude
attiny13.bootloader.unlock_bits=0xFF
attiny13.bootloader.lock_bits=0xFF
attiny13.build.core=arduino:arduino
attiny13.build.board=attiny
attiny13.upload.tool=arduino:avrdude
attiny13.upload.using=arduino:arduinoisp
attiny13.build.mcu=attiny13

attiny13.menu.cpu.attiny13=ATtiny13
attiny13.menu.cpu.attiny13.upload.maximum_size=1024
attiny13.menu.cpu.attiny13.build.mcu=attiny13
attiny13.menu.cpu.attiny13.build.variant=core13

#################################################
attiny13.menu.clock.internal128=128KHz (internal)
attiny13.menu.clock.internal128.bootloader.low_fuses=0x7B
attiny13.menu.clock.internal128.bootloader.high_fuses=0xFF
attiny13.menu.clock.internal128.bootloader.extended_fuses=0xFF
attiny13.menu.clock.internal128.build.f_cpu=128000L

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

attiny13.menu.clock.internal600=600KHz (internal)
attiny13.menu.clock.internal600.bootloader.low_fuses=0x69
attiny13.menu.clock.internal600.bootloader.high_fuses=0xFF
attiny13.menu.clock.internal600.bootloader.extended_fuses=0xFF
attiny13.menu.clock.internal600.build.f_cpu=600000L

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

attiny13.menu.clock.internal12=1.2MHz (internal)
attiny13.menu.clock.internal12.bootloader.low_fuses=0x6A
attiny13.menu.clock.internal12.bootloader.high_fuses=0xFF
attiny13.menu.clock.internal12.bootloader.extended_fuses=0xFF
attiny13.menu.clock.internal12.build.f_cpu=1200000L

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


attiny13.menu.clock.internal48=4.8MHz (internal)
attiny13.menu.clock.internal48.bootloader.low_fuses=0x79
attiny13.menu.clock.internal48.bootloader.high_fuses=0xFF
attiny13.menu.clock.internal48.bootloader.extended_fuses=0xFF
attiny13.menu.clock.internal48.build.f_cpu=4800000L

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

attiny13.menu.clock.internal96=9.6MHz (internal)
attiny13.menu.clock.internal96.bootloader.low_fuses=0x7A
attiny13.menu.clock.internal96.bootloader.high_fuses=0xFF
attiny13.menu.clock.internal96.bootloader.extended_fuses=0xFF
attiny13.menu.clock.internal96.build.f_cpu=9600000L

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

mcnobby

Hi all, I am about to start some t13 work again, is everything stable for me to use the cores with 1.6.3 ?
have there been any t13 core updates in the last 6 months or so ?

Its a big ole thread now isnt it !!

:)
http://www.youtube.com/user/Recovered
http://www.smartshow.lighting

smeezekitty

Hi all, I am about to start some t13 work again, is everything stable for me to use the cores with 1.6.3 ?
have there been any t13 core updates in the last 6 months or so ?

Its a big ole thread now isnt it !!

:)
The last update was in January. I have no idea about 1.6.x. I am  always slow to upgrade Arduino
versions since they always seem to bork something lately.
Avoid throwing electronics out as you or someone else might need them for parts or use.
Solid state rectifiers are the only REAL rectifiers.
Resistors for LEDS!

mcnobby

Cheers Smeezekitty, I shall tentatively give it a go :)
http://www.youtube.com/user/Recovered
http://www.smartshow.lighting

common_ground

#344
May 16, 2015, 02:10 pm Last Edit: May 16, 2015, 03:10 pm by common_ground
Since there is a difference between version 1.6.3 and 1.6.4 in relation to the earlier 1.6.x versions, i decided to make the installation file for 1.6.4 (1.6.3) version only.
Just unpack file in ...\sketchbook\hardware folder.

Boards included :



I added some GCC Flags ( can be used from IDE menu - choose default if you do not like to use extra optimisation flags ) :



And i added millis() , micros(),  delayMicroseconds() and set ADC clock for 16 KHz ( it is not set for 16 kHz originally )

If you use 128 KHz - default_bitclock must be slow down to -B50 and for 16 KHz to -B250 ( USBTinyISP)

Go Up