7 Replies Latest reply on May 19, 2015 10:39 AM by user_470001162

    SPI Communication

    user_470001162

       now i am using the PSoC 5LP dev kit, and i am trying to use the SPI comunication with other devices, specifically the AD5750-1 and the MAX31865 for comunication and configuration, i could see in the DevComunity a communication example and it works right,i mean comunication between Cypress and Cypress which works well in all the configuration modes,but does not on the other devices, i hope someone help me to find the problem. 

         

      http://datasheets.maximintegrated.com/en/ds/MAX31865.pdf
      http://www.analog.com/media/en/technical-documentation/data-sheets/AD5750_5750-1_5750-2.pdf

        • 1. Re: SPI Communication
          user_342122993

           I made example of SPI comm with output buffer from Maxim Integrated, MAX15500, which is similar to AD5750 in functionality. I can post it, though it is still unpolished.

             

          odissey1

          • 2. Re: SPI Communication
            user_14586677

            @lfmoreno, extracted archive, but Creator errored on opening.

               

             

               

             

               

             

               

             

               

             

               

            Try a new archive.

               

             

               

            @odissey1, yes please post your solution.

               

             

               

            Regards, Dana.

            • 3. Re: SPI Communication
              user_1377889

              I could open the project wit Creator 3.1 SP3. A component update for SPI to version 2.5 was offered.

                 

               

                 

              Bob

              • 4. Re: SPI Communication
                user_14586677

                I confirm 3.1 SP3 opens OK with a SPI update, I had inadvertently used on older

                   

                version Creator.

                   

                 

                   

                But got another cryptic error trying to open with 3.2

                   

                 

                   

                Regards, Dana.

                • 5. Re: SPI Communication
                  user_1377889

                  Having not much experiences using SPI there are some points i would suggest you to do differently.

                     

                  I do not clear the TX buffer because everything that is in there still has to be sent

                     

                  Reading the Rx or Tx status can/will interfere with the interrupt driven buffer handling, because reading the status is resetting some of the status bits (datasheet and software tells so). So I just use the RxBufferSize() and TxBufferSize() functions which do not report the size of the buffers, but the number of bytes/words already received or still pending to be sent

                     

                  Keep in mind, that every sent byte will return a received byte regardless of whether it contains useful information or not. So your initial writes of 0x80 and 0xf2 will return two unused bytes in the Rx buffer which you will have to discard when they both have arrived (indicated by a GetRxBufferSize() == 2). Then a ClearRxBuffer() will be appropiate.

                     

                  To get the result from SPI you now will have to send some dummy bytes (for the sake of readability: name these bytes as "Dummy") filling the Rx buffer with the returned information. Again You'll have to wait until all bytes are there before processing them.

                     

                   

                     

                  Bob

                  • 6. Re: SPI Communication
                    user_1377889

                    @Dana

                       

                    FYI: Creator 3.2 "is expected" to be released next week (but could take some more time)

                       

                     

                       

                    Bob

                    • 7. Re: SPI Communication
                      user_470001162

                       i use creator 3.1 for all my projects, im developing a RTD_DAQ which can read up to 16 signals so therefore i think use some dedicated IC´s , now im testing some suggestions , and if it works i´ll let you know