Skip to main content
Visitor II
May 5, 2007
Question

SSP / SPI slave mode

  • May 5, 2007
  • 2 replies
  • 876 views
Posted on May 05, 2007 at 05:15

SSP / SPI slave mode

    This topic has been closed for replies.

    2 replies

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

    Hi,

    if you want to use SSP1 as slave u should make the NSS pin connected to ground.Second thing is without master generating the clock slave can't send data.Master SSP only can initiate communication.Master has to send dummy data to generate clock.slave can send data using that clock.U can find reference program from ST.

    ben2Author
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:42

    Hi

    I am trying to use SSP1 as a slave.

    According to the datasheet it is possible to do this without using NSS.

    quote-

    - If CPHA=1 (data latched on 2nd clock edge):

    NSS_internal must be held low during the entire transmission.

    This implies that in single slave applications the NSS pin either

    can be tied to VSS, or made free for standard I/O by managing

    the NSS function by software (SSM= 1 and SSI=0 in the in the

    SSP_CR1 register)

    firstly SSM and SSI are not in CR1. I assume SSM = MS and SSI = SOD

    So I have GPIO3.4 (SSP1 SCLK)as an alternate input and

    GPIO3.5 (SSP11 MISO) as an alternate output 2.

    I am not using MOSI as I am transmitting only.

    The SSP is configured as a slave with CPHA set to 1 but I get no output.

    output from debugger.

    SSP1->CR0 = 0x8f

    SSP1->CR1 = 0x06

    GPIOOUT[3] = 0x801

    GPIOIN[3] = 0x10

    GPIOTYPE[3] = 0

    I must be missing something obvious here, but from what I can see it should be working.

    has anyone else managed to use SSP as a slave without the NSS pin ?

    thanks

    Ben