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.
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)
The connection should be done with a simple short wire and using any kind of Serial communication is not acceptable.
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).
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.
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