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.

LAUNCHXL2-RM46: How to capture data in UART ?

Part Number: LAUNCHXL2-RM46
Other Parts Discussed in Thread: HALCOGEN

Hello,

I am using RM46x lauchpad with a custom  specific I2C slave device i.e. I/O Expander module. I have programmed RM46x I2C using Halcogen API and CCS tool.

I need to capture Expander output into my PC terminal. As Of now I don't have any logic analyser. 

Any help/sample code regarding it & how to achieve would be greatly appreciated.

Thanks

Regards,

Vishwas 

  • Hello Vishwas ,

    You can use this example code to output the received I2C data to UART.

    For example, this statement prints DEVICE ID on PC Terminal:

    sciSend_32bitdata(sciREG1, systemREG1->DEV);

     

    /* Function used for send a 32bit data on to the SCI at the configured baud rate */

    void sciSend_32bitdata(sciBASE_t *sci, unsigned int data)

    {

    unsigned char c_get ;

    volatile int i = 0;

    for( i = 8 ; i > 0 ; i-- )

    {

    c_get = (data>>28)&15 ;

    if( c_get > 9 )

            c_get += 7 ;

    c_get += 48 ;

    while ((sci->FLR & SCI_TX_INT) == 0) { /* wait */ };

    sci->TD = c_get;

    data = data<<4 ;

    }

    }

  • Hello,

    Thank you so much for the reply QJ Wang.

    I tried implementing the function you suggested. I am facing some issues as of now.

    I am pretty much confused with the Halcogen settings for serial communication.

    As there are two drivers SCI and SCI2, can I know the initial settings for terminal output from I2C communication.

    Thanks & Regards,

    Vishwas Gunderi

  • Hi Wang,

    Still I am far behind from getting terminal output using I2C communication.

    I tried your function as well. But unfortunately I am not getting output into terminal.

    All I want is to see I2C bus data Tx and Rx from terminal.

    Is it possible to get live transmit and receive bytes from I2C bus into ccs terminal?

    Kindly guide me to achieve it.

    Regards,

    Vishwas

  • Hello Vishwas,

    Does the I2C receive the data correctly? You can use printf to print the received I2C to CCS console. To output the received I2C data to terminal, you need to use UART or SCI. The UART setting on MCU side and Terminal side should be same (baudrate, stop bit, data length, etc).

    Can you transmit a number to the terminal using sciSend_32bitdata(..) ? for example,

    sciSend_32bitdata(scilinREG, 38);

  • Hello QJ WANG,

    Sorry for late response, I was busy with some other project for time being.

    Thank you so much for your response.

    I am getting i2C data into terminal.

    Regards,

    Vishwas