core13: An Arduino core for the Attiny13 *testers wanted*

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 !!

:)

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 !!

:)

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.

Cheers Smeezekitty, I shall tentatively give it a go :)

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)

tiny13_for_1.6.4.zip (46.2 KB)

common_ground: I add attiny13 install file for 1.6.4 IDE : ATTiny13 for 1.6.4

Since the pins_arduino.h is blank, does someone know the exact pin configuration for the Attiny13? I added a dummy below :)

// ATMEL ATTINY13 - ARDUINO
//
//                  +-\/-+
// AinX (D X) PB5  1|    |8  Vcc
// AinX (D X) PB3  2|    |7  PB2 (D X)  AinX
// AinX (D X) PB4  3|    |6  PB1 (D X) PWM
//            GND  4|    |5  PB0 (D X) PWM
//                  +----+

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)

Thanks for that brilliant setup!
One thing that is not really streamlined is the categories. I changed that. So now it is ATtiny13 with all the clock speed and all compiler options (only listed once for all speeds of course). Only 9.6MHz tested.

boards.txt (4.26 KB)

Yes, excellent solution, Thanks nicnac.

hansibull: Since the pins_arduino.h is blank, does someone know the exact pin configuration for the Attiny13? I added a dummy below :)

// ATMEL ATTINY13 - ARDUINO
//
//                  +-\/-+
// AinX (D X) PB5  1|    |8  Vcc
// AinX (D X) PB3  2|    |7  PB2 (D X)  AinX
// AinX (D X) PB4  3|    |6  PB1 (D X) PWM
//            GND  4|    |5  PB0 (D X) PWM
//                  +----+

The pins are internally converted hence no need for pins_arduino. If you don't mind, I can add this to the next release for reference purposes. After I check it for accuracy at least

smeezekitty: The pins are internally converted hence no need for pins_arduino. If you don't mind, I can add this to the next release for reference purposes. After I check it for accuracy at least

Yes, please add the pinout to the next core13 version :) Buy why have you just uploaded the core files, and not a complete set of folders, including boards.txt? The setup would be much simpler if you wouldn't need to dig through the whole forum post to find the correct files :)

hansibull: Buy why have you just uploaded the core files, and not a complete set of folders, including boards.txt? The setup would be much simpler if you wouldn't need to dig through the whole forum post to find the correct files :)

Because it is a royal pain in the BUTT to work with the *.txt that Arduino uses. When I wrote it, I couldn't figure it out myself. I kind of have it figured now but there are already working boards.txt out there.

Please help me out. I was expecting neoPixel lib to be able to handle 9.6MHz but looks like its not.

The neopixel code is unportable (it calls internal core functions rather than just the external ones) It would need to be rewritten.

Thanks for the reply. WS2812 based need 800Khz to work. ATtiny13A has internal source for 4.8 & 9.6Mhz. Is it possible to get 800Khz out of tiny13a without external clock source? is it possible to do sort of bit-banging to get the neopixel working? Any suggestion how?

There is a non-arduino avr-gcc library for ws2812b out there. It works fine on t13.

https://github.com/cpldcpu/light_ws2812

I doubt you'd be able to shoehorn any arduino worldsemi library onto a t13.

Thanks, I am using the same library as you pointed. But the pixel are just shining once when they get the power and than go blank. That is why I was trying to use neoPixel library. I'l do some tests and check it once again.

I've run a strip of 10 off of a t13 without any problem with the light_ws2812 library. Are you sure you aren't having power problems?

Thanks, Power was not an issue. But the sample blinky program from ws2812 library is working now, I don’t really know the cause why it was not working. What I did is, I just replaced the light_2812 library with the one you suggested and uploaded the program to tiny13A. Thanks.

Here is the program with a push button connected to PB3, WS2812 to PB4. A fixed set of 8 color matrix will cycle with each push of the button.

ws2812_button.zip (3.36 KB)

Hi All, Has anyone tried using an IR receiver with attiny13?? I am planning to hook up an IR sensor to attiny13 so that I can choose/control the color of the ws2812 RGB LED through a remote. if you have any code/diagram then it will really help.

The code need to be really small to fit in 1KB.

Have been using the attiny13 core for some time with much pleasure. However, the core already uses the TIM0_OVF_vect, therefore making it impossible to use it for own applications

I added 8, 16 and 20 MHz for arduino ide 1.6.5 they are not very well tested (tested on attiny13a-pu 8MHz, by chip number it should be 20 MHz but delay(1000) says it is ~8 MHz), so be aware that it could not work on your attiny13a or worse… And 20 MHz micros will not work as expected, you can fix it by editing wiring.c line 102 for 20000000 Hz. Instalation is thesame, put folder “tiny13” from zip to Documents\Arduino\hardware folder.

tiny13_2015_07_01.zip (46.9 KB)

Ed1960: Have been using the attiny13 core for some time with much pleasure. However, the core already uses the TIM0_OVF_vect, therefore making it impossible to use it for own applications

There is only one timer in the t13. I don't know what else can be done.

I added 8, 16 and 20 MHz for arduino ide 1.6.5 they are not very well tested (tested on attiny13a-pu 8MHz, by chip number it should be 20 MHz but delay(1000) says it is ~8 MHz), so be aware that it could not work on your attiny13a or worse... And 20 MHz micros will not work as expected, you can fix it by editing wiring.c line 102 for 20000000 Hz. Instalation is thesame, put folder "tiny13" from zip to Documents\Arduino\hardware folder.

Sorry. I don't understand. Are you using an external clock gen? The Attiny13 do not support 8 or 20MHz on the internal clock.

Version 0.21 released

-Edit- It still isn't 1.6 compliant. I'll try fix that next release.