10 Replies Latest reply on Sep 26, 2018 10:20 AM by dogaru_liviu_2439176

    Test I2C on CY8CKIT-059 5LP

    user_80002741

      Hello, I am working on my first I2C program and am running into a brick wall. Here is a snippet of my code:

       

      int main()

      {

         

           I2CM_Start();

           CyGlobalIntEnable;

           WriteCommandPacket(1);

           return 0;

      }

      uint32 WriteCommandPacket(uint8 cmd)

      {

       

           uint8 buffer[3];

           buffer[0] = 1;

           buffer[1] = 1;

           buffer[2] =  0x17u;

           I2CM_MasterReadBuf(I2C_SLAVE_ADDR, buffer, PACKET_SIZE, I2CM_MODE_COMPLETE_XFER);

           while(0u == (I2CM_MasterStatus() & I2CM_MSTATE_WR_CMPLT)

           (

                // code to toggle the led on the PSOC5 Kit

            )

          

           Here is a picture of my setup:

       

      IMG_4152.JPG

      So I thought I would run the Bridge Control Panel and try reading 3 bytes but it doesn't work:

       

      BridgeControl.jpg

      I should be getting back +'s on the response.

       

      I will upload my project which will be easier to look over.

       

      Thank you very much,

      Joe