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.

string comparison on piccolo f28021

Other Parts Discussed in Thread: TMS320F28021, CONTROLSUITE

Hi all,

I need to work on certain string manipulations on tms320f28021. I would like to hear from you whether I could find any string related functions or header files and a sample programs of it on f28021 controllers. I require to compare the uart incoming string with already stored string in the controller.

  • Hi PN,

    Yes, there is a library present for string comparison. Include this folder to your project:

    _OPT_IDECL int  strcmp(const char *_string1, const char *_string2);

    Regards,

    Gautam

  • Hi gautham

    thanks for your reply. can i implement it on ccsv5. If so, may i know which library to include in my application.  the one problem what i have using uart reception is, i have to receive 125 characters at a time. when i was doing so, i am able to get only the first character correctly, next location character will be skipped for more number of times and in the second location i am getting 10th char or 16 char iam not sure of it exactly for this. may i know what could be the problem for this. can i get all the 125 characters at a time and store in a string and then compare it. if so, could u pls explain how to do it .

  • Hi PN,

    piccolo naga said:
    can i implement it on ccsv5.

    Why not! You can also use CCS v6 too.

    piccolo naga said:
    may i know what could be the problem for this

    I hope you're using Rx interrupt routine for receiving data.

    piccolo naga said:
    may i know what could be the problem for this. can i get all the 125 characters at a time and store in a string and then compare it. if so, could u pls explain how to do it .

    For every Rx interrupt ie 1 character received store it in an array and keep incrementing its index with every forthcoming characters.

    Regards,

    Gautam

  • does this logic works or should i use another one for my application. i am using tms320f28021 on ccs v5. 

    could u suggest me one logic for this


    k=SciaRegs.SCIRXBUF.all;
    msg1[i1]=k;
    i1++;

  • piccolo naga said:

    does this logic works or should i use another one for my application. i am using tms320f28021 on ccs v5. 

    could u suggest me one logic for this


    k=SciaRegs.SCIRXBUF.all;
    msg1[i1]=k;
    i1++;

    If you refer Example_2802xScia_FFDLB.

     // Wait for inc character
        while(SCI_getRxFifoStatus(mySci) < SCI_FifoStatus_1_Word){}
    
     // Get character
        ReceivedChar = SCI_getData(mySci);

    Regards,

    Gautam

  • // Wait for inc character
        while(SCI_getRxFifoStatus(mySci) < SCI_FifoStatus_1_Word){}
    
     // Get character
        ReceivedChar = SCI_getData(mySci);

    can i write that in uart Rx  interrupt function.. ?

  • piccolo naga said:
    can i write that in uart Rx  interrupt function.. ?

    Refer scia_loopback_interrupts example for the exact implementation with interrupts.

    C:\ti\controlSUITE\device_support\f2802x\v220\f2802x_examples_drivers\scia_loopback_interrupts

    Regards,

    Gautam