Hi All,
I've been using (and loving) the arduino-tiny core: Google Code Archive - Long-term storage for Google Code Project Hosting.
with an ATtiny84 and Arduino IDE v.22 (my project uses too many third-party libraries at the moment to make the switch to 1.0 right now).
I was struggling to get serial communication to work with it. There's a debug_serial library but I need bidirectional communication.
I came across this thread that said NewSoftSerial does the trick, http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1285218245/all
so I downloaded NewSoftSerial10c from NewSoftSerial | Arduiniana
Sure enough transmitting works fine, but reception not at all.
Digging into NewSoftSerial.cpp you can see that the necessary pin change interrupts are only defined for ATmega168 and 328.
I added references for ATtiny84, and it seems to be working fine so far. I've only tested it on pin D10 as receive, so it might not work on every pin. Of course, use at your own risk...
Nick
// Abstractions for maximum portability between processors
// These are macros to associate pins to pin change interrupts
#if !defined(digitalPinToPCICR) // Courtesy Paul Stoffregen
#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
#define digitalPinToPCICR(p) (((p) >= 0 && (p) <= 21) ? (&PCICR) : ((uint8_t *)NULL))
#define digitalPinToPCICRbit(p) (((p) <= 7) ? 2 : (((p) <= 13) ? 0 : 1))
#define digitalPinToPCMSK(p) (((p) <= 7) ? (&PCMSK2) : (((p) <= 13) ? (&PCMSK0) : (((p) <= 21) ? (&PCMSK1) : ((uint8_t *)NULL))))
#define digitalPinToPCMSKbit(p) (((p) <= 7) ? (p) : (((p) <= 13) ? ((p) - 8) : ((p) - 14)))
#elif defined(__AVR_ATtiny84__)
#define digitalPinToPCICR(p) (((p) >= 0 && (p) <= 10) ? (&GIMSK) : ((uint8_t *)NULL))
#define digitalPinToPCICRbit(p) (((p) <= 2) ? 5 : 4)
#define digitalPinToPCMSK(p) (((p) <= 2) ? (&PCMSK1) : (((p) <= 10) ? (&PCMSK0) : ((uint8_t *)NULL)))
#define digitalPinToPCMSKbit(p) (((p) <= 2) ? (p) : (((p) - 10) * -1))
#else
#define digitalPinToPCICR(p) ((uint8_t *)NULL)
#define digitalPinToPCICRbit(p) 0
#define digitalPinToPCMSK(p) ((uint8_t *)NULL)
#define digitalPinToPCMSKbit(p) 0
#endif
#endif