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.

F28069<==> PC via SCI, RX does not work ,but TX works fine

Other Parts Discussed in Thread: CONTROLSUITE, MOTORWARE, TMDSCNCD28069ISO

I am using TMDSCNCD28069MISO controlCARD.

I modify those sample code (echoback/loopback in controlSUITE).

When I use the loopback function in my code, RX and TX work fine.

When I close loopback function, I can transmit data from DSP to PC, but i am unable to receive anything from PC. My code halt this line

while(SCI_getRxFifoStatus(obj4->sciHandle[0]) != 256) { }. The ReceivedChar variable value also 0.

I can't figure out what I am doing wrong.

Please help. Thanks a lot.

Below is my code.

GIPO setting:

// GPIO28

GPIO_setPullup(obj->gpioHandle, GPIO_Number_28, GPIO_Pullup_Enable);

GPIO_setQualification(obj->gpioHandle, GPIO_Number_28); //GPIO_Qual_ASync

GPIO_setMode(obj->gpioHandle,GPIO_Number_28,GPIO_28_Mode_SCIRXDA);

 

// GPIO29

GPIO_setPullup(obj->gpioHandle, GPIO_Number_29, GPIO_Pullup_Enable);

GPIO_setMode(obj->gpioHandle,GPIO_Number_29,GPIO_29_Mode_SCITXDA);

 

SCI setting:

void HAL_setupScis(HAL_Handle handle)

{

        HAL_Obj  *obj = (HAL_Obj *)handle;

        SCI_resetChannels(obj->sciHandle[0]);

        SCI_resetTxFifo(obj->sciHandle[0]);

        SCI_enableTxFifoEnh(obj->sciHandle[0]);

        SCI_clearTxFifoInt(obj->sciHandle[0]);

        SCI_enableRxFifo(obj->sciHandle[0]);

        SCI_clearRxFifoInt(obj->sciHandle[0]);

        SCI_setRxFifoIntLevel(obj->sciHandle[0],SCI_FifoLevel_4_Words);

        SCI_setCharLength(obj->sciHandle[0],SCI_CharLength_8_Bits);

        SCI_enableTx(obj->sciHandle[0]);

        SCI_enableRx(obj->sciHandle[0]);

        SCI_setBaudRate(obj->sciHandle[0],SCI_BaudRate_230400_Baud);

        SCI_setPriority(obj->sciHandle[0],SCI_Priority_FreeRun);

        SCI_enable(obj->sciHandle[0]);

        SCI_enableTx(obj->sciHandle[0]);

        SCI_enableRx(obj->sciHandle[0]);

}

 

main fuction:

for(;;)

{

        if(a==1)

        {

                scia_xmit(SendChar);

                HAL_Obj *obj4 = (HAL_Obj *)halHandle;

                while(SCI_getRxFifoStatus(obj4->sciHandle[0]) != 256) { } // wait  for RRDY/RXFFST =1 for 1 data available in FIFO

                //Check received character

                ReceivedChar = SCI_read(obj4->sciHandle[0]);

                // Move to the next character and repeat the test

                SendChar=SendChar+1;

                //Limit the character to 8-bits

                SendChar &= 0x00FF;

        }

} // end of for(;;) loop

  • Dear Motorware Team,

    My co-worker had have the same result with F28054F. Although we tested successfully with F28055 with the same code.

    Whether the InstaSPIN DSP have an errata or not?

    With kind regards,
  • Hello,
    I think this line should be:
    while(SCI_getRxFifoStatus(obj4->sciHandle[0]) == 0) {} ?

    Best regards,
    Maria
  • I try to write while(SCI_getRxFifoStatus(obj4->sciHandle[0]) == 0) {} in my code. But it also not work.......
  • Huang,

    Please make sure that you configure position 2 of SW3 correctly. 

    It decides whether the FTDI chip will connect to the F28069 device. 

    Please review the schematics of the controlCARD within controlSUITE:
    \controlSUITE\development_kits\~controlCARDs\TMDSCNCD28069ISO_v1_1\R0_4\

    ===

    Tran Binh Duong,

    You are likely running into a similar problem.  The F2805x controlCARD also has a switch for enabling/disabling the FTDI UART's RX path.


    Thank you,
    Brett

  • Hi Brett Larimore,

    I check the position 2 of SW3, it always on.

    But RX not work.....

    I think the J1 connect can work in JTAG function and UART function simultaneously???

    i.e. J1 connect only choose one function.

    Thank you.

  • Hi Huang,

    Do you see any voltage switching on SW3's pin 4? 

    If so, this can prove that the UART/SCI signal is getting to the C2000 device.

    The FTDI chip can do JTAG and UART at approximately the same time.  I say approximately because the FTDI chip may send the UART 'packets' between several JTAG 'packets'.


    Thank you,
    Brett

  • Hi Brett Larimore,

    I see my voltage not switching on SW3's pin 4 by oscilloscope.

    So I check the U21 IC on the board, I find my pin2 and pin7 of U21 is broken.

    I use the pin3 and pin6 of U21 replacing the pin2 and pin7 of U21.

    After testing, RX function work.

    Therefore, it is my hardware problem, not my code issue.

    I can receive the data from my pc and solve the RX problem.

    Thank you very much.