The second Arduino Tiny release is ready...
Included is a "highly compatible" core for the ATtiny84, ATtiny45, and ATtiny85 processors: most of the functions are very similar or identical to the 0019 core.
- Tiny Debug Serial has been added. This is a small, very accurate, write only "software serial". Obviously, it can be used for any serial communications but the intended purpose is to replace Serial for debugging. Three baud rates are supported: 9600, 38400, and 115200 at two processor speeds: 8 MHz and 1 MHz. The baud rate must be a constant: "Serial.begin(9600);" is OK; "Serial.begin(userselectedbaud);" is not. Different combinations of baud rate and processor speed will produce different compile sizes. If you're concerned with size, stick with 38400. If you're concerned that the processor's clock is not accurate, stick with 9600. On the '84 processor, the Serial transmit pin is PB0 / pin 0. On the x5 processor, the Serial transmit pin is PB3 / pin 3. Basically, the transmit pin is the first I/O pin in the upper-left corner. If you'd like a baud / processor combination added please let me know.
- Three PWM pins are available for the x5 processor: two phase-correct and one fast. This can be changed to one phase-correct and two fast with a compile switch in core_build_options.h.
- Pin assignment for the RESET pin.
- For the x5 processor, timer 1 is used for millis. Timer 0 is available to the user or is used by tone / PWM. Timer 1 is considerably different from the typical ATmega timers. By making the more familiar timer 0 available to the user, the x5 processor should be much easier to use. The timer assignments can be reversed through a compile switch in core_build_options.h.
- The core is now built over a "hardware veneer" that has made porting much simpler.
- There is a hardware veneer for the "user timer" (by default, timer 1 for the '84 processor and timer 0 for the x5 processor) that should make it easier to work with the timer. For example, "UserTimer_SetToPowerup();" can be called to reset the user timer to power-up conditions; "UserTimer_ClockSelect( UserTimer_(Prescale_Value_8) );" can be called to set the clock prescale to 8. The code is split between "UserTimer.h" and "core_timers.h". If you find this veneer useful, please let me know. I'll try to set aside some time to fill it out and document it.
- Tone makes use of all clock prescale values. This adds some code but should make tone more accurate.
- Direct-to-hardware output is used on both tone timer output pins. When output is to one of these pins, the sound quality is much better especially at 1 MHz processor speed.
- It's my understanding that delayMicroseconds does not work at 1 MHz processor speed.
Please take a moment to click a few checkboxes...
GNU Lesser General Public License.
Comments, opinions, minor harassments, and success stories welcome.