Go Down

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

hansibull

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 :)

Code: [Select]

// 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
//                  +----+


nicnac

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.


common_ground


smeezekitty

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

Code: [Select]

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

sudhirkhamari

Hi,
It has been a long time since I finished RGB LED+attiny13A with 2 push button project. But the color mixing is not cool in lens type RGB led. So I moved on to ws2812b based rgb led.
- Using Arduino 1.6.4 IDE
- Using following neoPixel library
   name=Adafruit NeoPixel
   version=1.0
   sentence=Arduino library for controlling single-wire-based LED pixels and strip.
   url=https://github.com/adafruit/Adafruit_NeoPixel
   architectures=*
   ...
- Tried following fuse entries in the board.txt file:
  attiny13at9m.name=ATtiny13 @ 9.6MHz (internal 9.6 MHz clock, Preserve EEPROM, BOD disable)
  attiny13at9m.bootloader.low_fuses=0x3A
  attiny13at9m.bootloader.high_fuses=0xff
  attiny13at9m.build.f_cpu=9600000

  attiny13at9m_bod.name=ATtiny13 @ 9.6MHz (internal 9.6 MHz clock, Preserve EEPROM, BOD - 2.7V )
  attiny13at9m_bod.bootloader.low_fuses=0x32
  attiny13at9m_bod.bootloader.high_fuses=0xFB
  attiny13at9m_bod.build.f_cpu=9600000

- But when I am compiling the strandtest example program that comes with neoPixel lib, it is giving following error:
Arduino\hardware\tools\avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -MMD -mmcu=attiny13 -DF_CPU=9600000L -DARDUINO=10604 -DARDUINO_AVR_ATTINY13E -DARDUINO_ARCH_AVR -IC:\Users\Arduino\hardware\tiny13\avr\cores\core13 -IC:\Users\Arduino\libraries\Adafruit_NeoPixel C:\Users\AppData\Local\Temp\build3281982935297401321.tmp\strandtest.cpp -o C:\Users\AppData\Local\Temp\build3281982935297401321.tmp\strandtest.cpp.o

strandtest.ino: In function 'void theaterChase(uint32_t, uint8_t)':
strandtest.ino:85:41: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
strandtest.ino:92:41: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
strandtest.ino: In function 'void theaterChaseRainbow(uint8_t)':
strandtest.ino:103:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
strandtest.ino:110:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
C:\Users\Arduino\hardware\tools\avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -MMD -mmcu=attiny13 -DF_CPU=9600000L -DARDUINO=10604 -DARDUINO_AVR_ATTINY13E -DARDUINO_ARCH_AVR -IC:\Users\Arduino\hardware\tiny13\avr\cores\core13 -IC:\Users\Arduino\libraries\Adafruit_NeoPixel -IC:\Users\Arduino\libraries\Adafruit_NeoPixel\utility C:\Users\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp -o C:\Users\AppData\Local\Temp\build3281982935297401321.tmp\Adafruit NeoPixel\Adafruit_NeoPixel.cpp.o

C:\Users\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:675:3: error: #error "CPU SPEED NOT SUPPORTED"
  #error "CPU SPEED NOT SUPPORTED"
   ^
C:\Users\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp: In constructor 'Adafruit_NeoPixel::Adafruit_NeoPixel(uint16_t, uint8_t, uint8_t)':
C:\Users\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:40:46: error: 'digitalPinToPort' was not declared in this scope
   ,port(portOutputRegister(digitalPinToPort(p))),
                                              ^
C:\Users\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:40:47: error: 'portOutputRegister' was not declared in this scope
   ,port(portOutputRegister(digitalPinToPort(p))),
                                               ^
C:\Users\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:41:33: error: 'digitalPinToBitMask' was not declared in this scope
    pinMask(digitalPinToBitMask(p))
                                 ^
C:\Users\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp: In member function 'void Adafruit_NeoPixel::show()':
C:\Users\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:103:5: warning: unused variable 'i' [-Wunused-variable]
     i   = numBytes; // Loop counter
     ^
C:\Users\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:106:5: warning: unused variable 'b' [-Wunused-variable]
     b   = *ptr++,   // Current byte value
     ^
C:\Users\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:107:5: warning: unused variable 'hi' [-Wunused-variable]
     hi,             // PORT w/output bit set high
     ^
C:\Users\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:108:5: warning: unused variable 'lo' [-Wunused-variable]
     lo;             // PORT w/output bit set low
     ^
C:\Users\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp: In member function 'void Adafruit_NeoPixel::setPin(uint8_t)':
C:\Users\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:906:50: error: 'digitalPinToPort' was not declared in this scope
   port    = portOutputRegister(digitalPinToPort(p));
                                                  ^
C:\Users\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:906:51: error: 'portOutputRegister' was not declared in this scope
   port    = portOutputRegister(digitalPinToPort(p));
                                                   ^
C:\Users\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp:907:34: error: 'digitalPinToBitMask' was not declared in this scope
   pinMask = digitalPinToBitMask(p);
                                  ^
Error compiling.

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

hansibull

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 :)

smeezekitty

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.

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

sudhirkhamari

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?

evildave_666

#353
May 19, 2015, 08:56 am Last Edit: May 19, 2015, 09:06 am by evildave_666
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.

sudhirkhamari

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.

evildave_666

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?

sudhirkhamari

#356
May 24, 2015, 07:43 pm Last Edit: May 27, 2015, 10:32 am by sudhirkhamari
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.
https://youtu.be/y-Fuz-sQf5w

sudhirkhamari

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.

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

Go Up