i'm trying to make an Attiny85 talk with an Arduino Yùn using IR and SoftwareSerial library. I've just solved the problem on the Yùn side, now it's time for the little tiny85. I have already done this using a Yùn and an Arduino Uno, and it works. I'm having some problems with the tiny85 because of (in my opinion) timers. I've never used them!
I burned the bootloader @ 8 MHz (internal).
First of all i followed this guide to check the SoftwareSerial: it works!
Then i followed this link to generate the 38 kHz carrier, and i realized that the SoftwareSerial doesn't work anymore. I also tried to make an LED blink, but the delay() function doesn't work after the carrier generation.
I'd like to know if the Attiny can use different timers to handle the 38 kHz carrier and the delay/SoftwareSerial part... If i must tell the truth i don't know if this is the right question. This is the first time i meet timers, even if i have been using Arduino for years
SoftwareSerial doesn't use a hardware timer though, as far as I can tell...
The link for generating the 38khz signal will take out delay on some cores, because only some cores use timer1 for timekeeping (which that code assumes) - the core you have uses timer0, so when you use timer0 to get 38khz output, that takes out timekeeping.
If you're using my attiny core (which uses timer0), I think you can do tone() on the OC1A pin (I think that's pin 3 or 4 - it's the third PWM pin, which not all cores support, because some people just threw their hands up in the air and didn't bother working with the more complicated Timer1) to get 38khz using the hardware timer.
The IR led is connected between pin 0 and 4. The blink works well, but the arduino Yùn can't receive the "Hello, world!" message. The speed (1200 baud) is the same.
PS. The softwareserial is working, i tried to connect directly the Attiny and the UNO by wire and the message is correctly received.
I got curious about this topic, and tried it out. And it worked amazingly weel.
Even with a smal IR-diode I got a range of a couple of meters, and a steady reading on my UNO that I used as a receiver.
Below my sketch on the t85. I used timer1 to generate the 38 kHz.
The IR diode is connected to pin 1 and 4.