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.

Using SPI,CAN pins for GPIO

Other Parts Discussed in Thread: HALCOGEN

Hi, I am working on RM42x Hercules launchpad. I am falling short of GIO pins and have the following queries. 

1. Can SPI , CAN pins be used as GIO pins similar to those of GIOA and HET?  

  If yes, is there any command similar to that of gioSetBit(Port name, Bit) for SPI and CAN ports? 

2. As only 11 pins of HET are physically accessible from the launchpad, how can I use the other 8 pins of HET as output pins? I didn't understand the concept of multiplexing well evn after reading the Technical Ref. Manual.

  • Hello Nimit,

    Yes, SPI and CAN pins can be configured as GPIO pins rather than functional pins. This can be done through Halcogen or by writing to their associated pin control registers to enable/disable functional mode. If you use Halcogen, simply go to the SPIx Port Sub-Tab under the SPIx Tab where you can then configure the SPI port pins as GIO. Similarly, you can do the same for CANx.

    For the pin mux control, I would recommend using Halcogen once again to configure the pin muxing. There is a Tab labeled PIN MUX where you simply have to connect the blocks to enable a specific function on the associated pin and Halcogen will create the code to configure the pin muxing.

    Looking through the drivers generated by Halcogen, I do not see drivers to write directly to SPI and CAN pins as GPIO so you may need to write your own interface function for this or write directly to the DSET or DCLR registers for SPI and CAN in GIO mode. However, I will forward this question to our Halcogen team as well to see if there is something I might have missed.

  • Hello Nimit,

    If the prior post answered your question, please click on the verify button so we can close the thread. If you have any additional questions or need clarification, please let us know.