Hi TI,
I am testing communication between F28055 and F28054M, Using example code from controllerSuit: Example_2805xSci_FFDLB_int.
Testing F28055 itself has no problem looping back data from Tx to Rx. But I want to transmit data from F28055 to F28054m, Then F28054M reads.
For the hardware connection: I connected F28055 (GPIO28/SCIRXDA and GPIO29/SCITXDA) to F28054M (GPIO28/SCITXDA and GPIO29/SCIRXDA)
So, I did following steps:
I disabled Rx interrupts ISR from F28055,( since I only need Tx)
distabled Tx interrupts ISR from F28054M
disable loop back (SciaRegs.SCICCR.bit.LOOPBKENA =0; // Disable loop back from fifo_init)
But I am not able to receive data from F28055 to F28054M, I wonder what did I missed to make them communicate to each other?
I have also attached example code below:
void main(void) { Uint16 i; // Step 1. Initialize System Control: // PLL, WatchDog, enable Peripheral Clocks // This example function is found in the F2805x_SysCtrl.c file. InitSysCtrl(); // Step 2. Initialize GPIO: // This example function is found in the F2805x_Gpio.c file and // illustrates how to set the GPIO to it's default state. // InitGpio(); // Setup only the GP I/O only for SCI-A and SCI-B functionality // This function is found in F2805x_Sci.c InitSciGpio(); // Step 3. Clear all interrupts and initialize PIE vector table: // Disable CPU interrupts DINT; // Initialize PIE control registers to their default state. // The default state is all PIE interrupts disabled and flags // are cleared. // This function is found in the F2805x_PieCtrl.c file. InitPieCtrl(); // Disable CPU interrupts and clear all CPU interrupt flags: IER = 0x0000; IFR = 0x0000; // Initialize the PIE vector table with pointers to the shell Interrupt // Service Routines (ISR). // This will populate the entire table, even if the interrupt // is not used in this example. This is useful for debug purposes. // The shell ISR routines are found in F2805x_DefaultIsr.c. // This function is found in F2805x_PieVect.c. InitPieVectTable(); // Interrupts that are used in this example are re-mapped to // ISR functions found within this file. EALLOW; // This is needed to write to EALLOW protected registers PieVectTable.SCIRXINTA = &sciaRxFifoIsr; PieVectTable.SCITXINTA = &sciaTxFifoIsr; EDIS; // This is needed to disable write to EALLOW protected registers // Step 4. Initialize all the Device Peripherals: scia_fifo_init(); // Init SCI-A // Step 5. User specific code, enable interrupts: // Init send data. After each transmission this data // will be updated for the next transmission for(i = 0; i<2; i++) { sdataA[i] = i; } rdata_pointA = sdataA[0]; // Enable interrupts required for this example PieCtrlRegs.PIECTRL.bit.ENPIE = 1; // Enable the PIE block PieCtrlRegs.PIEIER9.bit.INTx1=1; // PIE Group 9, INT1 PieCtrlRegs.PIEIER9.bit.INTx2=1; // PIE Group 9, INT2 IER = 0x100; // Enable CPU INT EINT; // Step 6. IDLE loop. Just sit and loop forever (optional): for(;;); } void error(void) { asm(" ESTOP0"); // Test failed!! Stop! for (;;); } interrupt void sciaTxFifoIsr(void) { Uint16 i; for(i=0; i< 2; i++) { SciaRegs.SCITXBUF=sdataA[i]; // Send data } for(i=0; i< 2; i++) //Increment send data for next cycle { sdataA[i] = (sdataA[i]+1) & 0x00FF; } SciaRegs.SCIFFTX.bit.TXFFINTCLR=1; // Clear SCI Interrupt flag PieCtrlRegs.PIEACK.all|=0x100; // Issue PIE ACK } interrupt void sciaRxFifoIsr(void) { Uint16 i; for(i=0;i<2;i++) { rdataA[i]=SciaRegs.SCIRXBUF.all; // Read data } for(i=0;i<2;i++) // Check received data { if(rdataA[i] != ( (rdata_pointA+i) & 0x00FF) ) error(); } rdata_pointA = (rdata_pointA+1) & 0x00FF; SciaRegs.SCIFFRX.bit.RXFFOVRCLR=1; // Clear Overflow flag SciaRegs.SCIFFRX.bit.RXFFINTCLR=1; // Clear Interrupt flag PieCtrlRegs.PIEACK.all|=0x100; // Issue PIE ack } void scia_fifo_init() { SciaRegs.SCICCR.all =0x0007; // 1 stop bit, No loopback // No parity,8 char bits, // async mode, idle-line protocol SciaRegs.SCICTL1.all =0x0003; // enable TX, RX, internal SCICLK, // Disable RX ERR, SLEEP, TXWAKE SciaRegs.SCICTL2.bit.TXINTENA =1; SciaRegs.SCICTL2.bit.RXBKINTENA =1; SciaRegs.SCIHBAUD = 0x0000; SciaRegs.SCILBAUD = 0x0030; //SCI_PRD; SciaRegs.SCICCR.bit.LOOPBKENA =0; // Enable loop back SciaRegs.SCIFFTX.all=0xC022; SciaRegs.SCIFFRX.all=0x0022; SciaRegs.SCIFFCT.all=0x00; SciaRegs.SCICTL1.all =0x0023; // Relinquish SCI from Reset SciaRegs.SCIFFTX.bit.TXFIFOXRESET=1; SciaRegs.SCIFFRX.bit.RXFIFORESET=1; } //=========================================================================== // No more. //===========================================================================