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.

RM41L232: LINport pins configured as GPIO

Part Number: RM41L232
Other Parts Discussed in Thread: HALCOGEN

Hi team,

 

I have been helping a customer try to get the LINport (LINRX and the LINTX) configured as a GPIO using HalCoGen and its not working out too well.

 

Does someone happen to have an example showing this?

 

I looked in the package locally at:

 

C:\ti\Hercules\HALCoGen\v04.07.00\examples\RM42x_41x

 

There unfortunately isn’t anything usable to help show this there.

 

Here is the latest from them, and what’s had me reach out to yall:

 

So I tried following the “example_rtiBlinky.c” creating a whole new project and following the directions in the example with the exception of referencing the “linPORT” instead of the “hetPORT1” and it does not seem to work.  I can control other pins such as the “spiPORT1” pins just fine following this example but the “linPORT” does not seem to respond or change the level of the pins.

 

 

Please let me know what you think about this.

 

Thanks,

Billy

 

  • Hello Billy,

    There is nothing special about the LIN pins. Simpy configure them as GPIO in Halcogen as shown below

    Once the source is generated, you would need to call the linInit function in main and then use the GPIO function to set and clear the bits associated with the LINTX and LIN RX pins.

    i.e., in main do the following

    main()

    {

       linInit(); // initialize the LIN module; specifically, initializes LINTX and RX pins in non-funcitonal mode, DIR=output, Pullup enabled, no open drain, etc

    while(1)

       {

            // Toggle LINTX pin

            gioSetBit (linPORT, PIN_LIN_TX);

            //Toggle LINRX pin

            gioSetBit (linPORT, PIN_LIN_RX);

     // ************* insert some delay or call gioSetBit from within an RTI interrupt after initializing and setting up to generate some sort of pattern on the LIN TX and RX pins

       }

    Since the pin control registers of the LIN port only have the TX and RX pins in them with the rest being reserved, you should also be able to replicate the blinky example and call the port functions using the linPORT as the base address.

  • Thanks Chuck!

    That bit of extra help did it!

    -Billy