Arduino UNO -> ATTiny85 Communication Without Interrupt

Hey everyone,

I am using an ATTiny85 to control a dimmer module. I am trying to do is use an Arduino UNO to send a value from 0 to 100 percent to the ATTiny in order to control the dimming level. One-way communication is enough.

The problem is that the ATTiny only has one interrupt which is already used and required by the dimmer module. And since the SCL pin is the same as the interrupt pin, it cannot be used for I2C communication anymore.

I have tried using the SoftwareSerial library, but that somehow messed with the interrupt causing the light to flicker. I believe I read that using analogWrite on the UNO and analogRead on the ATTiny would be possible, but that a low-pass filter would be needed?

In short: Is there any easy way to send a value from the UNO to the ATTiny that does not rely on interrupts? A library, any kind of protocol, digital read/write, ...?

Since I have 3 pins left on the ATTiny I was thinking of using one as a signal pin and another as a value pin to send the value bit-by-bit from the UNO to the ATTiny. This, of course, would also require 2 pins on the UNO and on the UNO I need all the pins I can get. Or am I making things too complex?

The ATtiny85 has pin change interrupts on all pins, so no shortage of interrupts there.

For one-way communication and where the accuracy of the value transferred isn't important, use a single wire signal which is timed proportionally to the value you wish to transfer. For example, an output pin on the UNO would be driven LOW for 1 to 100 milliseconds, the ATtiny would just have to time the pulse to get the value. Just an idea.

I would like the value to be accurate, but timing the pulse is actually a pretty clever idea. I will try it just for fun, but I am looking for a more robust solution.

I read that the ATTiny has change interrupt, but I have not been able to find how to allow them to be used for communication. Besides, won't the change interrupt interfere with the hardware interrupt?

How much other work are you doing in the loop? Could you use an analogWrite() on the Uno and the pulseIn() function on the ATTiny or will it block too much other stuff?

There is actually nothing going on in the main loop at this time. The current flow is:

Interrupt → Calculate delay (ms) → Delay for the calculated amount → Set output high → Delay 10 ms → Set output low

This all happens in the interrupt method. So nothing in the main loop. The pulseIn() documentation says it’s best to use pulses 10ms and up. Taking this into consideration, my pulse would be between 10 and 1000ms, which might cause some flickering (unless the hardware interrupt ignores pulseIn). But I guess the best way to find out is to try it.

Just as a side node: The ATTiny is running at “only” 1Mhz.

Any other possible suggestions?