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.

Serial Communication - RS232

Other Parts Discussed in Thread: HALCOGEN, RM46L852

Hi

I would like to test the SCI (UART) module of TMs570. I have TMs570 USB stick with me.

I would like to see data on hyperterminal of PC that i send from the processor.

Any ideas how setup the hardware and what need to do in the software.

Thanks in advance.

 

  • Bindu,

    I've created a Simple SCi test code that send via the SCI1 the alphabet to a serial terminal.

    This code will run on the TMS570L2x USB Stick.

    Here is some background.
    On the TMS570L2x device, you have 2 SCI. SCI1 and SCI2
    The SCI1 is connected to a FTDI chip on the USB stick. This device is a serial to USB component.
    Once you install all the demo software coming with your kit, and plug your USB Stick on your PC, windows will recognize a COM port.

    The name and address of this COM port is different from PC to PC but should be like COMxyx

    Open your windows terminal and use this COM port. Also set as 9600 bauds, 8 bits, 2 stops, no parity, no flow control.
    Open and unzip the provide test code: 3527.Simple_SCI.zip
    Start CCS and open the project Simple_SCI
    Connect to your device using TMS570LS20206SPGE.ccxml
    Load the program: debug/Simple_SCI.out
    Execute the code.

    This code has been generated (init code) using HalcoGen
    HalcoGen is a code generator for our Hercules micro controller. I highly recommend you to use it.

    In the Simple_SCI directory, you will find the following file: LIN.hcg
    This is the configuration file used in HalcoGen, You can load it in HalcoGen and see the way the device is configured.

    Please have a try and let me know if this is a good starting point.

    Regards,

    Jean-Marc

  • This is good to start.

    thanks Jean.

  • Bindu,

    If my answer covers your request, can you please mark it as "verified answer" so I can close this thread.

    Best Regard,

    Jean-Marc

  • 4087.lin.zip

    Hi Jean-Marc,

    I am working on a project in which i have to test LIN transceiver.

    I am using RM46L852 Hercules Launchpad and Halcogen for generating  the code.

    I am planning to to generate data on LIN_tx pin and then send it to the tx pin of LIN Transceiver and then connect tx pin of trnasceiver to LIN_tx on micro controller, compare both.

    Sys_main.c code is:

    #include "lin.h"
    
    /* USER CODE END */
    
    /* Include Files */
    
    #include "sys_common.h"
    
    /* USER CODE BEGIN (1) */
    
    /* USER CODE END */
    
    /** @fn void main(void)
    
    *   @brief Application main function
    
    *   @note This function is empty by default.
    
    *
    
    *   This function is called after startup.
    
    *   The user can use this function to implement the application.
    
    */
    
    /* USER CODE BEGIN (2) */
    
    #define  TSIZE1 8
    
    uint8  TEXT1[TSIZE1]= {'H','E','R','C','U','L','E','S'};
    
    #define  TSIZE2 10
    
    uint8 TEXT2[TSIZE2]= {0};
    
    #define  TSIZE3 19
    
    uint8  TEXT3[TSIZE3]= {'T','E','X','A','S',' ','I','N','S','T','R','U','M','E','N','T','S','\n','\r'};
    
    /* USER CODE END */
    
    void main(void)
    
    {
    
    /* USER CODE BEGIN (3) */
    
    /* Set length of data response in bytes (7 implies 8 bytes */
    
    while(1){
    
    linSetLength(linREG, 7);
    
    linInit();
    
    linEnableLoopback(linREG,Digital_Lbk);
    
    //linDisableLoopback(linREG);
    
    /* Checking that Tx is ready and also if the LIN bus is free (Checking BUSY flag) */
    
    while((!(linIsTxReady(linREG))) || (linREG->FLR & 0x8U == 0x8U));
    
    /*Send lin header including sync break field, sync field and identifier. */
    
    linSendHeader(linREG, 0x28);
    
    /*Send data TEXT1 */
    
    linSend(linREG,&TEXT1[0]);
    
    /* Checking if Rx is ready. */
    
       while((linREG->FLR & LIN_RX_INT) == 0U);
    
       /*Data is read from RD register and stored in TEXT2. */
    
    linGetData(linREG, TEXT2);
    
    }
    
    while(1);
    
    /* USER CODE END */
    
    }

    If i able lin loopback (linEnableLoopback(linREG,Digital_Lbk);) then even without using LIN trnasceiver, data is being transmitted but it is not showing on LIN_tx or LIN_rx pin.

    I want to use LIN transceiver as i have to test it so commented linEnableLoopback(linREG,Digital_Lbk); but this time data is not being transmitted to TEXT2(i.e.) on rx pin and also there is just a constant 3.3 v on both tx and rx pin.

    I am attaching my project file for reference.

    Where am i going wrong?

    Please guide me in this.