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.

F28335 Peripheral Explorer SCIa problems

Other Parts Discussed in Thread: CONTROLSUITE

Hi,

I am using F28335 ControlCARD R2.2 and  the Peripheral Explorer to acquire some data from sensors, which I intend to send to a PC through SCIa/USB. I've followed some examples but the results are not satisfactory so far.
I am able to see values changing on SCITXBUF and the SCICTL2 is equal to 0x00C0, meaning that TXRDY and TXEMPTY are both equal to 1 and therefore ready to transmit data.
I presume that this is the right behaviour when sending data to PC, right?
I'm not using TX interrupt, do I need to use it?
I'll post the configurations related to SCIa that I'm using:

GpioCtrlRegs.GPAMUX2.bit.GPIO28 = 1; // 0=GPIO 1=SCIRXDA 2=XZCS6 3=XZCS6
GpioCtrlRegs.GPAMUX2.bit.GPIO29 = 1; // 0=GPIO 1=SCITXDA 2=XA19 3=XA19

void scia_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 =0x0002; // enable TX, disable RX, internal SCICLK,
// Disable RX ERR, SLEEP, TXWAKE

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

SciaRegs.SCICTL2.all =0x0000;
// SciaRegs.SCICTL2.bit.RXBKINTENA =1;
// SciaRegs.SCICTL1.all =0x0022; // Relinquish SCI from Reset

SciaRegs.SCIHBAUD = 243 >> 8; // Highbyte
SciaRegs.SCILBAUD = 243 & 0x00FF; // Lowbyte 19200bps

// Reset FIFO's
SciaRegs.SCIFFTX.all=0x8000;
SciaRegs.SCIFFTX.all=0xE040;
SciaRegs.SCIFFCT.all=0x0000; // Set FIFO transfer delay to 0

// SciaRegs.SCIFFTX.all = 0xC060; // bit 15 = 1 : relinquish from Reset
// bit 14 = 1 : Enable FIFO
// bit 6 = 1 : CLR TXFFINT-Flag
// bit 5 = 1 : enable TX FIFO match
// bit 4-0 : TX-ISR, if TX FIFO is 0(empty)

// Added for transmit - very important
SciaRegs.SCIFFTX.bit.TXFIFOXRESET = 1; // re-enable transmit fifo operation

}

void scia_xmit(int a){

SciaRegs.SCITXBUF = a;
// wait for previous char to go out.
while (!SciaRegs.SCICTL2.bit.TXEMPTY) {}
GpioDataRegs.GPBTOGGLE.bit.GPIO34 = 1; // Led 3
}

 


I will just send data from F28335 to PC and not the other way back... 

Am I missing some configuration?
I've seen some posts on this forum related to hardware issues when trying to put SCIa to work but I couldn't find any relation to the board version that I'm using.

Thanks in advance,

Mário

  • Hi Mário,

    How are you connecting the Peripheral Explorer board to your computer? 

    1. By J12? 
    2. Or by using the USB-to-UART path via [M1]-JP1 and [M1]-U1?


    If using (1), I would recommend disabling (2) to avoid contention.  The easiest way is to make sure [M1]-J4 is not populated.  You'll also need to make sure that the controlCARD's SW1 is in the ON position.

    If using (2), you need to do the inverse of the settings above: [M1]-J4 populated & cCARD's SW1 in OFF position.

    Please refer to the schematics for the cCARD and the Peripheral Explorer which can both be found in controlSUITE.

    Hopefully this helps.


    Thank you,
    Brett

  • Hi Brett, 

    thank you for replying my post.

    I'm using the USB-to-UART connection.

    Part of the problem might be solved, I already had [M1]-J4 populated but not the cCARD's SW1 in OFF position.
    Nevertheless, once I'm using only the TX part of connection (no need to send data from PC to F28335), do I need the cCARD's SW1 in OFF position??

    The problem persists even with SW1 switched OFF...Does the configuration code seemed good to you?

    Best regards,

    Mário

  • Mario,

    OK, I don't think you have any kind of hardware issue then (and yes if you will only be transmitting the position of the cCARD's SW1 does not matter. 
    Personally, I would recommend going through the SCI specific controlSUITE examples for the F2833x again.  For instance, the Echoback example should work out-of-the-box.  You can then slowly make the program your own and as you make edits you can step-by-step check that the functionality does not break. 


    Thank you,
    Brett