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.

TMS320F28379D: Using IPC to perform SPI data transaction on CPU2 in parallel with code executing on CPU1

Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE

I am running a piece of code that uses an SPI module to get readings from sensors. The SPI data transaction, even when optimised takes considerable time. 

I want to write a piece of code that uses the IPC module to trigger the SPI data transaction on CPU2 and then send the data back through to CPU1 where it is used in the ISR running on CPU1. 

Currently, my code is structured as follows:

Main code (CPU1)
--------------------------

* Setup GPIOs
* Setup peripherals (SPI, ADC ePWM, etc...)
* Setup ISR (triggers every ePWM carrier period)

ISR
---------------------------
* Read sensor data
* Read current
* Execute control algorithm 
* Acknowledge ISR, enabling further interrupts

I had a few questions to how I'd be able to do this. It seems as though I can't set up GPIOs on CPU2?


  • Hi,

    GPIO Configuration needs to be done by CPU1 only. CPU1 can assign the ownership of the GPIO to CPU2 and CPU2 can take control of changing the data out (when the pin is in GPIO mode). In your case, you need to configure the SPI pins from CPU1 application and assign the ownership to CPU2. CPU1 should also configure the ownership of SPI module to CPU2. SPI initialization code can be on CPU2 application.

    You may refer to any dual core examples in C2000ware as reference

    Regards,

    Veena