Hot!Static I2C slave problem

Author
Kaws
New Member
  • Total Posts : 16
  • Reward points : 0
  • Joined: 2017/07/16 13:12:08
  • Location: 0
  • Status: offline
2018/07/05 08:18:27 (permalink)
0

Static I2C slave problem

Hello everyone,
 
I'm trying to build a setup with two PIC32 based boards (PIC32MZ2048FH064 as Interface board and PIC32MK1024GPE as PWM generator). I would like to use I2C as a data exchange bus (to write parameters to the slave board and to read it's status).
Master part looks fine, but slave can't get to the callback function. I can reach it only when I enable General Call Address, but it starts to react on any address (not only 0x00), and it's always "read" request (event == DRV_I2C_BUFFER_SLAVE_READ_REQUESTED), even if I send 0b00000000, which is definitely "write".
Basically, any address giving the same result.
What can be wrong?
 
Here is slave board callback code:
void getParameters(){
  testLed(1);
}
void sendStatus(){
  testLed(-1);
}
void APP_I2C_Slave_Callback(DRV_I2C_BUFFER_EVENT event, DRV_I2C_BUFFER_HANDLE bufferHandle, uintptr_t context){
  if(event == DRV_I2C_BUFFER_SLAVE_READ_REQUESTED){ // Query status of channels
    getParameters();
  }

  if(event == DRV_I2C_BUFFER_SLAVE_WRITE_REQUESTED){ // Set parameters
    sendStatus();
  }
}
And Harmony config is also attached.
 
Software used:
MPLABX v4.01
Harmony 2.04
XC32 1.44
post edited by Kaws - 2018/07/05 08:20:27

Attached Image(s)

#1

1 Reply Related Threads

    Kaws
    New Member
    • Total Posts : 16
    • Reward points : 0
    • Joined: 2017/07/16 13:12:08
    • Location: 0
    • Status: offline
    Re: Static I2C slave problem 2018/07/12 09:02:19 (permalink)
    5 (1)
    Problem solved. 
    Port System Service was disabled. After enabling and configuring pins as SCL2/SDA2- works like a charm.
    #2
    Jump to:
    © 2018 APG vNext Commercial Version 4.5