Part Number: MSP432P401R
Hi, I would like to use "MSP432P401R LaunchPad" for a project. Can MSP432P401R LaunchPad exchange data with two SPI slaves?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi Huang!
Since SPI is a bus, you can virtually connect as many devices as you like to a single USCI module. Every slave normally has it's own chip select, so as long as you can provide one for every device, they all can share the same MISO, MOSI and CLK line. Although a rising number of slaves would require a higher drive strength of the signals, I doubt that you plan to use tens of slaves, do you?
Additionally the MSP432P401R has eight independent USCI modules that can all do SPI, so you could connect eight different slaves that wouldn't even need to share a module. But the LaunchPad might not have all of them routed out to the headers - please double check the pinout of the board.
Dennis
Hello,
As Dennis states, you can operate multiple SPI slaves from a single MSP432P401R device as a master. Each slave would then need its own CS, chip select, pin which would be from any available GPIO.
As a general answer to your question, yes it does have this capability. If you have further questions how to implement this, please do not hesitate to ask.
Haung,
Did this answer your question and get you started? If you need more assistance getting started with SPI, Resource Explorer (Accessable via dev.ti.com or in the view tab on CCS) is a great starting point. I will be closing this thread soon since I have not heard from you recently, but if you need to re-open and ask more questions about getting this SPI connections to work, please do not hesitate to do so.
Huang,
Yes, there are examples available from www.dev.ti.com in the resource explorer. The MSP432 examples can be found under SOFTWARE->SIMPLELINK MSP432 SDK -> EXAMPLES. Here is a one example from that location and it uses the MSP432 as a SPI Master device using a single CS.
This resource explorer is also available in CCSv7 under the View tab.
Could you rephrase this question? I am not sure I understand the question.
I have a follow up question. I have two slaves I would like to connect to a single SPI eUSCI module on the MSP432. One device uses CPOL:0 CPHA:1. The other uses CPOL:1 CPHA:1, or either CPOL:0 or CPHA:0. Can I do this?
Thank you for the help, Dennis. Yes, Dennis is right that the BRW register (split into BR0 & BR1 bytes) is the divider value. There is a BRW macro definition so splitting into 2 separate values BR1/BR0 isn't needed. UCSSEL sets the source clock and then the bitrate is the source (BRCLK) divided by the BRW word. This is explained in Section 23.3.6 of the datasheet.
Luke,
I'm not completely sure if this would be the best approach or not; I am sure it would depend on your specific system. A lot of variables seem to be needed to know if changing the registers for the SPI will happen quickly enough to capture the data you are looking for in a reasonable way for your system.
A few thoughts.
1. If 14 bit resolution is enough, you could look into using the built-in ADC peripheral. (I'm guessing you've considered this already and need more resolution?)
2. You can test the method you mention here and see what results you have and decide if it works in your application through testing.
3. My suggestion: Use an additional SPI peripheral in the MSP432. One for each configuration. There are 8 available (4 on eUSCI_A, 4 on eUSCI_B). Port mapping allows added flexibility if needed. If you only have 2 slave devices in your system, each SPI module can be dedicated to a single device and no need for running in 4 pin mode since you wouldn't need CS. Right now you have CLK, MISO, MOSI, CS1, CS2 (5-pins). This way you would only need CLK1, MISO1, MOSI1, CLK2, MISO2 (5-pins). You said no MOSI2 for PGA, so total pin count is not affected.
Let me know what you think and if this seems like an appropriate route for you to take. Thanks.
Huang,
Have we answered all of your questions? I thought I saw another question (about switching to a higher rate) in my emails, but it looks like it had been deleted from the forum? Do you still have further questions?
**Attention** This is a public forum