Just for ideas, I believe the DH11 (or whatever it is) temperature & humidity sensor uses 1-wire communication. You might also look at CAN, and I2C for ideas. You would need an Open Drain pin (when in output mode), or configure a transistor/MOSFET/diode to create an OD condition from both ends.
The basic idea is a pull-up resistor creates an "Idle High" situation. Pulling the line Low is how either side initiates communication. Using INT0 (INT1_2) or IOC you could know when to look for a transmission (ISR). Unless transmitting, the pin would be configured as an Input (TRISx.x = 1), so it is able to look for packets from the other chip. With CAN, if the Sender is attempting to send a High signal, but the line is Low, Arbitration states the other chip is also trying to communicate and the looser (the one unsuccessfully trying to send a High signal) backs out. To transmit, you would first clear the TRISx.x bit, then begin sending. When finished, set the TRISx.x bit so you can then receive on the same pin.
You would probably have to create your own protocol, but look at how exciting a challenge that might be!
Bookmarks