1 2 Previous Next 18 Replies Latest reply on Apr 28, 2019 10:00 PM by AH_96

    SPI Problem in Radio Frequency (RF)

    BUTA_1301626

      I have a project that I've been dealing with for a long time and I can't. can you help me with this?

      I have a rf transceiver project. I'm using a total of 2 psoc kits. I use the first on the receiver side and the second on the transmitter side.send information by the transmitter.

      I can send the information from the 1.  psoc kit to SPIM (mosi output). I checked the right thing on both the LCD and the oscilloscope.

      I used SPIM in the 2. psoc kit. with the help of cable I made the connection to the MISO pin of the second psoc from the MOSI pin of the first psoc.

      my goal here is to save the information from the first psoc to the second psoc.

      I want to see the data I have recorded on the LCD which is connected to the second psoc.

      but the information I want on the second psoc screen does not appear.

      first uploaded to psoc  uint8 buffer[64]={0x55,0x55,0x55,0x55,0x55,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0x50,0x53 ,0x4f ,0x43 ,0x20 ,0x44 ,0x45 ,0x4e ,0x45 ,0x4d ,0x45};

      1. 0x55,0x55,0x55,0x55,0x55,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFFèRf preamble
      2. 0x4f ,0x43 ,0x20 ,0x44 ,0x45 ,0x4e ,0x45 ,0x4d ,0x45è hex to ascii è“PSOC DENEME”

       

      1. I may have made a mistake with my file (creator fileèudea-reciever-son.) I couldnt find it?

      also I want to know.

      I used "SPIM" in the first psoc. I need to use "SPIM" in my second psoc?1.png

        • 1. Re: SPI Problem in Radio Frequency (RF)
          AH_96

          Hi

          For SPI communication, one has to be master and the other has to be slave and the slave select (ss) connection must be made.

          One of the PSoC device must be configured as an SPI slave.

           

          Can you please specify which is the final transmitter project and which is the receiving project? There are 5 projects in the workspace.

           

          Please refer to the code example SPI_Design within PSoC creator for an example of setting up master and slave SPI components.

           

          Do let us know if the problem still exists.

           

          Thanks and regards

          Harigovind

          • 2. Re: SPI Problem in Radio Frequency (RF)
            BUTA_1301626

            Hi Harigovind;

            Now the project has only receiver and transmitter projects.

            I used SPIM in the receiver section and SPIS in the transmitter section. But the project still did not work.

            • 3. Re: SPI Problem in Radio Frequency (RF)
              AH_96

              Hi

              In the project, there are errors in pin configurations. Please make sure that Digital Input pins are used for inputs, such as slave's MOSI, SCLK, SS and master's MISO and Digital Output pins for the others.

               

              Also, in the project, the slave select pins are not attached to a pin and is not configured. Please make sure that slave select pins are configured and connected externally between the PSoC devices.

               

              Please refer the code example, SPIM_Example and SPIS_Example, present in PSoC creator for guidance on how to configure and program 2 PSoC devices for SPI communication.

               

              Thanks and regards

              Harigovind

              • 4. Re: SPI Problem in Radio Frequency (RF)
                BUTA_1301626

                Hi Harigovind;

                I have reviewed SPIM_Example and SPIS_Example.but I don't understand that I have to use dma.

                Can I provide information flow without using dma?

                • 5. Re: SPI Problem in Radio Frequency (RF)
                  AH_96

                  Hi

                   

                  I have attached two projects (one master and one slave) as an example for SPI communication between two PSoC 5lp. You can refer these and make changes to suit your need.

                  Please make sure that you connect the MISO, MOSI, SCLK and SS pins externally for communication to happen.

                   

                  Do let us know if you face any problems.

                   

                  Thanks and regards

                  Harigovind

                  • 6. Re: SPI Problem in Radio Frequency (RF)
                    BUTA_1301626

                    I think i'm doing something wrong. because lcd constantly writes 0000000000.

                    What should I connect to MISO, MOSI, SCLK and SS pins?

                    • 7. Re: SPI Problem in Radio Frequency (RF)
                      AH_96

                      Hi

                       

                      The master's pins need to be connected to the respective pins of the slave. That is, master's MISO needs to be connected to slave's MISO, MOSI to slave's MOSI, etc.

                       

                      These connections needs to be external. Also, the grounds of both the PSoCs need to be shorted.

                      Please let me know if you still face the problem.

                       

                      Thanks and regards
                      Harigovind

                      • 8. Re: SPI Problem in Radio Frequency (RF)
                        BUTA_1301626

                        Hi;

                        I made all the connections.(The master's pins need to be connected to the respective pins of the slave. That is, master's MISO needs to be connected to slave's MISO, MOSI to slave's MOSI, etc.)

                        but there is still a problem. and I can't find out where the problem is.

                        SPIM RX data:FFFFFFFFFFFFF

                        SPIS  rx data none??

                         

                         

                        can the problem be here?(slave code)

                        while(!(SPIS_ReadTxStatus() & SPIS_STS_SPI_DONE));

                                /* SPI communication is complete so we can display received data */

                                   

                                LCD_Position(0u,0u);

                                LCD_PrintString("SPIS Rx data:");

                               

                                LCD_Position(1u,0u);

                               

                                for(i=0u; i<8; i++)

                                {

                                    /* Read from SPIS Rx software buffer */

                                    LCD_PrintHexUint8(SPIS_ReadRxData());       

                                }

                        IMG_20190404_112736_resized_20190404_112756744.jpg

                        • 9. Re: SPI Problem in Radio Frequency (RF)
                          AH_96

                          Hi

                           

                          I had checked this program in my kit and it was found to be working. Please make sure that the clock frequencies are the same for master and slave.

                          The slave is supposed to print atleast "SPIS Rx Data" in the first line of LCD. This is not dependent on the SPI communication. Please verify that the correct program is flashed on the PSoC devices.

                          Additionally, you can try to remove the infinite loop and send the message only once to check.The master can initiate the communication by pressing reset button. This will send the data only once.

                          You can put the second (slave) PSoC in debug mode and check when the device exits while(!(SPIS_ReadTxStatus() & SPIS_STS_SPI_DONE)); statement. It executes the next step only after it finishes transaction with master.

                           

                          Do let us know in case of any updates.

                           

                          Thanks and regards

                          Harigovind

                          • 10. Re: SPI Problem in Radio Frequency (RF)
                            AH_96

                            Hi

                             

                            Did you try the debug mode in PSoC device? Were you able to identify the problem?

                             

                            Please let us know in case of any updates.

                             

                            Thanks and regards

                            Hari

                            • 11. Re: SPI Problem in Radio Frequency (RF)
                              BUTA_1301626

                              Hi;

                              LCD showed when it removed the while loop. However, the LCDs show values in the buffer that are unrelated to the values. They show 00000000 and FFFFFFFF values.

                              I think I need to change the project I need to use the Manchester coding scheme. Can you help with that?

                              • 12. Re: SPI Problem in Radio Frequency (RF)
                                AH_96

                                Hi

                                 

                                So when you removed the loop and transmitted only once, was the data transfer correct? (Just wanted to make sure the connections are correct).

                                If the data transmission is not correct (if the LCD is not showing the correct result) can you probe the 4 lines and send me the waveforms? We can verify if the data transmission is happening correctly. Please send waveforms of all 4 lines (MISO, MOSI, SCLK, SS).

                                 

                                Regarding the manchester coding scheme, could you specify the need for it? Because the SPI communication block implemented in PSoC is not designed for manchester coding of data.

                                 

                                Thanks and regards

                                Harigovind

                                • 13. Re: SPI Problem in Radio Frequency (RF)
                                  BUTA_1301626

                                  Hi;

                                  I'm sending the waveforms of the manchester coding required for the transmitter and receiver.Ekran Alıntısı.JPG

                                  • 14. Re: SPI Problem in Radio Frequency (RF)
                                    AH_96

                                    Hi

                                     

                                    I wanted the practical waveform you are obtaining in the MISO, MOSI, SCLK and SS lines. I wanted to check if the data is being correctly transmitted by the PSoC device.

                                     

                                    Thanks and regards

                                    Harigovind

                                    1 2 Previous Next