8 Replies Latest reply on Aug 28, 2013 7:31 AM by user_14586677

    SPI not waiting for completion

    user_62720120

      Hi,

         

      I am using the SPI slave module on a CY8C24423A. This has been working fine for several years, but now I seem to have changed something in the SPI master, because NONE of the PSoC SPI slaves are responding to it.

         

      After the chip select is detected, the PSoC loads a byte into the SPI buffer, then waits for the SPI transaction to complete:

         

          mov    A, 0x06               ; MSB First SPI mode 3       
          Call    SPIS_1_Start

          Mov    A, %10101010    ; Load a byte into the SPI
          Call    SPIS_1_SetupTxData

         

      SPI_Wait:                          ; Now wait for the SPI transaction to complete
          Call    SPIS_1_bReadStatus       
          AND   A, 0x20                ;0x20 = 'SPI Done' status mask   
          jz        SPI_Wait
         

         

      However, the SPI_Wait loop exits immediately, even though there no clock edges have appeared yet. I have verified this on a 'scope.

         

      Any ideas why the loop might exit immediately?

         

      Many thanks

         

      Hugo Elias