2 Replies Latest reply on Jun 6, 2020 2:59 AM by MoTa_728816

    PSOC4 I2C Connection with Honeywell SSC Pressure Sensor

    hewo_3702871

      Hi, I'm trying to connect the Honeywell differential pressure sensor (SSCDRRN005PD2A5) with PSOC4 using the I2C.

       

      https://sensing.honeywell.com/SSCDRRN005PD2A5-amplified-board-mount-pressure-sensors

       

      I want to acquire the pressure sensor values and send it to the computer through UART.  The UART connection is working, but I'm not able to acquire any pressure values.  I am trying to follow the document below showing the i2C protocol.  I changed the slave address to 0x28 and am trying to read two bytes from register 0x01. 

       

      https://sensing.honeywell.com/i2c-comms-digital-output-pressure-sensors-tn-008201-3-en-final-30may12.pdf  

       

      Part of my code is below and I also attached the full files.  Thank you for your help.

       

      int main()

      {

       

          int32 status;

          int x_value;

          int y = 200;

       

          char str[20];

         

          CyGlobalIntEnable;

       

          I2C_Start();

          UART_1_Start();

         

          CyDelay(100);

         

          // UART Connection

          UART_1_UartPutString("UART Connected");

       

          int32 Status;

          uint8 x0,x1;

          Status = I2C_I2CMasterSendStart(ADXL375_ADDR , I2C_I2C_WRITE_XFER_MODE, TIMEOUT_MIO);

          Status |= I2C_I2CMasterWriteByte(REGISTER_DATAX0, TIMEOUT_MIO);

          //Status |= I2C_I2CMasterSendStop(TIMEOUT_MIO);

          for(;;)

          {

              Status |= I2C_I2CMasterReadByte(I2C_I2C_NAK_ADDR, &x0, TIMEOUT_MIO);

              Status |= I2C_I2CMasterReadByte(I2C_I2C_NAK_ADDR, &x1, TIMEOUT_MIO);

         

              //int32 status1 = (x0 & 0xc0) >> 6;

         

              x_value = ((x0 & 0x3f) << 8) +x1;

              int Pmax = 5;

              int Pmin = -5;

              int Output_max = 16384;

              int Output_min = 8224;

         

              int p = ((x_value - Output_min)*(Pmax - Pmin))/(Output_max-Output_min)+Pmin;

             

              itoa(p, str, 10);

              UART_1_UartPutString("\r\n p = ");

              UART_1_UartPutString(str); 

              

              CyDelay(500);

          }

       

       

      }