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.

TMS320F28335: SCI communication in between TMS320F28335 device and external device using DB9 pin connector using TTL converter for RS232 communication with LabView tool.

Part Number: TMS320F28335
Other Parts Discussed in Thread: C2000WARE

Tool/software:

Dear TI Team,

I hope this message finds you well.

I am doing Hardware Connection is like:

F28335TX to RS232 converter RX to (connected DB9 connecter) using TTL converter for its conversion of TTL output to RS232 DB9 pin connector.

F28335 RX to RS232 converter TX to (connected DB9 connecter) using TTL converter for its conversion of TTL output to RS232 DB9 pin connector.

Data transmission from F28335 to external device RS232 (LabView) reception is getting executed properly. But data reception from F28335 which is transmitted by external device RS232 (LabView) is not getting executed.

Tested for Internal loop and External loop back (by connecting TX line to RX line) is getting executed properly.

Queries:

1. Could you please suggest me, what are all the configurations need to be done?

2. Could you please correct my SCI data receiver and configuration function code as attached in X, if it is incorrect?

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
* SCI.c
*
* Created on: Aug 27, 2024
* Author: CG00844381
*/
#include "Mcu1_Device.h"
#include "SCI.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
UNS8 receivedData[4] = { 0 };
UNS16 rx_loop = 0;
void main()
{
/* Initialize system */
InitSysCtrl();
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Thanks & Regards,

Chaya

  • Hi Chaya,

    I would suggest trying to isolate which device is causing the problem. Can you scope the signal on the SCI RX pin and confirm that the UART signal coming into the F28335 is correct? 

    At first glance over your code, you also would want to read directly from RXBUF in Sci_rx() rather than the SCIRXEMU register (as this is only supposed to be used by CCS to read the RX content for the Register View). Another thing that may be good to check for is the status of the error flags in the SCIRXST register as well. You can add a breakpoint to this condition and see which error flag is being set to help assess what the issue is.

    Best Regards,

    Delaney

  • Hi, 

    USB to RS232 

    Here I am attaching waveform of 55 data is this :

    Ti board to TTL converter

     Here I am attaching waveform of 55 data is this:

    1.We found USB to RS232 converter is not as per RS232 electrical specifications always voltage level is positive. 

    2. Whereas our converter TI is compliant to RS232 protocol when we connect this, we are seeing data exchange is not happening properly can this problem due to incompatibility of voltage levels.

    3. Do you have any suggestions to improve. 

    Thanks & Regards

    Chaya 

  • Hi Chaya,

    In order for data received by the F2833x to be interpreted correctly, it has to follow the UART standard protocol with a logic high voltage level of ~3.3V and a logic low voltage level of ~0V. You will have to use a transceiver that is compliant with these specifications or add some sort of level shifter to the signal to convert it to the correct voltages.

    Best Regards,

    Delaney

  • Hi, 

    We got to know that TI board has all the conversion and translation necessary for RS232. J3 which is RS-232 compatible.  

    We tried connecting two TI boards with two TTL converters, that time we are successful to establish communication between them with no missing data. 

    Now we connected our TI board with RS-232 compatible J3 TAG to USB RS-232. This USB RS-232 is connected to LabVIEW.

    Data transmission from F28335 to external device RS232 (LabView) reception is getting executed properly. 

    But data reception from F28335 which is transmitted by external device RS232 (LabView) is not happening properly. But we are able to see waveform correctly in RX pin of J3 tag in F28335 which is transmitted by RS232 (LabView). When we trying to print data in console it is not printing expected data, data is repeated or missed. 

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    void Mcu1_Arinc429_Configuration()
    {
    SciaRegs.SCICCR.all = 0x0027;
    SciaRegs.SCICTL1.all = 0x0067;
    SciaRegs.SCICTL2.all = 0x0003;
    SciaRegs.SCIHBAUD = 0x0000;
    SciaRegs.SCILBAUD = 0x0079;
    SciaRegs.SCIFFTX.all = 0x0000;
    SciaRegs.SCIFFRX.all = 0x0000;
    SciaRegs.SCIFFRX.all = 0x0064;
    SciaRegs.SCIFFRX.bit.RXFFIL = 0x1F;
    SciaRegs.SCIFFRX.bit.RXFIFORESET = 1;
    SciaRegs.SCIPRI.bit.FREE = 1;
    SciaRegs.SCIPRI.bit.SOFT = 0;
    }
    void Receiver()
    {
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Please suggest us what we need to do to improve. 

    Thanks & Regards,

    Chaya

     

     

      

  • Hi Chaya,

    I have a few clarifying questions:

    From the F28335 perspective, the issue is with receiving data, is that correct?

    Taking a look at your code, is your Receiver() function called continuously in your main/background loop?

    The logic in this function could be causing some issues as well; do you know that the host device (LabView) will send data one character at a time?

    When we trying to print data in console it is not printing expected data, data is repeated or missed. 

    Are you talking about a COM port on your PC? Or printing to the console in a LabView program, meaning the data that is transmitted from the F28335? Either way, I would not suggest debugging this way since you are already using the transmitting line for your application. Can you try connecting a debugger and viewing the received data in CCS by looking at Received_Data_g in the Expressions view? (Note: Make sure continuous refresh is turned on)

    Best Regards,

    Delaney

  • Hi, 

    Yes, the issue is with receiving data from F28335 perspective. 

    Yes, we are calling receiver function continuously in main. 

    Host device will send 1 byte at a time. 

    We are trying to print the data received from host (LabView) to F28335 in CCS console. We are trying to print this Received_Data_g only in CCS console. 

    And also, we are able to receive only one byte of data when a stream of data is transmitted with RXD input on SCI is TTL with 0-3.3 V. 

     

    Thanks & regards,

    Chaya

  • Hi Chaya,

    Since you are operating in non-FIFO mode, you do not need to check the SCIFFRX.RXFFST fields. Can you try removing this check in the while() loop? Your code should look like this instead:

    void Receiver()
    {
    do
    {

    }while((SciaRegs.SCIRXST.bit.RXRDY == 0));

    Received_Data_g = SciaRegs.SCIRXBUF.bit.RXDT;
    for(cd=0;cd<=1000;cd++)
    {

    }

    }

    Also, can you try adding a breakpoint to the line where you read from the RX buffer and view Received_Data_g in the CCS watch window? If you still see some data missing using this method, it is likely due to a framing or break detect error, which you can check for using the flags in the SCIRXST register.

    Best Regards,

    Delaney

  • Hi, 

    Yes, we tried checking SCIRXST.bit.RXRDY field. Even when we tried like this it is same. data is getting missed. 

    Can you please check our configuration of SCI. Are we configuring correctly, are we missing any bit configuration. Can you please review our configuration. 

    void Mcu1_Arinc429_Configuration()
    {

    SciaRegs.SCICCR.all = 0x0027;
    SciaRegs.SCICTL1.all = 0x0067;
    SciaRegs.SCICTL2.all = 0x0003;
    SciaRegs.SCIHBAUD = 0x0000;
    SciaRegs.SCILBAUD = 0x0079;
    SciaRegs.SCIFFTX.all = 0x0000;
    SciaRegs.SCIFFRX.all = 0x0000;
    SciaRegs.SCIFFRX.all = 0x0064;
    SciaRegs.SCIFFRX.bit.RXFFIL = 0x1F;
    SciaRegs.SCIFFRX.bit.RXFIFORESET = 1;
    SciaRegs.SCIPRI.bit.FREE = 1;
    SciaRegs.SCIPRI.bit.SOFT = 0;

    }

    Thanks & regards, 

    Chaya 

  • Hi Chaya,

    Can you reference one of the SCI examples in C2000ware to compare your bit configurations? I don't see anything obviously wrong with the configurations myself.

    Have you tried the breakpoint approach for debugging?

    Can you also try viewing the RXST register in the debugger? It's possible there are framing or break detect errors with the data being received.

    Also, even though you are sending one byte at a time, is there any delay on the line between the bytes?

    Best Regards,

    Delaney