Prelude
I like the ATtiny85. It is small, comes in a solder friendly DIP 8 case, has 8k Flash + 512 Bytes Ram, 5 to 6 IO pins at 8 MHz with no external parts.
But developement is a pain: no serial (ok, it is possible but needs ports) and debugWire is even more pain.
So how to approach this problem? Throw money at it. Use MicroView.
Solution
MicroView is a chip-sized Arduino compatible module with an on-board 64×48 pixel OLED display. It has to be programmed with a special USB adapter. With its small size it is optimal for using in small environments. And it has a breadboard friendly DIP form factor.
But…
It is expensive. $40 per item. And a one time fee of $15 for the programmer. So nothing for eternal to build into each and every mini project.
So…
Replace it by a ATtiny85 after debugging the code.
But…
Yeah, it has a different footprint. A adapter is needed.
And here we go!
That is what this page is about: the MicroView to ATtiny85 adapter. It is a very simple small PCB with no parts on it beside some headers.
(To look nicer the MicroView has been rotated.)
Port assignments between ATmega328P and ATtiny85 is different. So there have to be two different source codes for MicroView and ATtiny85. At least, where the pins are defined.
This map shows the port assignments.
Programming of the ATtiny85 has to be done the conventional way. I use the very smart and nice Tiny Loadr Shield (discontinued and replaced by the TinyLoadr AVR programming Shield which is not a shield and overkill).
Port mappings can be automated by using conditional defines.
const int dummy = 42; // kaputte arduino 1.06 IDE //------------ #if defined(__AVR_ATtiny85__) || defined(__AVR_ATtiny84__) const byte PPinRelais = 3; // const byte PPinLDR = A2; // const byte PPinLED = 0; // // Pin 0 ist frei #else // mit Arduno-Adapter // const byte PPinRelais = A5; // const byte PPinLDR = A4; // const byte PPinLED = 2; // #endif const byte PinRelais = PPinRelais; // Wrapping const byte PinLDR = PPinLDR; // const byte PinLED = PPinLED; //