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