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.

Microcontroller Communication

Other Parts Discussed in Thread: HALCOGEN

Dear All,

           I am having two RM42x launchpad. I would like to make them communicate for data exchange.

           I tried it by using SPI2. But I could not make it. 

          I am using Code Composer Studio (Version 5.5.0) and HALCoGen (Version 03.06.00).

          For sending the data from launchpad_1 to launchpad_2, I kept SPI2 of launchpad_1 in master mode and used following code,

                            spiTransmitData(spiREG1,0,5,a);

           For receiving the data from launchpad_1 to launchpad_2, I kept SPI2 of launchpad_2 in slave mode and used following code,

                           spiReceiveData(spiREG1,0,5,b);

          Please tell me where I am wrong to make them communicate.

Regards

Sathiyaraj M

  • Hello:

    If you are using the register pointers defined in reg_spi.h, spiREG1 is used for SPI1, not for SPI2. You should use spiREG2.

    Why are you passing a "0" as the second parameter? You should create your data configuration structure and pass its reference to both API's.

    Please take a look at the provided example in Halcogen (example_spi_Master_Slave). It doesn't use the exact API's you are using but you can get some ideas about the correct usage.

    Regards.