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.

TMS570LS1224: Issue of RS232 communication between TMS570LS12x and PC

Part Number: TMS570LS1224

Hi,

I'm sorry if I made several poses. I'm doing a test for my board with TMS570LS12x launch pad. My program running in TMS570LS12x can not receive data from PC correctly. Please help me find out something wrong or what I missed.

There are two points odd.
The first one is the main function was block by function of sciIsIdleDetected for waiting an idle state of SCI as below.


The other is ISR of receiving just worked if I disable the process of waiting for idle by function of sciIsIdleDetected, but the receiving data observed via a break point was incorrect  as below.


Here is how I make the environment for my test.
Firstly, the test of uart communication in digital self-loop mode in TMS570LS12x is passed.
Then I connetc pins of LINSCI RX and TX of TMS570LS12x to the pins of ROUT1 and DIN1 of MAX3232E in my board. I also
connected the pin 2 and 3 of db9 connector for loop-back which is driven by MAX3232E in my board. The test in hard
self-loop mode is passed. The photo, schematic, layout of this part and config in HalCogen are as below.

Finally I use a USB to RS232 converter for connecting my computer and my board. The test data was sent manually in a
serial console application. The connection and configuration are like below.

Best Regards
Datïan

  • Hello Datian,

    After the SCI transmitter transmits data, the SCI is not idle. Did your SCI transmitter transmits data before the receiver detects the BUS (idle check)?

  • Hello QJ,

    Nice to meet you again. My SCI transmitter did not transmit data before the receiver detects the BUS. The only transmitting is in the loop of main function.

    int main(void)
    {
    /* USER CODE BEGIN (3) */
        int i=0;
    
        gioInit();
        mibspiInit();
        sciInit();
    
        while(sciIsIdleDetected(sciREG));//scilinREG));
        _enable_IRQ();
    
        sciReceive(sciREG, RSIZE1, (uint8 *)&RX_Text[0]);
    
        rtiInit();
        /* Enable RTI compare 0 notification */
        rtiEnableNotification(rtiNOTIFICATION_COMPARE0);
        /* Start counter */
        rtiStartCounter(rtiCOUNTER_BLOCK0);
    
        while(1)
        {
            if(command==1)
            {
                sciSend(sciREG, TSIZE1, &TEXT1[0]);
                gioToggleBit(gioPORTB, 2);
                command=0;
            }
        }
    /* USER CODE END */
    
        return 0;
    }
    
    /* USER CODE BEGIN (4) */
    void rtiNotification(uint32 notification)
    {
        command=1;
    }
    
    void sciNotification(sciBASE_t *sci, uint32 flags)
    {
        int i=0;
    
        if(RX_Text[0]==0x55
         &&RX_Text[1]==0x0a
         &&RX_Text[2]==0x40
         &&RX_Text[3]==0x01
         &&RX_Text[4]==0x00
         &&RX_Text[5]==0x04
         &&RX_Text[6]==0x33
         &&RX_Text[7]==0xbb)
        {
            gioToggleBit(mibspiPORT3, PIN_CLK);//pin7@J2, 0:pin2@J3, indicating receiving correctly
    
            for(i=0;i<RSIZE1;i++)
                RX_Text[i]=0;
        }
        else
            gioSetBit(gioPORTB, 1, 1);//indicating receiving message is incorrect
        sciReceive(sci, RSIZE1, (uint8 *)&RX_Text[0]);
    }
    /* USER CODE END */

    Kind Regards

    Datïan

  • Hi Datïan,

    After sciInit() (SCI moudle is sw reset), the SCI should enter the idle state. Your setup with wires can be easily disturbed by noise. If the SCIRX is pulled down for more than 4 SCI baud clock period, the SCI bus will be considered operating mode rather than IDLE mode.

  • Hi QJ,

    Many thanks for your information. That is really what I am warrying. Could you give me some suggestions to mitigate the effects of noise ?

    Warm Regards

    Datïan

  • Hi Datian,

    After SCI module is initialized, probe the SCI buses to see if the bus is pulled down. Both SCI TX and RX are at logic high when idle. 

  • Hi QJ,

    Many thanks. I'll probe them.

    Best Regards

    Datïan

  • Hi QJ,

    Thank you very much for your suggestion of probing SCI buses. It really help me to determine the reason of why lauchpad of TM570LS12x can not receive data from PC application. The reason is the rxd and txd of cable between DTE and DCE should be twisted.

    Here is the result as my expectation.

    Warm Regards

    Datïan