PIC master and slave

Thread Starter

RG23

Joined Dec 6, 2010
304
I am using two pic controllers


i am able to read the data form the slave to master

but I am not able to write the data from master to slave


When I send the data 0x15 from the master I see that on the oscilloscope correctly

but somehow I am not entering the label_transmit1 subroutine

I tried to set PORTC,2 in the main part of the program

and reset it as bcf PORTC,2 just to check if I enter that particular subroutine but it stays high


if anyone has an idea please let me know

Thanks
 
Last edited:

Thread Starter

RG23

Joined Dec 6, 2010
304
When the master sends the data to the slave

I check if PIR1 bit 3 is high first

Then I check for D/A bit of SSPSTAT
and then the R/W bit of SSPSTAT

is it the correct approach?
 
Top