We're looking to setup SCI-A on a TMS320F28335 eZdsp board as a transmit-only non-periodic messaging system for diagnostic and coverage data as pulling large amount of data over the debugger/USB connection is very slow (5-10 minutes for 20kb text file).
We've followed through the SCI Echoback example contained in the controlsuite and tried to set up the initial configuration to match that; however, the data transmitted out once it has been placed into the SCITXBUF is garbage/corrupted on the terminal screen.
The current initialization sequence is as follows:
InitializeSys() { InitializePLL(0xA, 0x2); SysCtrlRegs.PCLKCR0.bit.SCIAENCLK = 1; InitializeInterrupts(); InitializePieVectors(); InitializeFlash(); GpioCtrlRegs.GPADIR.bit.GPIO29 = 1; GpioCtrlRegs.GPAPUD.bit.GPIO29 = 0; GpioCtrlRegs.GPAMUX2.bit.BPIO29 = 1; InitializeADC(); InitializeI2C(); InitializeSPI(); InitializeMcBSP(); InitializePWM(); InitializeTimers(); SciaRegs.SCIFFTX.all = 0xE040; SciaRegs.SCIFFRX.all = 0x204F; SciaRegs.SCIFFCT.all = 0x0; SciaRegs.SCICCR.all = 0x7; SciaRegs.SCICTL1.all = 0x2; SciaRegs.SCICTL2.all = 0x1; SciaRegs.SCIHBAUD = 0x1; SciaRegs.SCILBAUD = 0x44; SciaRegs.SCICTL1.all = 0x22; } void scia_xmit(char a) { while (SciaRegs.SCIFFTX.bit.TXFFST != 0) {} SciaRegs.SCITXBUF = a; } void scia_msg(char *msg) { int i = 0; while (msg[i] != '\0') { scia_xmit(msg[i]); i++; } } int main(void) { InitializeSys(); scia_msg("Hello World!\r\n"); }
On the PC side, I have an instance of PuTTY running with 9600 baud, 8 data bits, 1 stop bit, no parity, no flow control.
The data I receive is garbled/corrupted and unreadable.
As part of the initialization, we are making use of external ram (ZONE7; ZONE6 is unused, so we could swap to that if necessary) - is it possible that is causing the issue?
We're using the default baud rate from the Echoback example (9600) for a 20 Mhz clock, which I believe is what we're setup as via the PLL. Trying to try other rates did not appear to make a difference. Attempting to use the BRR for a 37.5 Mhz clock didn't make a different either (just in case...).
Any assistance would be greatly appreciated.