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.
Dear team:
Why is there a value in the SCIRXBUF register, but CCS can't read it?
#include "DSP2833x_Device.h" // DSP2833x Headerfile Include File #include "DSP2833x_Examples.h" // DSP2833x Examples Include File // Prototype statements for functions found within this file. void scib_echoback_init(void); void scib_fifo_init(void); void scib_xmit(int a); void scib_msg(char *msg); interrupt void uartbuf(void); // Global counts used in this example Uint16 LoopCount; Uint16 ErrorCount; Uint16 num3=0; Uint16 num4=0; Uint16 RX_data; Uint16 star,startpll; Uint16 cc1; Uint16 dd; Uint16 ee,AA,BB,CC,DD,EE,FF; void main(void) { InitSysCtrl(); InitScibGpio(); DINT; InitPieCtrl(); IER = 0x0000; IFR = 0x0000; // MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart); // InitFlash(); scib_fifo_init(); // Initialize the SCI FIFO scib_echoback_init(); // Initalize SCI for echoback InitCpuTimers(); EALLOW; PieVectTable.SCIRXINTB = &uartbuf; EDIS; PieCtrlRegs.PIECTRL.bit.ENPIE=1; PieCtrlRegs.PIEIER9.bit.INTx3=1; IER|=M_INT9; EINT; ERTM; num3=0; AA =0; CC =0; DD =0; EE =0; star=0xf1; startpll=0x00; for(;;) { //while(AA ==0) { scib_xmit(star); scib_xmit(startpll);//} CC=ScicRegs.SCIRXEMU; DD=ScicRegs.SCIRXBUF.all; while(ScicRegs.SCIFFRX.bit.RXFFST !=0) { FF=ScicRegs.SCIRXBUF.all; CC=ScicRegs.SCIRXEMU; DD=ScicRegs.SCIRXBUF.bit.SCIFFFE; DD=ScicRegs.SCIFFRX.bit.RXFFOVF; } } } interrupt void uartbuf(void) { PieCtrlRegs.PIEACK.all = PIEACK_GROUP1; ScicRegs.SCIFFTX.bit.TXFFINTCLR=1; DD=ScicRegs.SCIRXBUF.all; } // Test 1,SCIA DLB, 8-bit word, baud rate 0x000F, default, 1 STOP bit, no parity void scib_echoback_init() { // Note: Clocks were turned on to the SCIA peripheral // in the InitSysCtrl() function ScibRegs.SCICCR.all =0x0007; // 1 stop bit, No loopback // No parity,8 char bits, // async mode, idle-line protocol ScibRegs.SCICTL1.all =0x0003; // enable TX, RX, internal SCICLK, // Disable RX ERR, SLEEP, TXWAKE ScibRegs.SCICTL2.all =0x0003; ScibRegs.SCICTL2.bit.TXINTENA = 1; ScibRegs.SCICTL2.bit.RXBKINTENA =1; // ScibRegs.SCICTL1.bit.RXENA=1; //ScibRegs.SCIRXST.bit.RXWAKE=1; #if (CPU_FRQ_150MHZ) ScibRegs.SCIHBAUD =0x0001; // 9600 baud @LSPCLK = 37.5MHz. ScibRegs.SCILBAUD =0x00E7; #endif #if (CPU_FRQ_100MHZ) ScibRegs.SCIHBAUD =0x0001; // 9600 baud @LSPCLK = 20MHz. ScibRegs.SCILBAUD =0x0044; #endif ScibRegs.SCICTL1.all =0x0023; // Relinquish SCI from Reset } // Transmit a character from the SCI void scib_xmit(int a) { // while (ScibRegs.SCICTL2.bit.TXRDY == 0) {} if (ScicRegs.SCIFFTX.bit.TXFFST ==0) { ScibRegs.SCITXBUF=a;} } void scib_msg(char * msg) { int i; i = 0; while(msg[i] != '\0') { scib_xmit(msg[i]); i++; } } // Initalize the SCI FIFO /* void scib_fifo_init() { ScibRegs.SCIFFTX.all=0x8000; }*/ void scib_fifo_init() { ScicRegs.SCIFFTX.all=0xE040; // ScicRegs.SCIFFRX.all=0x204F; ScicRegs.SCIFFRX.all=0x2068; // ScicRegs.SCIFFRX.bit.RXFIFORESET=1; ScicRegs.SCIFFCT.all=0x0000;
Best Regards
Hi F.F,
Can you please describe why you want to use SCIB and SCIC? What are your hardware connections? In the expression window you provided I see that the contents of RXBUF match those of TXBUF for SICB...did you want the contents of SCIC to be the same as well?
At what point in the code do you see those register values?
I see that you enabled an interrupt for SCIRXINTB through the following line:
PieVectTable.SCIRXINTB = &uartbuf;
The function for the interrupt has the following code,
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1; ScicRegs.SCIFFTX.bit.TXFFINTCLR=1; DD=ScicRegs.SCIRXBUF.all;
The PIEACK should go at the end and this should be GROUP 9 not GROUP 1 since the SCIRXINTB is found in GROUP 9.
Best Regards,
Marlyn