Another way to do it is to take either RA6 or RA7 (not sure what they're supposed to do) and use one for notifications.
Configure both (one on the pic, one on the pi) to be inputs. Poll them during your idle time, such as the button press loop on the pic. If either has a message for the other, configure it as an output and set it high. The other sees it and goes to receive I2C mode. Once the sender sends the message, it clears that pin and sets it back to input.
Or possibly use an interrupt and read during the handler - but I haven't given that much thought.
Vince - K8ZW.
toggle quoted message
Show quoted text
On 03/06/2022 03:49 AM, David M0TGC wrote:
My idea is to have the ATU send the PI an I2C message saying "got
anything for me" and then listen for a reply for a short while. This
would be done from the "waiting for button press loop" in the ATU.
I have got the PI accepting messages but the return messages are proving
difficult. I think it is timing and/or the vagaries of I2C on the PI.
There is some sort of issue with the PI as a slave I think.
--
Michigan VHF Corporation -- nobucks dot net
K8ZW -