Any ideas on a simple one way communication between two MCUs?

Hi, I would like to have a very basic one way communication channel between an Arduino (mega) and a bare bones ATtiny85. I only need to send stuff one way (from the Arduino to the ATtiny) and I don’t need to send any actual or sophisticated “data”, but more like four different signals that will represent “states”. So, as long as the attiny can distinguish between 4 different cases, of what arduino sends to it, that’s totally fine with me.

At the moment I am thinking of sending a PWM signal (either with an analogWrite or using the Servo.write function) from the arduino and “reading” using pulseIn at the attiny side.
The connection should be done with a simple short wire and using any kind of Serial communication is not acceptable.

Any other better suggestions or objections?

Thanks

kuruki: Hi, I would like to have a very basic one way communication channel between an Arduino (mega) and a bare bones ATtiny85. I only need to send stuff one way (from the Arduino to the ATtiny) and I don't need to send any actual or sophisticated "data", but more like four different signals that will represent "states". So, as long as the attiny can distinguish between 4 different cases, of what arduino sends to it, that's totally fine with me.

At the moment I am thinking of sending a PWM signal (either with an analogWrite or using the Servo.write function) from the arduino and "reading" using pulseIn at the attiny side. The connection should be done with a simple short wire and using any kind of Serial communication is not acceptable.

Any other better suggestions or objections?

Thanks

Why not serial communication? You could use software serial with one pin as RX and thats all.

Also, your pwn idea is a serial communication too.

mart256: Why not serial communication? You could use software serial with one pin as RX and thats all.

As I don't need to send any "data" such as a string or "numbers" and considering the attiny's limited space, I consider software serial as an overkill. But of course, that would work.

I am trying to investigate some more lightweight ways to achieve such simple communication.

Four states = two bits, so connect two port pins on each, using two wires + ground.

jremington: Four states = two bits, so connect two port pins on each, using two wires + ground.

Hehe, one requirement of mine is that it has to be implemented over one pin. (I don't have any pins on the ATtiny to spare) :)

Have a look at yet another software serial. You should be able to make a version without any Tx code.

And I had nearly forgotten about small serial - which may be even more suitable.

...R

kuruki: Hehe, one requirement of mine is that it has to be implemented over one pin. (I don't have any pins on the ATtiny to spare) :)

Then you can implement your own protocol, just set the way you want to send the message (for example, toggle high and low 3 times to begin communication, then send 2 bits and finally toggle 3 times again for closure).

The connection should be done with a simple short wire and using any kind of Serial communication is not acceptable.

You do need ground, so two wires. If serial is not acceptable, then you require multiple states at one pin, which leaves current or voltage levels as the only two options. Either case requires use of an ADC on one end and a DAC on the other.

mart256: Then you can implement your own protocol, just set the way you want to send the message (for example, toggle high and low 3 times to begin communication, then send 2 bits and finally toggle 3 times again for closure).

yeah I thought of that which by using interrupts could be implemented in an intuitive way.

jremington: You do need ground, so two wires. If serial is not acceptable, then you require multiple states at one pin, which leaves current or voltage levels as the only two options. Either case requires use of an ADC on one end and a DAC on the other.

my limitation is at the programmable pins, not the voltage/ground lines. But yeah, analog/pwm signals is what I was thinking too.

Robin2: Have a look at yet another software serial. You should be able to make a version without any Tx code.

And I had nearly forgotten about small serial - which may be even more suitable.

...R

cool, I was searching for such. I'll look into them, thanks!