Go Down

Topic: New megaTinyCore for 1-series and 0-series ATtiny (like 1616, 3217, etc) (Read 20131 times) previous topic - next topic

DrAzzy

https://github.com/SpenceKonde/megaTinyCore
Download the core or sync github repo into your (sketchbook)/hardware folder: https://github.com/SpenceKonde/megaTinyCore/archive/v1.0.0_manual.zip.zip

The new megaAVR 1-series and 0-series ATtiny parts bring exciting new features to the ATtiny family. However, until now there has been no support for these parts on the Arduino IDE. This core provides Arduino IDE support for these new parts. This is the initial release, and we expect issues to come up, however, basic functionality is there, with support for the entire ATtiny 1-series and 0-series product line. Please alert us to any issues you encounter with the core.

These parts cannot be programmed via ISP - only via UPDI. An Arduino can be easily made into a UPDI programmer, see: https://github.com/SpenceKonde/megaTinyCore/blob/master/MakeUPDIProgrammer.md

Some of the exciting features:
Flash up to 32k, SRAM up to 2k. 5 to 21 usable I/O pins. Runs from internal oscillator, with sufficient accuracy for UART (no crystal support) - core supports 20MHz, 16MHz, 10MHz, 8MHz, 5MHz, 4MHz and 1MHz. Up to 8 PWM pins, hardware UART, SPI, and I2C peripherals, on-chip DAC (core support coming soon), and more.

See the README and part specific pages for more information, and the relevant datasheet for much more detail.

Supported parts:

24-pin (21 I/O pins)
3217, 1617, 817, 1607, 807
20-pin (17 I/O pins)
3216,1616, 816, 416, 1606, 806, 406
14-pin (11 I/O pins)
1614, 814, 414, 214, 804, 404, 204
8-pin (5 I/O pins)
412,212,402,202

This core requires the Arduino Official megaAVR board package to be installed (the one with Uno WiFi Rev. 2). This is the version for board manager installation.

Try it out, kick the tires, find the bugs we missed, and create github issues and/or post in this thread. Be sure to read the readme, which lists several known issues
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

BJHenry

I saw this maybe a week ago, I've enjoyed watching more and more being added to it. I'm super excited that it is out in public now. Well done.

DrAzzy

It is now available through board manager as well! Same json file as ATTinyCore (see signature)
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

DrAzzy

Exciting news - Version 1.0.1 now available on board manager and for manual installation.

DAC support is now in.

A working Servo library is included (see caveats in documentation)

Timekeeping bugs in 1.0.0 are now fixed (a bug in micros() caused the millis timer to lose counts in 1.0.0).

Many improvements to documentation.

Breakout/development boards are expected to be available in my Tindie store before the end of the month (the designs are already in the hands of my manufacturing partner).

Please try it out and let me know how it works out for you all! These are some really awesome parts, and I hope that more Arduino people will start playing with them. For those of us who are thinking of releasing a product based on Arduino-programmed-AVR's, the megaAVR attiny's are particularly well suited because of their low prices compared to comparable classic AVR parts - even in quantities of 1, the bare parts are available from digikey et. al. for around $1 for the top parts in these product lines!
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

DrAzzy

1.0.2 is now available!

Board manager and manual installs. Board manager no longer requires the official megaAVR board package, too (manual installs do require it, though).

This is mostly a bugfix release; you should install it if you've been playing with this - it fixes a few issues on specific parts, but most notably problems with analogRead() on pins numbered higher than 11.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

G2Li

Hi,

I am trying to program my attiny1617 with arduino uno, I have my uno connected via usb and attiny1617 in PCB connected the resistor and capacitor via dupont wires as mentioned above. I have selected 'arduino as jtag2updi' in 'Programmer option'.

 However when I click upload my sketch comes up with:

avrdude: jtagmkII_initialize(): Cannot locate "flash" and "boot" memories in description


Please help me, any ideas and solutions. Thanks

Lili



DrAzzy

Have you uploaded the jtag2updi sketch to your Uno, and then connected cap between Rst and Gnd?


avrdude: jtagmkII_initialize(): Cannot locate "flash" and "boot" memories in description

always shows up, and seems to be a spurious message - it may be something that *could* be fixed by changes to avrdude.conf, but because programming works, I haven't undertaken to fix it.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

DrAzzy

