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.

CCS/RM48L952: Trying to use GIO to send CS signal

Part Number: RM48L952
Other Parts Discussed in Thread: HALCOGEN,

Tool/software: Code Composer Studio

Hello,

I am trying to get two SPI ports (SPI 1 and 2) to talk to each other using a hardware connection. Before I go on, my current setup is:

1) I am using HALCoGen v4.07 with CCSv7

2) SPI2 is master and SPI1 is the slave

3) SIMO, SOMI, and CLK are connected, and the nENA pin from SPI2 is connected to nCS[3] of SPI1

4) I changed the pin mode for nENA from "SPI" to "GIO", disabled the the DIR for SOMI on the master and SIMO on the slave, enabled GIO and SPI1/2 drivers, enabled VIM channel for SPI1 low & high signals, and disabled master mode and clock for the slave (SPI1)

Below is all of the code in my sys_main.c:

And here is where my code is essentially failing:

I started with the code provided in example_spi_Master_Slave attempted to alter it to what I need. I've managed to get SPI work using the internal loopback option, but have yet to succeed using a wired connection. I know I probably messed up somewhere in during the setup of this program, but I'm just not sure where to look. I am relatively new to embedded systems and any help/information that could be provided regarding this problem would be greatly appreciated.

  • If you are using SPI2 on the RM48L952, then this must be the BGA package, RM48L952ZWT device. In that case, SPI2nENA function is on terminal D3, which is also SPI2nCS1. Why not configure terminal D3 as SPI2nCS1 instead of using it like a GIO?

    If you want to use a GIO to do the CS function, you must add code to drive the GIO low before the SPI transmission starts, then back high again after the transmission completes. I do not see that code in your main() function.
  • I have SPI2nCS1 and SPI1nCS3 connected to each other. When I run the program, RX_Data_Slave has all '0' and RX_Data_Master has all '65565'. Do I have to change the generated .h/.c files in order to get these 2 to communicate properly?
  • Nevermind I figured it out. Just had to change the dataconfig_t.CSNR from 0xFE (CS[0]) to 0xF7 (CS[3]).