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.

CCS/TMS320F28027F: Echoback example in control Suite

Part Number: TMS320F28027F
Other Parts Discussed in Thread: BQ76PL455A-Q1

Tool/software: Code Composer Studio

I am using c2000 (28027F) piccolo launchpad . When i run echoback example from control suite without any changes it is running , but it takes input from keyboard and echoback it . i want to input from external uart device that is this example takes input from Rx pin of controller . What changes should i do in code so that it takes input from other serial device. 

  • Hi Indrajit,

    You can use the same code, instead of transmitting what you receive from hyperterminal (as in case of echoback example) -> you should store the value from the external uart device and process it as per your requirement.

    Regards,
    Gautam
  • thanks for quick reply . but when i run code I send some command to external device and that IC replies back that i have seen on CRO but I am not getting any signal from RX pin because it stops @ while(SciaRegs.SCIFFRX.bit.RXFFST !=1) { } line .
  • I hope you've connected RX-> TX and TX-> RX and Common the Ground between them. Also, what is this external device you mention?
  • Yes I have checked Tx-Rx pins are correctly . I am using bq76pl455A-Q1 Ic for passive cell balancing .

    This is register configuration

    void scia_init()
    {
    // Note: Clocks were turned on to the SCIA peripheral
    // in the InitSysCtrl() func tion

    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.SCICTL1.bit.RXENA=1;
    SciaRegs.SCICTL1.bit.TXENA=1;

    SciaRegs.SCICTL2.all =0x0003;
    SciaRegs.SCICTL2.bit.TXINTENA =1;
    SciaRegs.SCICTL2.bit.RXBKINTENA=1;

    // SCI BRR = LSPCLK/(SCI BAUDx8) - 1

    SciaRegs.SCIHBAUD =0x0000; // 250K @ LSPCLK = 10Mhz
    SciaRegs.SCILBAUD =0x0004;

    SciaRegs.SCICTL1.all =0x0023; // Relinquish SCI from Reset
    }

    void sciReceive(Uint32 length, uint8 *data)
    {
    while((length--)>0U)
    {
    // while(SciaRegs.SCIFFRX.bit.RXFFST !=1) { }
    // while(SciaRegs.SCIFFRX.bit.RXFFST==0) {}
    // *data = (uint8)(SciaRegs.SCIRXBUF.all);
    // *data++;
    // SciaRegs.SCICTL1.bit.SWRESET=0;
    while(SciaRegs.SCIRXST.bit.RXRDY !=1) {}
    //while(SciaRegs.SCIRXST.bit.RXRDY=0) {}
    *data=(uint8)(SciaRegs.SCIRXBUF.all);
    *data++;
    }
    }
  • Indrajit, try by enabling RX interrupt. Refer "scia_loopback_interrupts" example by disabling the loopback feature.
  • Sir actually I have added SciaRegs.SCICTL2.bit.RXBKINTENA=1; this line in above code which enable Rx interrupt
  • Did you go through scia_loopback_interrupts code? Just by enabling RXBKINTENA is not enough, you need to have an ISR too.