6 Replies Latest reply on Jan 20, 2014 9:25 AM by user_1377889

    SPI Master - SS controle

    kmolden

       Hi guys,

         

      I am implementing an SPI Master to my PSoC 4 project. 

         

      The SPI slave used require the SS to be held low for two clock cycles after each transaction, before bringing it back high.

         

      Has anyone got any suggestions as to how i could do this without using a 'control register' to manipulate the SS line?

         

      All the Best,

         

      Katrine

        • 1. Re: SPI Master - SS controle
          user_1377889

          You may write directly to the pin without using a control register. pulling pin low before master action and release it (after some delay) when the transmission is done.

             

           

             

          Bob

          • 2. Re: SPI Master - SS controle
            kmolden

             Hi Bob,

               

            Thank you for getting back to me. I have tried this but when I do I get an error when i try to program the device.

               

            That is, the code will compile just fine, but when i try to use the miniprog to program the device I get: "FAILED! Error in row 54..."

               

            The only difference between the code which i can program just fine and the code which fails to program is the added :

               

            SS_Pin_Write(0);

               

            before SPI write transaction and after

               

            SS_Pin_Write(1);

               

            Any suggestions as to why I would have this problem with the programming?

               

             

               

            All the Best,

               

            Katrine

            • 3. Re: SPI Master - SS controle
              kmolden

               Here is the error message:

              • 4. Re: SPI Master - SS controle
                user_78878863

                What happens when you change exactly this line back and then try to program again? (I cannot imagine why such a code change should affect the programming)

                • 5. Re: SPI Master - SS controle
                  kmolden

                  My apologize for not getting back to you sooner. 

                     

                  I created a new project and built the same code again and it worked fine. 

                     

                  The original project keeps working and not working at random. I.e. I could insert the lines which caused the programmer to crash, uncomment the same line as the only change and it would work. So still a mystery why this is, but at least I have a working project. 

                  • 6. Re: SPI Master - SS controle
                    user_1377889

                    Can you create a MyCase (on top of this page "Support&Community->Technical Support->Create a MyCase) and submit the projects to Cypress for analyzation? Probably an error within Creator prevents the project from beeing programmed correctly.

                       

                    Additionally. will you please keep us informed of the progress / results?

                       

                     

                       

                     

                       

                    Bob