4 Replies Latest reply on Oct 7, 2017 10:52 AM by javiernahumada04_2395246

    Interfacing PSoC5 with MAX31856

    javiernahumada04_2395246

      Hello people, here is my problem. I'm trying to interface the MAX31856 with the PSoC5. This chip communicates through an SPI Interface. I simply want to read its registers, I've already configured the SPI module and I'm printing the data in a LCD Display. My issue is that instead of showing me only the particular regiter i'm adressing, the display starts to show me secuentialy the data in all the registers one by one. Just to be clear i'm an armateur. Here is my code:

       

      #include <project.h>

      #include <cypins.h>

       

       

      #define CJHF 0x03 //the register that i want to read

       

       

      uint8 x;

       

      int main(void)

      {

          LCD_Start();

          Clock_Start();

          CyGlobalIntEnable;

          LCD_Position(0u,0u);

       

          for(;;)

          {

               

       

       

              Pin_CS_Write(1);

              CyDelay(1);

              Pin_CS_Write(0);

              SPIM_WriteTxData(0x01);

              x = SPIM_ReadRxData();

              Pin_CS_Write(1);

              CyDelay(1);

              LCD_PrintHexUint8(x); 

              CyDelay(500);

             

          }

      }