EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / SPI SS pin Master configuration when /CS pin Slave always connected to GND?

SPI SS pin Master configuration when /CS pin Slave always connected to GND?

|

Microcontroller › AVR › SPI SS pin Master configuration when /CS pin Slave always connected to GND?

  • This topic has 0 replies, 1 voice, and was last updated 14 years, 2 months ago by bugserm.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • February 4, 2012 at 2:53 am #3879
    bugserm
    Participant

     

    Hallo all.. 

    In the datasheet atmega 88pa states that: 

    When the SPI is configured as a Master (MSTR in SPCR is set), the user can determine the direction of the SS pin. 

    If SS is configured as an output, the pin is a general output pin which does not affect the SPI system. Typically, the pin will be driving the SS pin of the SPI Slave. 

    If SS is configured as an input, it must be held high to ensure Master SPI operation. If the SS pin is driven low by peripheral circuitry when the SPI is configured as a Master with the SS pin defined as an input, the SPI system interprets this as another master selecting the SPI as a slave and starting to send data to it 

    I have only 1 master (atmega88) & 1 slave(adt7310 temperature sensor).so I connected my cs pin of the slave to GND. That means the adt7310 is always selected as slave. 

    If I just set the SS pin as Output as shown below..my sensor will not working (not giving any readings). In Datasheet atmega88 it clearly states that I can set SS pin as Output without affecting SPI system. Theoretically this setting should work but it doesn't. Why? Could anybody explains? 

    Code:
    DDR_SPI = (1<<DD_MOSI)|(1<<DD_SCK); // MOSI and SCK output 
    DDR_SPI|= (1<<DD_SS);            // SS output 

    My sensor give readings when SS pin is set as Output & then set high as below: 

    Code:
    DDR_SPI = (1<<DD_MOSI)|(1<<DD_SCK); // MOSI and SCK output 
    DDR_SPI|= (1<<DD_SS);            // SS output 
    PORTB|=(1<<DD_SS); // Set SS pin high

    My sensor also gives readings when SS pin is set as Input & then set high as below: 

    Code:
    DDR_SPI = (1<<DD_MOSI)|(1<<DD_SCK); // MOSI and SCK output 
    DDR_SPI|= (0<<DD_SS);            // SS Input 
    PORTB|=(1<<DD_SS); // Set SS pin high

     

  • Author
    Posts
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • compile errors April 22, 2026
  • Quick Tip: Handling CH340 Driver Issues on Uno SMD Clones April 22, 2026
  • My Advanced Realistic Humanoid Robots Project April 22, 2026
  • Getting into an LED bulb April 21, 2026
  • understanding of resonance in time domain April 21, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise