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 with the tms320f28069

Other Parts Discussed in Thread: TMS320F28069, CONTROLSUITE

I am working on a project using the TMS320F28069, I am trying to communicate with a PC or a terminal using the serial communication. I used to use  the following function from STELLARIS WARE : UARTStdioInit(), UARTPrintf(),UARTgets(),….

Are there functions or similar available for the TMS320F28069 ? 

Any help will be appreciated

Thanks 

Hamid

  • Hi Hamid,

    You can directly configure SCI peripheral to communicate with PC. This is the best way.
    Other similar approach is to use printf which is pretty high on memory consumption.
    processors.wiki.ti.com/.../Tips_for_using_printf

    What h/w are you using?

    Regards,
    Gautam
  • Hi Gautam
    thank you for your fast answer
    I am using a custom board and the memory is not a problem.
    Also I am interested to the buffered serial communication and I prefer not start from the scratch
    Please do you have any examples that work with printf() and how to select the UART that will work with printf since I have 2 UARTs in the TMS320F20069 ?
    These functions UARTStdioInit(), UARTPrintf(),UARTgets() developped for the STELLARIS WARE are very convenient do you have somthing similar for the tms320f28069?

    hamid
  • This thread would prove to be useful : e2e.ti.com/.../230323
  • Thanks again
    I will go through and let you know
    Just one question where I have to specify the UART to use since I have 2 in my processor for printf ?
  • Hi Gautam,
    In the thread :
    e2e.ti.com/.../984603
    I saw Trupti using UARTStdioInit(), UARTPrintf(),... I am just wondering if he adapted these functions to work with the TMS320f20069 !!
    I am very interested to use them.
    Best Regards
    Hamid
  • Lets see what Trupti comes up with.
  • Hi Gautam,

    No luck  , no answer from Trupi.

    Any idea ?

    Thanks

    Hamid

  • Why don't you burst data directly through UART? Also, try searching the forum for any related query.
  • Hi Gautam

    I found my answer in the tread :

     e2e.ti.com/.../206792

    Library located here:  C:\ti\controlSUITE\device_support\f2806x\v130\MWare\utils

    Please I have one question:

    I am trying to run the example : Example_2806xSci_FFDLB_Int    

    I am using CCS ver 6.1   during compilation I have the error :

    "C:\ti\controlSUITE\device_support\f2806x\v150\F2806x_headers\include\F2806x_Usb.h", line 1076: error:
    identifier "Uint64" is undefined

    but Uint64 is defined in f2806x_Device.h


    #ifndef DSP28_DATA_TYPES
    #define DSP28_DATA_TYPES
    typedef int int16;
    typedef long int32;
    typedef long long int64;
    typedef unsigned long long Uint64;
    typedef float float32;
    typedef long double float64;
    #endif

    Thanks for your help

    Hamid

  • That's Great!

    Goodluck & Regards,
    Gautam
  • hamid said:

    "C:\ti\controlSUITE\device_support\f2806x\v150\F2806x_headers\include\F2806x_Usb.h", line 1076: error:
    identifier "Uint64" is undefined

    but Uint64 is defined in f2806x_Device.h


    #ifndef DSP28_DATA_TYPES
    #define DSP28_DATA_TYPES
    typedef int int16;
    typedef long int32;
    typedef long long int64;
    typedef unsigned long long Uint64;
    typedef float float32;
    typedef long double float64;
    #endif

    Hamid - Have you resolved the issue? 

    It is possible a different copy of DSP28_DATA_TYPES is being pulled in from another file.

    -Lori

  • Hamid,

    I imported the same example as you, Example_2806xSci_FFDLB_int, from directory C:\ti\controlSUITE\device_support\f2806x\v150\F2806x_examples_ccsv5\scia_loopback_interrupts.
    I was able to build the project without any errors. Have you modified the project settings or code?

    I would recommend opening a new workspace, importing the project from controlSUITE, and building it.

    If any errors still persist, you can update controlSUITE. There is a newer version (v151) for f2806x device support that you can try.

    Elizabeth
  • Thank you   Elizabeth   and Lori,

    Yes by openning a new workspace  the problem is solved.

    Please I need clarification on how the fifo interruption works :  I would like to have interruption every time the buffer is empty. if I use  do : SciaRegs.SCIFFTX.all=0xC022    is that mean I will have interruption when I have 2 chars in the fifo buffer ?  I know its explained in the manual but not clair for me.

    any help will be appreciated.

    __interrupt void sciaTxFifoIsr(void)

    {
    Uint16 i;

    //

    //  code

    //

    SciaRegs.SCIFFTX.bit.TXFFINTCLR=1; // Clear SCI Interrupt flag
    PieCtrlRegs.PIEACK.all|=0x100; // Issue PIE ACK
    }

    void scia_fifo_init()
    {
    SciaRegs.SCICCR.all =0x0007; // 1 stop bit, No loopback
    // No parity,8 char bits,
    // async mode, idle-line protocol
    SciaRegs.SCICTL1.all =0x0003; // enable TX, RX, internal SCICLK,
    // Disable RX ERR, SLEEP, TXWAKE

    //SciaRegs.SCICTL2.bit.TXINTENA =1;

    SciaRegs.SCICTL2.bit.RXBKINTENA =1;
    SciaRegs.SCIHBAUD = 0x0000;
    SciaRegs.SCILBAUD = SCI_PRD;
    SciaRegs.SCICCR.bit.LOOPBKENA =0; // Enable loop back
    SciaRegs.SCIFFTX.all=0xC022;

    SciaRegs.SCIFFRX.all=0x0022;


    SciaRegs.SCIFFCT.all=0x00;

    SciaRegs.SCICTL1.all =0x0023; // Relinquish SCI from Reset
    SciaRegs.SCIFFTX.bit.TXFIFOXRESET=1;
    SciaRegs.SCIFFRX.bit.RXFIFORESET=1;

    }

  • Hamid,

    The line SciaRegs.SCIFFTX.all=0xC022 means that a transmit (TX) FIFO interrupt is generated every time that there are 2 or less words in the TX buffer as 2 is the value of the bits 4-0 of the SCIFFTX register.
    The following line SciaRegs.SCIFFRX.all=0x0022 means that a receive (RX) FIFO interrupt is generated every time there are 2 or more words in the RX buffer as 2 is the value of bits 4-0 of the SCIFFRX register.
    You should set bits 4-0 to the value 0 in the SCIFFTX register to generate TX FIFO interrupts whenever the TX buffer is empty, so the code would look like this:
    SciaRegs.SCIFFTX.all=0xC020;

    Elizabeth
  • Hi Elizabeth,
    Thank you very much for the clarification.
    I opened another thread related to the Fifo buffer could you please take a look and let me know your opinion
    your help is very appreciated.
    e2e.ti.com/.../511745
    Hamid
  • Thanks for the update, Hamid. I'll take at look at your other thread.