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.

TMS570LS0714: LIN as GIO

Part Number: TMS570LS0714
Other Parts Discussed in Thread: HALCOGEN

Hello, I want to use LIN pins as GIO but I ma not sure about the register I have to use as GI.
I think I shoud use thi function:

RD6= gioGetBit(linPORT, PIN_LIN_TX);
RD5= gioGetBit(linPORT, PIN_LIN_RX);

Is that correct? Am I taking the velue of the TX and RX LIN pins?

  • I have to set 8 bit in a byte, but with the function gioGetBit I have the error #41 expected an identifier. In addition linPORT is undefined. 

    uint32 RD7=gioGetBit(gioPORTB,1); //get the current value of BIOB[1]. Pin 133 uC.
    uint32 RD6= gioGetBit(linPORT, 1);
    uint32 RD5= gioGetBit(linPORT, 2);
    uint32 RD4= gioGetBit(mibspiPORT1,1); //get the current value of MIBSPI1NCS[0]. Pin 130 uC.
    uint32 RD3=canREG2->RIOC &1U; //get the current value of the RX pin of that CAN port (2). Pin 129 uC
    uint32 RD2=canREG2->TIOC &1U; //get the current value of the TX pin of that CAN port (2). Pin 128 uC
    uint32 RD1= gioGetBit(hetPORT1,3); //get the current value of N2HET1[30]. Pin 127 uC.
    int8_t DATA = RD1 | (RD2 << 1) | (RD3 << 2) | (RD4 << 3) | (RD5 << 4) | (RD6 << 5) | (RD7 << 6);

  • Firstly, in HalCoGen configure Lin tab:
    LIN Port -> change TX Pin Mode and Rx Pin Mode to GPIO. On the same Tab you can change direction you want (input/output).

    Include reg_gio.h in your sourc file. Thre you will find macro for TX and RX pins (eg. PIO2, ...).

  • You can use GIO APIs (gioGetBit(linPORT, 1) etc). As Michal mentioned, you have to configure LINTX and LINRX as GIO pins first.