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.

TMS320F28054M: sci communication problem

Part Number: TMS320F28054M

Hi TI,

I am working with sci communication from f28054M to f28054M

In software, I set up both F28054M GPIO28 as RX and GPIO29 as TX

I cross wired RX--> TX and TX-->RX from one to another.

BUT, I am NOT able to make them communicate to each other.

Then, I made following changes to make them actually work which cause more confusion to me:

In software, I set up one of them's GPIO to

GPIO28 to TX

GPIO29 to RX

and another as:

GPIO28 to RX

GPIO29 to TX

Then it works! But I don't get it.

I double check my hardware connections, I am very positive that I connect RX-->TX and TX -->RX.

Does anyone know why this is happening?

  • Qiang,

    Can you check with an oscilloscope if anything  comes out on the TX or RX pins?

    Secondly, can you provide me your GPIO configurations for both devices?

    Regards,
    Cody

  • Here is my GPIO settings:

      // SCI-RX
      GPIO_setMode(obj->gpioHandle,GPIO_Number_28,GPIO_28_Mode_SCIRXDA);      //Configure GPIO28 for SCIRXDA operation
      GPIO_setPullup(obj->gpioHandle,GPIO_Number_28,GPIO_Pullup_Enable);      //Enable pull-up GPIO28
      GPIO_setQualification(obj->gpioHandle, GPIO_Number_28, GPIO_Qual_ASync);//Configure GPIO28 as Asynch input
    
      // SCI-TX
      GPIO_setMode(obj->gpioHandle,GPIO_Number_29,GPIO_29_Mode_SCITXDA);     //Configure GPIO29 for SCITXDA operation
      GPIO_setPullup(obj->gpioHandle,GPIO_Number_29,GPIO_Pullup_Enable);     //Enable pull-up GPIO28

    If I set both F28054M as above, it won't work as expected, But I do get values when I transmit the data from one to anther, but it's  not correct data that I've sent.

    But If I set one of the GPIO as following:

      // SCI-RX
      GPIO_setMode(obj->gpioHandle,GPIO_Number_29,GPIO_29_Mode_SCIRXDA);      //Configure GPIO29 for SCIRXDA operation
      GPIO_setPullup(obj->gpioHandle,GPIO_Number_29,GPIO_Pullup_Enable);      //Enable pull-up GPIO29
      GPIO_setQualification(obj->gpioHandle, GPIO_Number_29, GPIO_Qual_ASync);//Configure GPIO29 as Asynch input
    
      // SCI-TX
      GPIO_setMode(obj->gpioHandle,GPIO_Number_28,GPIO_28_Mode_SCITXDA);     //Configure GPIO28 for SCITXDA operation
      GPIO_setPullup(obj->gpioHandle,GPIO_Number_28,GPIO_Pullup_Enable);     //Enable pull-up GPIO28

    I can get correct values, but not immediate responses, I have to restart my debugged mode then I can read the correct value when I start the debugged mode again.

  • Qiang,

    First of all its a good idea to establish a common ground, if you haven't yet.

    Second, did you start from an example project? If so, which one and could you check if internal loopback is enabled? There is a bit(SCICCR.LOOPBACKENA) that internally connects SCIx Rx to SCIx Tx, it is possible that if you were driving signals to the pins externally and internally connecting Rx to Tx then you may get bad data.

    Please let me know if find anything out!

    Regards,
    Cody

  • I found out, it's CLK issue. I am using external clk feed into my F28054M, and the external clk frequency is 15MHz.
    Where can I set my system clk frequency to match with external clk frequency?
  • Qiang,

    the clocking tree can be quite complex, it is covered in section 1.2 of the Technical Reference Manual (TRM).

    Note: LSPCLK is what drives the SCI module. A few helpful registers will be PLLCR, and PLLSTS, you can find a description of these in the same TRM.

    If you would like to check your clock speed you can use XCLKOUT to bring a clock out on a pin for observation, this is covered in section 1.2.2.7 of the TRM.

    Regards,
    Cody