Skip to content

Releases: SpenceKonde/megaTinyCore

2.0.2 - Major bugs and omissions from 2.0.0 corrected

03 May 04:40
Compare
Choose a tag to compare

This is a surprisingly large release for what is nominally a bugfix release - we are still picking up the pieces from 2.0.0, both in terms of bugs introduced and features that were accidentally omitted.
tinyNeoPixel and tinyNeoPixel_Static are back to being a single library, instead of one per port. There is no menu needed - the parts supported by this core can do ST indirect in a single clock, and hence there is no need for the separate implementations for different ports as is required on classic AVR devices. This also corrects longstanding (but unreported) bug with real WS2812 (but not SK6812) LEDs at 16 and 20MHz, where the LEDs would not behave correctly.
analogReadResolution() is added (I was surprised to find that it wasn't already in). Currently supported options are 8 and 10, see #181 for future plans.
Correct micros() with 1MHz system clock
Correct Wire buffer size - it had been made far too large for these parts in 2.0.0.
Correct issue with Wire compile errors for 20-pin 0-series parts.
Large number of defines relating to identifying part families were incorrect. This has been fixed.

There will be a 2.0.3 later this week to pick up a new toolchain package with the latest atpacks and fixed linker scripts, this will fix the bogus messages when out of space on small-flash parts, and probably some other problems we haven't run into. I'll also try to get eeprom.h fixed as well.

This is the version for manual installation.

2.0.2 - Major bugs and omissions from 2.0.0 corrected

03 May 05:04
Compare
Choose a tag to compare

This is a surprisingly large release for what is nominally a bugfix release - we are still picking up the pieces from 2.0.0, both in terms of bugs introduced and features that were accidentally omitted.
tinyNeoPixel and tinyNeoPixel_Static are back to being a single library, instead of one per port. There is no menu needed - the parts supported by this core can do ST indirect in a single clock, and hence there is no need for the separate implementations for different ports as is required on classic AVR devices. This also corrects longstanding (but unreported) bug with real WS2812 (but not SK6812) LEDs at 16 and 20MHz, where the LEDs would not behave correctly.
analogReadResolution() is added (I was surprised to find that it wasn't already in). Currently supported options are 8 and 10, see #181 for future plans.
Correct micros() with 1MHz system clock
Correct Wire buffer size - it had been made far too large for these parts in 2.0.0.
Correct issue with Wire compile errors for 20-pin 0-series parts.
Large number of defines relating to identifying part families were incorrect. This has been fixed.

There will be a 2.0.3 later this week to pick up a new toolchain package with the latest atpacks and fixed linker scripts, this will fix the bogus messages when out of space on small-flash parts, and probably some other problems we haven't run into. I'll also try to get eeprom.h fixed as well.

This is the version for board manager installation.

2.0.1 - ADC Reference fixes, tinyNeoPixel libraries split by port

17 Apr 04:19
9360f2f
Compare
Choose a tag to compare

In pursuit of the goal of eliminating unnecessary tools submenus (which presented problems for sketch maintenance, because submenu settings are not saved with the sketch), the tinyNeoPixel library is no longer a menu option, instead, there are three copies of the library, one for each port - I realize this will break existing sketches (was intended for 2.0.0), but having the sketch require specific submenu options also broke sketches.

Now the only tools submenus are for things that are used to control fuses (which require burn bootloader to set), the clock speed (which in theory is supposed to, but in reality only requires burn bootloader to switch between 16MHz derived clocks and 20MHz derived ones)), and the millis/micros timer, which has to be a submenu because it controls which ISR is defined for millis timekeeping.

Additionally, several bugs relating to the analog references and the DAC introduced by 2.0.0 and 1.1.10 were turned up in testing - this is now fixed. Note also that the EXTERNAL reference option is not present on as many parts as I thought it was - I only know for certain that it's on the "good" 1-series tinies, but existing documentation and header files are unclear about whether it might be present on other chips - so there is also an EXTERNAL_EXPERIMENTAL analogReference() option, available on all parts that don't have , which will try to set the appropriate bits, whether or not the header file says it's there,

Finally, inconsistencies in treatment of the EESAVE fuse for Optiboot boards was fixed - now it is not enabled for these board definitions (previously some had it, and some didn't). Thus, burn bootloader will always clear the EEPROM (and as always, optiboot uploads won't touch the EEPROM - though note that the version of Optiboot included with the core does support EEPROM writes (though the IDE does not have this functionality)

This is the version for manual installation

2.0.1 - ADC Reference fixes, tinyNeoPixel libraries split by port

17 Apr 04:27
Compare
Choose a tag to compare

In pursuit of the goal of eliminating unnecessary tools submenus (which presented problems for sketch maintenance, because submenu settings are not saved with the sketch), the tinyNeoPixel library is no longer a menu option, instead, there are three copies of the library, one for each port - I realize this will break existing sketches (was intended for 2.0.0), but having the sketch require specific submenu options also broke sketches.

Now the only tools submenus are for things that are used to control fuses (which require burn bootloader to set), the clock speed (which in theory is supposed to, but in reality only requires burn bootloader to switch between 16MHz derived clocks and 20MHz derived ones)), and the millis/micros timer, which has to be a submenu because it controls which ISR is defined for millis timekeeping.

Additionally, several bugs relating to the analog references and the DAC introduced by 2.0.0 and 1.1.10 were turned up in testing - this is now fixed. Note also that the EXTERNAL reference option is not present on as many parts as I thought it was - I only know for certain that it's on the "good" 1-series tinies, but existing documentation and header files are unclear about whether it might be present on other chips - so there is also an EXTERNAL_EXPERIMENTAL analogReference() option, available on all parts that don't have , which will try to set the appropriate bits, whether or not the header file says it's there,

Finally, inconsistencies in treatment of the EESAVE fuse for Optiboot boards was fixed - now it is not enabled for these board definitions (previously some had it, and some didn't). Thus, burn bootloader will always clear the EEPROM (and as always, optiboot uploads won't touch the EEPROM - though note that the version of Optiboot included with the core does support EEPROM writes (though the IDE does not have this functionality)

This is the version for board manger installation

2.0.0 - Lots of big changes & improvements - minor breakage expected

12 Apr 00:08
Compare
Choose a tag to compare

As a major version release, this brings significant enhancements in the performance and API - but there is also the risk of some backwards compatibility issues. This brings a bunch of changes meant to address some questionable decisions made early in the development of this core, in order to put the core on more solid foundations moving forward. The changes are as follows:

  • Remove all the UART/SPI/I2C pin mapping menus from tools submenus. Instead, use the newly added .swap() and .pins() methods on these objects to set the pins to be used.
  • The default pins used for Serial on 8-pin parts in previous versions are not the "default" pins per datasheet (arduino pins 0 and 1); instead, the "alternate" pins were used by default (arduino pins 2 and 3). Note that on the Rev. - and Rev. A breakouts for these parts from my Tindie store, the serial lines from the FTDI header go to the alternate pins, not the "default" ones. (this will be corrected in Rev. B of the board). If you have sketches/hardware using this, you will either need to move connections, or add Serial.swap(1); before calling Serial.begin(). I realize this is inconvenient, but that previous behavior should never have been the case, and, having finally accepted the fact, it was better to cut over quickly than let more people get used to the previous behavior and then change it later.
  • Improve ADC speed dramatically (it runs in about a quarter of the time it used to!) - I do not expect this to cause any issues with accuracy. The megaavr parts support much higher maximum ADC clock compared to the classic AVRs. We now set the ADC clock near to the top of it's range. In order to prevent this from hurting accuracy when reading high impedance sources, the ADC0.SAMPCTRL is set to SAMPLEN=14 instead of 0. This means samples will be taken for 16 ADC clocks instead of 2. Since the ADC clock is 8 times faster now, this should result in the same sampling time. See the ADC section for more information, including how to get even faster ADC readings from low impedance signals.
  • digitalRead(), pinMode(), and digitalWrite() were changed back to operating on uint8's instead of the PinMode, PinStatus, etc enums like the official megaavr core does (and unlike how every other core does it). Using the enums, while it was defensible from a software architecture perspective, caused a lot of breakage of common Arduino ideoms that have been in widespread use for ages, for very little benefit. This also applies to things that used BitOrder.
  • digitalRead(), pinMode(), digitalWrite() and analogWrite() now take advantage of the unified memory architecture of the megaavr parts to improve performance and reduce flash usage by removing the PROGMEM attribute and accompanying pgm_read_byte() calls. This yields a significant improvement in performance of analogWrite() and digitalRead() in particular.
  • Remove the DAC reference voltage from tools submenu. Now, use the DACReference() function - it can take any of the INTERNAL reference arguments that would be passed to analogReferece().
  • digitalRead() no longer turns off PWM and DAC output on the pin that is read. There was no technical need for this, and digitalRead() should not change the pin output state!
  • digitalRead() now returns an int8_t instead of an int16_t - this saves a tiny amount of flash and slightly improves execution time.
  • digitalRead() now returns -1 if called on a pin that doesn't exist, instead of 0 (LOW). This should make debugging easier, without impacting behavior when valid pin is passed to digitalRead().
  • Added support for manipulating the millis timer from within libraries or the sketch: init_millis(), stop_millis(), set_millis(), and restart_millis(). These are not expected to be normally used in sketches; these will be used in the upcoming megaTinySleep library which will "switch" millis timekeeping to the RTC when in sleep, and restore the millis value to whatever other timer is normally used.
  • Also fixes a bug with the EXTERNAL reference option being defined for the '212 and '412 - the 8-pin parts do not have that reference option, even if they're 1-series and otherwise would.

Please report any issues that you find!

This is the version for board manager installation.

2.0.0 - Lots of big changes & improvements - minor breakage expected

11 Apr 23:11
4fe1c4a
Compare
Choose a tag to compare

As a major version release, this brings significant enhancements in the performance and API - but there is also the risk of some backwards compatibility issues. This brings a bunch of changes meant to address some questionable decisions made early in the development of this core, in order to put the core on more solid foundations moving forward. The changes are as follows:

  • Remove all the UART/SPI/I2C pin mapping menus from tools submenus. Instead, use the newly added .swap() and .pins() methods on these objects to set the pins to be used.
  • The default pins used for Serial on 8-pin parts in previous versions are not the "default" pins per datasheet (arduino pins 0 and 1); instead, the "alternate" pins were used by default (arduino pins 2 and 3). Note that on the Rev. - and Rev. A breakouts for these parts from my Tindie store, the serial lines from the FTDI header go to the alternate pins, not the "default" ones. (this will be corrected in Rev. B of the board). If you have sketches/hardware using this, you will either need to move connections, or add Serial.swap(1); before calling Serial.begin(). I realize this is inconvenient, but that previous behavior should never have been the case, and, having finally accepted the fact, it was better to cut over quickly than let more people get used to the previous behavior and then change it later.
  • Improve ADC speed dramatically (it runs in about a quarter of the time it used to!) - I do not expect this to cause any issues with accuracy. The megaavr parts support much higher maximum ADC clock compared to the classic AVRs. We now set the ADC clock near to the top of it's range. In order to prevent this from hurting accuracy when reading high impedance sources, the ADC0.SAMPCTRL is set to SAMPLEN=14 instead of 0. This means samples will be taken for 16 ADC clocks instead of 2. Since the ADC clock is 8 times faster now, this should result in the same sampling time. See the ADC section for more information, including how to get even faster ADC readings from low impedance signals.
  • digitalRead(), pinMode(), and digitalWrite() were changed back to operating on uint8's instead of the PinMode, PinStatus, etc enums like the official megaavr core does (and unlike how every other core does it). Using the enums, while it was defensible from a software architecture perspective, caused a lot of breakage of common Arduino ideoms that have been in widespread use for ages, for very little benefit. This also applies to things that used BitOrder.
  • digitalRead(), pinMode(), digitalWrite() and analogWrite() now take advantage of the unified memory architecture of the megaavr parts to improve performance and reduce flash usage by removing the PROGMEM attribute and accompanying pgm_read_byte() calls. This yields a significant improvement in performance of analogWrite() and digitalRead() in particular.
  • Remove the DAC reference voltage from tools submenu. Now, use the DACReference() function - it can take any of the INTERNAL reference arguments that would be passed to analogReferece().
  • digitalRead() no longer turns off PWM and DAC output on the pin that is read. There was no technical need for this, and digitalRead() should not change the pin output state!
  • digitalRead() now returns an int8_t instead of an int16_t - this saves a tiny amount of flash and slightly improves execution time.
  • digitalRead() now returns -1 if called on a pin that doesn't exist, instead of 0 (LOW). This should make debugging easier, without impacting behavior when valid pin is passed to digitalRead().
  • Added support for manipulating the millis timer from within libraries or the sketch: init_millis(), stop_millis(), set_millis(), and restart_millis(). These are not expected to be normally used in sketches; these will be used in the upcoming megaTinySleep library which will "switch" millis timekeeping to the RTC when in sleep, and restore the millis value to whatever other timer is normally used.
  • Also fixes a bug with the EXTERNAL reference option being defined for the '212 and '412 - the 8-pin parts do not have that reference option, even if they're 1-series and otherwise would.

Please report any issues that you find!

This is the version for manual installation.

1.1.10 - Wire, EEPROM fixes, ADC enhancements!

05 Apr 22:59
Compare
Choose a tag to compare

The library changes in 1.1.9 brought a few bugs, largely because I implemented them without testing them (because wiring.c was in pieces at the time....) and forgot I hadn't compile-tested them when I released 1.1.9. Those two libraries work again. Also, I made some fixes to the ADC - you can now use it to read the internal reference and temp sensor, making measurements of operating voltage and temp easy. See the included example - we now have a dummy library called "megaTinyCore" with examples of part-specific features!

This is the version for manual installation

1.1.10 - Wire, EEPROM fixes, ADC enhancements!

05 Apr 23:24
Compare
Choose a tag to compare

The library changes in 1.1.9 brought a few bugs, largely because I implemented them without testing them (because wiring.c was in pieces at the time....) and forgot I hadn't compile-tested them when I released 1.1.9. Those two libraries work again. Also, I made some fixes to the ADC - you can now use it to read the internal reference and temp sensor, making measurements of operating voltage and temp easy. See the included example - we now have a dummy library called "megaTinyCore" with examples of part-specific features!

This is the version for board manager installation

1.1.9 - Lots of millis/timer enhancements, and a few other things

03 Apr 01:40
Compare
Choose a tag to compare

This change brings a huge number of enhancements and fixes relating to the millis timekeeping functions. Previously, at 20/10/5 MHz, micros() was wrong with TCA0 or TCD0 as millis source (it would undercount, and then jump forward when the interrupt fired), and there was a slow drift on all timekeeping when TCD0 was used. Both were due to integer-math that had not been caught previously. These have been fixed. The timer settings used have been changed for some of the slower clock speeds to improve various parameters on those configurations. Performance of micros() has been slightly improved (mostly back to what it was before the above changes) and micros() now returns the closest time to when it was called possible.

The changes to timer configurations are summarized here in google sheets.

There is now a document included with the core that describes the timers on these parts and how they are used by the core: extras/PWMandTimers.md

This update also brings a few unrelated changes. The EEPROM library has been enhanced to allow writing to the "user row", an extra page of flash that these parts have. When the Servo library was modified to not depend on the TCA0 prescaling, the "trim" duration used to correct for the time taken to call digitalWrite() was not changed to be consistent with this (as an aside, it was also wrong to begin with). The Servo library also now does not use the prescale of 2 when run at 10MHz or less, which should make the output ever-so-slightly smoother with slower clock speeds. The Wire library can now take up to three arguments when used in slave mode; the first is, as always, the slave address, the second is a bool; if true, it will also react to general call messages, and the third is put into the TWI0.SADDRMSK register, which can either act as a second address, or mask off specified bits of the address allowing it to respond to any address that matches the unmasked bits (like how some AT24-series EEPROMs use some of the device address bits as the high bits of the memory address). These new arguments are optional. Finally, the programmer included on the Xplained Pro demo boards is now supported.

This is the version for manual installation.

1.1.9 - Lots of millis/timer enhancements, and a few other things

03 Apr 01:58
Compare
Choose a tag to compare

This change brings a huge number of enhancements and fixes relating to the millis timekeeping functions. Previously, at 20/10/5 MHz, micros() was wrong with TCA0 or TCD0 as millis source (it would undercount, and then jump forward when the interrupt fired), and there was a slow drift on all timekeeping when TCD0 was used. Both were due to integer-math that had not been caught previously. These have been fixed. The timer settings used have been changed for some of the slower clock speeds to improve various parameters on those configurations. Performance of micros() has been slightly improved (mostly back to what it was before the above changes) and micros() now returns the closest time to when it was called possible.

The changes to timer configurations are summarized here in google sheets.

There is now a document included with the core that describes the timers on these parts and how they are used by the core: extras/PWMandTimers.md

This update also brings a few unrelated changes. The EEPROM library has been enhanced to allow writing to the "user row", an extra page of flash that these parts have. When the Servo library was modified to not depend on the TCA0 prescaling, the "trim" duration used to correct for the time taken to call digitalWrite() was not changed to be consistent with this (as an aside, it was also wrong to begin with). The Servo library also now does not use the prescale of 2 when run at 10MHz or less, which should make the output ever-so-slightly smoother with slower clock speeds. The Wire library can now take up to three arguments when used in slave mode; the first is, as always, the slave address, the second is a bool; if true, it will also react to general call messages, and the third is put into the TWI0.SADDRMSK register, which can either act as a second address, or mask off specified bits of the address allowing it to respond to any address that matches the unmasked bits (like how some AT24-series EEPROMs use some of the device address bits as the high bits of the memory address). These new arguments are optional. Finally, the programmer included on the Xplained Pro demo boards is now supported.

This is the version for board manager installation.