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.

LAUNCHXL-F28379D: SCI looping errors

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: C2000WARE

I have SCI-B setup to transmit and receive FIFO I am using SCIA and C successfully with the same setup but B will not write from RXBUF to TXBUF.  I have these pin MUX and GMUXs and have linked those ports with a jumper wire:

EALLOW;

GpioCtrlRegs.GPAMUX2.bit.GPIO18 = 2;
    GpioCtrlRegs.GPAMUX2.bit.GPIO19 = 2;
    GpioCtrlRegs.GPAGMUX2.bit.GPIO18 = 0;
    GpioCtrlRegs.GPAGMUX2.bit.GPIO19 = 0;

EDIS;

The txbuf can be written to, but the RXBUF cannot receive that result and is stuck on a value assigned at initialization(76) these are my setup configs

Fifo 

void scib_fifo_init()
{   //initializes first in first out buffer for TX and RX
    ScibRegs.SCIFFTX.all = 0xE040;
    /*Bit 15 = 1:  SCI FIFO can resume transmit or receive. SCIRST should be 1 even for Autobaud logic to work.
    Bit 14 = 1: SCI FIFO enhancements are enabled
    Bit13 = 1:  Re-enable transmit FIFO operation
    Bit 12-8 = 0: FIFO is empty
    Bit 7 = 0: TXFIFO interrupt has not occurred, read-only bit
    Bit 6 = 1:  Write 0 has no effect on TXFIFINT flag bit, Bit reads back a zero
    Bit 5 = 0: TX FIFO interrupt based on TXFFIL match (less than or equal to) is disabled
    Bit 4-0 = 0: TXFFIL N/A
    */
    ScibRegs.SCIFFRX.all = 0x2044;
    /*Bit 15 = 0:    Receive FIFO has not overflowed, read-only bit
    Bit 14 = 0: Write 0 has no effect on RXFFOVF flag bit, Bit reads back a zero
    Bit13 = 1:   Re-enable receive FIFO operation
    Bit 12-8 = 0: FIFO is empty
    Bit 7 = 0: RXFIFO interrupt has not occurred, read-only bit
    Bit 6 = 1:   Write 1 to clear RXFFINT flag in bit 7
    Bit 5 = 0:  RX FIFO interrupt based on RXFFIL match (greater than or equal to) will be disabled
    Bit 4-0 = 0: RXFFIL N/A
    */
    ScibRegs.SCIFFCT.all = 0x0;
    /*Bit 15 = 0: Auto-baud detection is not complete. "A","a" character has not been received successfully.
    Bit 14 = 0:  Write 0 has no effect on ABD flag bit. Bit reads back a zero.
    Bit 13 = 0:   Disables auto-baud alignment
    Bit 12-8 = 0: Reserved
    Bit 7-0 = 0: FFTXDLY Reset set pause between character detections on the RX and TX FIFOs 0-> 0 baud delay
    */
    }

init

void scib_init()//used for usb transfer if broken look at example code in TI C2000ware
{
   // 1 stop bit,  No loopback, No parity,8 char bits, async mode,
   // idle-line protocol
   ScibRegs.SCICCR.all =0x0007;
   //SETS CHAR LENGTH TO 8 BIT FOR SCI COMMUNICATIONS
   // enable TX, RX, internal SCICLK, Disable RX ERR, SLEEP, TXWAKE
   ScibRegs.SCICTL1.all =0x0003;
   //Bit 0 = 1: Send received characters to SCIRXEMU and SCIRXBUF
   //Bit 1 = 1: Transmitter enabled
   ScibRegs.SCICTL2.bit.TXINTENA =1;
   //TXINTENA ENABLES TX INTERRUPTS AND IS ASSOCIATED WITH CCTL2 BIT 0
   ScibRegs.SCICTL2.bit.RXBKINTENA =1;
   //RXBKINTENA ENABLES RX INTERRUPTS AND IS ASSOCIATED WITH CCTL2 BIT 1
   //SET Baud 9600
   ScibRegs.SCIHBAUD.all = 0x0002;
   ScibRegs.SCILBAUD.all = 0x008B;
   ScibRegs.SCICTL1.all =0x0023;
   // Relinquish SCI from Reset
    return;
}
Is there any reason that the same init methods just changing the Scix reg that is referenced would not work on SCI B but would work on C and A?  or is there something in any setup that I have missed
  • Hi Christian,

    Yes, the same code with SciX replaced with SciY should generally work, but you'll also want to double check the GPIO hookup, GPIO muxing, PIE and ISR configurations, and peripheral clock enable, which are not configured in the SCI module but outside via various other configs that will need unique configurations for the specific module in question.

    For example, to verify the GPIO hook-up, you might set both GPIO as GPIO via the mux and then one GPIO in output mode, one in input mode, and then toggle the output and verify that it shows up in the data registers of the input.  You can then switch the direction and verify again.  All of this can be done from the expressions window without writing additional code, if desired.

    To verify the GPIO muxing, consult the datasheet to ensure the specific SCI module is on those pins and that the mux settings are correct, then run your initialization code and then verify in the expressions window that the settings made it into the registers (if they did not, a missing 'EALLOW' could be the issue).

    Similar verification can be done on the peripheral clock enable and PIE settings.  

  • Hi Christian,

    Any luck debugging this issue?  

  • No I have decided to go another route, I believe it could've been a hardware limitation or I hadn't set up the clock on cpu2 correctly