Skip to main content
Visitor II
October 24, 2006
Question

Problem SSP Master

  • October 24, 2006
  • 3 replies
  • 930 views
Posted on October 24, 2006 at 13:10

Problem SSP Master

    This topic has been closed for replies.

    3 replies

    mt-i-eukAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:33

    Hi,

    i´m tryinig to communicate over the SSP interface. I´ve tried the SSP example from ST and it works fine, but i can receive data even if there ist no connection between the MOSI and MISO PINs. The Data are given out on the MOSI Pin, but if I put the pin to ground i receive the sent data too. There must be a bug in the receive register. Has anyone an idea why?

    Here´s my code:

    /* SSP0 configuration */

    SSP_DeInit(SSP0);

    SSP_InitStructure.SSP_FrameFormat = SSP_FrameFormat_Motorola;

    SSP_InitStructure.SSP_Mode = SSP_Mode_Master;

    SSP_InitStructure.SSP_CPOL = SSP_CPOL_High;

    SSP_InitStructure.SSP_CPHA = SSP_CPHA_2Edge;

    SSP_InitStructure.SSP_DataSize = SSP_DataSize_8b;

    SSP_InitStructure.SSP_ClockRate = 5;

    SSP_InitStructure.SSP_ClockPrescaler = 2;

    SSP_Init(SSP0, &SSP_InitStructure);

    /* SSP0 enable */

    SSP_Cmd(SSP0, ENABLE);

    for(k=0; k

    SSP0_Buffer_Rx[k] = SSP_ReceiveData(SSP0);

    Tx_Idx=Rx_Idx=0;

    /* Slave to master transfer procedure */

    while(Tx_Idx

    {

    SSP_SendData(SSP0, SSP0_Buffer_Tx[Tx_Idx++]);

    while(SSP_GetFlagStatus(SSP0, SSP_FLAG_RxFifoNotEmpty)==RESET);

    SSP0_Buffer_Rx[SSP0RxBufferControl++] = SSP_ReceiveData(SSP0);

    }

    greeni :-W [B]

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:33

    Check SSPx->CR1 register, bit 0, Loopback mode, even the library.

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:33

    Hello,

    look on the discussion from 27.09.2006.

    If you use an SPI-Master, the NSS-Pin must be tied to VCC