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.

SCI Problems with TMS320F28023



 Hello,

I am having trouble getting the sci_echoback project working with my TMS320F28023DA. I went through all the header files and set the appropriate values.

#define DSP28_DIVSEL   2 // Enable /2 for SYSCLKOUT

#define DSP28_PLLCR   10      // Uncomment for 50 Mhz devices [50 Mhz = (10MHz * 10)/2]

#define CPU_RATE   20.000L   // for a 50MHz CPU clock speed  (SYSCLKOUT)

The SCI is initialized with the scia_fifo_init() and scia_echoback_init() functions which are shown below.

// Initalize the SCI FIFO
void scia_fifo_init()
{
    SciaRegs.SCIFFTX.all=0xE040;
    SciaRegs.SCIFFRX.all=0x2044;
    SciaRegs.SCIFFCT.all=0x0000;

}

// Test 1,SCIA  DLB, 8-bit word, baud rate 0x000F, default, 1 STOP bit, no parity
void scia_echoback_init()
{
    // Note: Clocks were turned on to the SCIA peripheral
    // in the InitSysCtrl() function

    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.all =0x0003;
    SciaRegs.SCICTL2.bit.TXINTENA =1;
    SciaRegs.SCICTL2.bit.RXBKINTENA =1;

    // SCI BRR = LSPCLK/(SCI BAUDx8) - 1
    #if (CPU_FRQ_60MHZ)
        SciaRegs.SCIHBAUD    =0x0000;  // 9600 baud @LSPCLK = 15MHz (60 MHz SYSCLK).
        SciaRegs.SCILBAUD    =0x00C2;
    #elif (CPU_FRQ_50MHZ)
        SciaRegs.SCIHBAUD    =0x0000;  // 9600 baud @LSPCLK = 12.5 MHz (50 MHz SYSCLK)
        SciaRegs.SCILBAUD     =0x00A1; 
    #elif (CPU_FRQ_40MHZ)   
        SciaRegs.SCIHBAUD    =0x0000;  // 9600 baud @LSPCLK = 10MHz (40 MHz SYSCLK).
        SciaRegs.SCILBAUD    =0x0081;
    #endif

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

If I have setup everything correctly and calculated the baud constants correctly, this should be setup to communicate at 9600 baud. I tried calculating several other baud rates, but none of them worked. I am using the Hyperterminal config file provided with the example.

One thing I noted that was odd is that the datasheet lists this processor as 50 MHz, but when I look at the values in the F28xx On-Chip Flash Programmer it shows up as 40 MHz. Am I missing something here?

Any help with this problem will be greatly appreciated.

Thanks,

-Russell Morin