Also, 1.0.3 is now released - this fixes serial on the 412/402/212/202 parts, and also adds the "tinyNeoPixel" and "tinyNeoPixel_Static" libraries that implement support for WS2812 ("NeoPixels") on megaTinyCore. See the full documentation here https://github.com/SpenceKonde/megaTinyCore/blob/master/megaavr/extras/tinyNeoPixel.md
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

G2Li

It works !!!! 
I tested a  digital pin, I got an output signal form my attiny.  but the information avrdude: jtagmkII_initialize(): Cannot locate "flash" and "boot" memories in description always shows up.


hansibull

Thanks for doing all this. The fact that you've supporting 25 new ATtinys is just incredible!

Do you think you'll be able to merge your changes to the NeoPixel library into the main Adafruit repo?
MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

MiniCore - ATmega8, mega48, mega88, mega168, mega328
Github.com/MCUdude/MiniCore

DrAzzy

Thanks for doing all this. The fact that you've supporting 25 new ATtinys is just incredible!

Do you think you'll be able to merge your changes to the NeoPixel library into the main Adafruit repo?
They would require a bit of modification, since the version that I include is tightly integrated with the core (plan is to include analogous version in ATTinyCore as well), in order to minimize flash usage at speeds below 16MHz. May do this in the future, but it is a low priority, and I have many high priority tasks in my queue.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

gaufowl

I have a question regarding the instructions in your README. I am currently working on a computer that I have to do manual installs on. I have no internet access, but I can get files transferred to the computer. Your README states that the Arduino megaAVR board package must be installed using board manager. I have already successfully manually installed megaTinyCore (I believe). Can I just follow the same process with the megaAVR, or is there something special that the board manager does that I will be unable to do through the manual method? I am working with the 3216, if that matters at all. Apologies if this is a trivial question, I'm inexperienced with micro-controllers.

DrAzzy

A board manager installation will ALSO install the required 7.3.0 version of avr-gcc.

I do not know how to do this manually in a way that the IDE will correctly use.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

DrAzzy

1.0.5 is out, with a few board manager fixes (actually, it's been out for a while).

I discovered something amazing last night!

Because the flash is memory mapped on these parts, YOU NO LONGER HAVE TO MANUALLY DECLARE THINGS PROGMEM NOR USE pgm_read_byte_near().

Anything declared const is not copied to the RAM, yet can be accessed in the same ways as any other variable (except of course that it can't be changed, but that's the case with anything declared const). This includes string literals, so the F() macro is not needed either.

Major win.

I also played around with pin interrupts without using attachInterrupt and wrote a little documentation page: https://github.com/SpenceKonde/megaTinyCore/blob/master/megaavr/extras/PinInterrupts.md
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Kattiny1616

Hey DrAzzy, thank you so much for your help!

I am currently using the attiny1616 and I am trying to read data from the Bosch BMI160, using the Emotibit library (https://github.com/EmotiBit/BMI160-Arduino ). I wanted to ask you if that even works this way or do I have to read and write to the BMI160 through Wire.h. If I just try to use the library as is I get this error message:

Code: [Select]
C:\Users\keyan\Documents\Arduino\libraries\EmotiBit_BMI160\BMI160Gen.cpp: In member function 'int BMI160GenClass::i2c_xfer(uint8_t*, unsigned int, unsigned int)':

C:\Users\keyan\Documents\Arduino\libraries\EmotiBit_BMI160\BMI160Gen.cpp:120:38: error: call of overloaded 'requestFrom(int&, unsigned int&)' is ambiguous

     Wire.requestFrom(i2c_addr, rx_cnt);

                                      ^

In file included from C:\Users\keyan\Documents\Arduino\libraries\EmotiBit_BMI160\BMI160Gen.cpp:3:0:

C:\Users\keyan\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\1.0.5\libraries\Wire\src/Wire.h:63:13: note: candidate: virtual uint8_t TwoWire::requestFrom(uint8_t, size_t)

     uint8_t requestFrom(uint8_t, size_t);

             ^~~~~~~~~~~

C:\Users\keyan\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\1.0.5\libraries\Wire\src/Wire.h:65:13: note: candidate: uint8_t TwoWire::requestFrom(int, int)

     uint8_t requestFrom(int, int);

             ^~~~~~~~~~~

exit status 1
Error compiling for board ATtiny3216/1616/1606/816/806/416/406.


I would really appreciate your help!

Go Up