PIC master and slave

Discussion in 'Embedded Systems and Microcontrollers' started by RG23, Sep 28, 2012.

  1. RG23

    Thread Starter Active Member

    Dec 6, 2010
    301
    2
    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: Oct 9, 2012
  2. RG23

    Thread Starter Active Member

    Dec 6, 2010
    301
    2
    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?
     
Loading...