• AVR Freaks

Hot!What does an active low SS pin means in SPI interface?

Author
Mustang1945
New Member
  • Total Posts : 7
  • Reward points : 0
  • Joined: 2015/10/15 15:13:05
  • Location: 0
  • Status: offline
2020/08/08 07:09:24 (permalink)
0

What does an active low SS pin means in SPI interface?

Hi, I am reading the PIC32MZ datasheet and I would like to configure one SPI interface and use the PIC as master, I can see that the SS GPIO that has the PIC is active low by default, why?, this means that I am selecting the SPI slave always, so I don't know if I would need an external or internal pull-up, thanks
 
 
post edited by Mustang1945 - 2020/08/08 07:10:41

Attached Image(s)

#1

7 Replies Related Threads

    MisterHemi
    Super Member
    • Total Posts : 293
    • Reward points : 0
    • Joined: 2017/11/02 12:24:21
    • Location: Commerce, CA USA
    • Status: offline
    Re: What does an active low SS pin means in SPI interface? 2020/08/08 07:34:54 (permalink)
    0
    If the PIC is the master then a low SS would be to enable the slave device.
     
    If the PIC is the slave then the master would make the SS low to enable the PIC slave.
     
    In some cases it may be a good idea to use a pull-up resistor. I know when using SPI mode 
    for some memory cards (SD cards) they will have intermittent problems if there's no pull-up resistor.

    My configuration:
    MacBook Pro (Retina, 15-inch, Mid 2015) with MacOS Mojave (10.14.6) and MPLAB X IDE v5.30
     
    Curiosity PIC32MZ EF 1 & 2, PIC24F Curiosity, XPRESS EVAL BOARD (PIC16F18855), SAMA5D3 Xplained and various custom boards.
    #2
    Mustang1945
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2015/10/15 15:13:05
    • Location: 0
    • Status: offline
    Re: What does an active low SS pin means in SPI interface? 2020/08/08 07:40:41 (permalink)
    0
    Hi,
    MisterHemi
    If the PIC is the master then a low SS would be to enable the slave device.
     
    If the PIC is the slave then the master would make the SS low to enable the PIC slave.



    I know that but I don't understand why is the pin marked as active low, does it mean that it is low by default?, what is the benefit of having an active low ss pin?, if I am a master would mean that I always want to talk to the slave (an issue if I have some slaves), and if I am the slave means that I always am able to talk to the master (same issue as before)
    #3
    crosland
    Super Member
    • Total Posts : 2041
    • Reward points : 0
    • Joined: 2005/05/10 10:55:05
    • Location: Warks, UK
    • Status: offline
    Re: What does an active low SS pin means in SPI interface? 2020/08/08 08:39:30 (permalink)
    0
    Mustang1945
    Hi,
    MisterHemi
    If the PIC is the master then a low SS would be to enable the slave device.
     
    If the PIC is the slave then the master would make the SS low to enable the PIC slave.



    I know that but I don't understand why is the pin marked as active low, does it mean that it is low by default?, what is the benefit of having an active low ss pin?

     
    What's the benefit of an active high pin? It's one choice or the other. Either way you need to be able to drive it active (low) or inactive (high).
     

    if I am a master would mean that I always want to talk to the slave (an issue if I have some slaves), and if I am the slave means that I always am able to talk to the master (same issue as before)

     
    Do you really understand what active low means?
     
    Whether you are master or slave just determines the direction of the signal. It has nothing to do with "always" doing anything. The master asserts drives the SS signal to the slave. To select the slave it drives the signal low if active low. To deselect the slave it drives the signal high.
     
    If you have multiple slaves you need a SS for each slave, either multiple GPIO pins or en external demultiplexer.
     
    I do not believe PIC SPI masters drive SS. You need to do it in software through a GPIO pin. Harmony drivers may do this for you but I don't know how it copes with multiple slaves.
     
    I seem to recall that PIC SPI slaves only use SS in certain modes, see the data sheet.
    #4
    crosland
    Super Member
    • Total Posts : 2041
    • Reward points : 0
    • Joined: 2005/05/10 10:55:05
    • Location: Warks, UK
    • Status: offline
    Re: What does an active low SS pin means in SPI interface? 2020/08/08 08:39:30 (permalink)
    5 (1)
    Mustang1945
    Hi,
    MisterHemi
    If the PIC is the master then a low SS would be to enable the slave device.
     
    If the PIC is the slave then the master would make the SS low to enable the PIC slave.



    I know that but I don't understand why is the pin marked as active low, does it mean that it is low by default?, what is the benefit of having an active low ss pin?

     
    What's the benefit of an active high pin? It's one choice or the other. Either way you need to be able to drive it active (low) or inactive (high).
     

    if I am a master would mean that I always want to talk to the slave (an issue if I have some slaves), and if I am the slave means that I always am able to talk to the master (same issue as before)

     
    Do you really understand what active low means?
     
    Whether you are master or slave just determines the direction of the signal. It has nothing to do with "always" doing anything. The master asserts drives the SS signal to the slave. To select the slave it drives the signal low if active low. To deselect the slave it drives the signal high.
     
    If you have multiple slaves you need a SS for each slave, either multiple GPIO pins or en external demultiplexer.
     
    I do not believe PIC SPI masters drive SS. You need to do it in software through a GPIO pin. Harmony drivers may do this for you but I don't know how it copes with multiple slaves.
     
    I seem to recall that PIC SPI slaves only use SS in certain modes, see the data sheet.
     
    Duplicate due to stupid forum software.
    post edited by crosland - 2020/08/08 08:40:53
    #5
    Bob White
    Super Member
    • Total Posts : 336
    • Reward points : 0
    • Joined: 2010/11/06 19:52:38
    • Location: Denver, Colorado
    • Status: offline
    Re: What does an active low SS pin means in SPI interface? 2020/08/08 10:13:43 (permalink)
    0
    Summary:  "Active Low" means that the slave is selected when the line is low.  It does NOT mean the line is always low.  Indeed it must not be (as the SS signal must be high when the slave is not selected).
    #6
    Stefiff
    Senior Member
    • Total Posts : 99
    • Reward points : 0
    • Joined: 2012/07/15 15:26:29
    • Location: 0
    • Status: offline
    Re: What does an active low SS pin means in SPI interface? 2020/08/08 12:22:55 (permalink)
    0
    Active means the time it takes to access the slave. Only at this moment, the output/SS/ is 0. At other times the output is 1, this can be set according to the specific application. There is something else. Enhanced mode enabled is usually, and flags used are to read the data. Note that this is usually done with a delay inside the processor. For example: you send the first byte, you send the second byte, you send the third byte. Sometime around this time, the flag will set inside that you received the first byte. All this easily seen can be with a logic analyzer if you display the flags on the pins and observe them. I.e. it can happen, the output/SS/ return to 1, go into an inactive state, before you read all the bytes that are received.
    #7
    NKurzman
    A Guy on the Net
    • Total Posts : 18908
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: What does an active low SS pin means in SPI interface? 2020/08/08 13:51:52 (permalink)
    4 (1)
    Active low means when SS is low the slave is selected, when the SS is high it is deselected.
     
    #8
    Jump to:
    © 2020 APG vNext Commercial Version 4.5