Arduino to arduino communication

Sorry to start a new topic again, my last one was a tad incorrect and wrong in what I was asking.

I have a master arduino that is doing the all of my main processing task and doesn’t have much processing power left on it! Also, I only have one output pin left.

I also have a slave arduino which is driving my LCD and has a few input pins left. What would be the most clock cycle efficient (on my master arduino) way to send data from the master to the slave? I will only need to send 4 bits at once.

A method I thought of was just using variable time pulses. Since the slave arduino is merely driving an LCD, waiting for pulsein is fine.

An example of this method for the sending arduino would be:

int ByteToBeWritten;
int TimeSample = 100;

CurrentTime = micros();

digitalWrite(Output2Slave, HIGH);     //Sending the initial pulse to indicate data is ready to send
if(CurrentTime - InitialTime > TimeSample){
  InitialTime = CurrentTime;
  digitalWrite(Output2Slave, LOW);

digitalWrite(Output2Slave, HIGH);    //Send a pulse with On time equal to the size of the byte
if(CurrentTime - InitialTimeB > ByteToBeWritten){
  InitialTimeB = CurrentTime;
  digitalWrite(Output2Slave, LOW);

On the receiving side:

ReadytoSend = pulseIn(Input2Slave, HIGH, 150)      //Detecting the 100uS pulse sent by the master arduino

if(ReadyToSend <=150 && ReadyToSend >=50){    //If the pulse that has been detected lies between 50-150uS, then it was the ReadyToSend pulse
  ReceivedByte = pulseIn(Input2Slave, HIGH, 100);   //The byte will be equal to the pulse length.

Would this successfully work and require much processor power?

Thanks, Harris

I don't know if this will be reliable.

Do you use SPI or I2C on your master Arduino ? If you use I2C you can set the other Arduino as I2C slave. If you use SPI, you can use the spare pin as a chip select.

Perhaps you can tell us how you use the pins, we might know some tricks to reduce the number of used pins.

Hi, The other pins are various inputs and outputs that are unfortunately vital to the projects (switch inputs etc). I don't use SPI or I2C on either of the arduinos. My slave arduino is communicating with the LCD through the HD44780 library (idk if that makes a difference or not!). Does this help the situation?

Thanks, Harris