Multiple slaves in SPI configuration

Hi all,

This is the first time I've ever played with any microcontroller, and I'm stuck. The goal is to take my processor (I have an ADuC7026 eval board) and expand it with two external chips. I want to interface both, a better set of DACs to it as well as a DDS chip. For these expansions, I made sure to choose chips that are SPI compatible. For now, the question is where do I go from here? Snooping around, at first, I thought I would have to daisy-chain these devices, but it seems like that would be harder to deal with in code. However, it seems like I would be able to use a GPIO pin as a second chip select allowing for two independent slave selects. Is this true? And how would I go about assigning this functionality to a GPIO pin? I'd really appreciate any advice. Thanks in advance.

-Larry

Parents
  • First off: Please educate me. What is a DDS chip?

    My contribution: The SPI master only needs to emit clock and data (MOSI and MISO, i.e. master to slave and slave to master). You can connect these three signals to both your slave chips.

    Then you can pick two GPIO pins (any GPIO pins) on the master and nd connect them to the slave-select inputs of the two slave chips.

    When you want to talk with one slave chip, you activate the first GPIO signal before doing the transfer. When you want to talk with the second SPI chip, you activate the second GPIO signal.

    The slave will only care about the clock and data lines if the dedicated slave-select line is activated.

    Only one slave at a time can have the slave-select line activated. If both are activated, you will be able to send data to both slaves, but the two slaves interfere with each other about sending data back from slave to master.

    There is no corresponding master-select line on the master, since the master does not need any sleect. Being a master, you activate it by activating transfer operations. For each byte sent, you will pick up one byte received.

Reply
  • First off: Please educate me. What is a DDS chip?

    My contribution: The SPI master only needs to emit clock and data (MOSI and MISO, i.e. master to slave and slave to master). You can connect these three signals to both your slave chips.

    Then you can pick two GPIO pins (any GPIO pins) on the master and nd connect them to the slave-select inputs of the two slave chips.

    When you want to talk with one slave chip, you activate the first GPIO signal before doing the transfer. When you want to talk with the second SPI chip, you activate the second GPIO signal.

    The slave will only care about the clock and data lines if the dedicated slave-select line is activated.

    Only one slave at a time can have the slave-select line activated. If both are activated, you will be able to send data to both slaves, but the two slaves interfere with each other about sending data back from slave to master.

    There is no corresponding master-select line on the master, since the master does not need any sleect. Being a master, you activate it by activating transfer operations. For each byte sent, you will pick up one byte received.

Children
More questions in this forum