Other Parts Discussed in Thread: C2000WARE
Tool/software:
I hope this message finds you well.
I am doing Hardware Connection is like:
F28335TX to RS232 converter RX to (connected DB9 connecter) using TTL converter for its conversion of TTL output to RS232 DB9 pin connector.
F28335 RX to RS232 converter TX to (connected DB9 connecter) using TTL converter for its conversion of TTL output to RS232 DB9 pin connector.
Data transmission from F28335 to external device RS232 (LabView) reception is getting executed properly. But data reception from F28335 which is transmitted by external device RS232 (LabView) is not getting executed.
Tested for Internal loop and External loop back (by connecting TX line to RX line) is getting executed properly.
Queries:
1. Could you please suggest me, what are all the configurations need to be done?
2. Could you please correct my SCI data receiver and configuration function code as attached in X, if it is incorrect?
/*
 * SCI.c
 *
 *  Created on: Aug 27, 2024
 *      Author: CG00844381
 */
#include "Mcu1_Device.h"
#include "SCI.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
UNS8 receivedData[4] = { 0 };
UNS16 rx_loop = 0;
void main()
{
	/* Initialize system */
    InitSysCtrl();
    EALLOW;
    SysCtrlRegs.HISPCP.all = 0x3;
    EDIS;
    DINT;
    //disabliling cpu interrupts
    /* Initialize the PIE control registers to their default state */
    InitPieCtrl();
    IER = 0x0000;
     IFR = 0x0000;
    /* Initialize the PIE vector table with pointers to the shell Interrupt Service Routines (ISR). */
    InitPieVectTable();
    IER |= M_INT1;                          // here Enabling CPU INT9
    EINT; //disable
//    // Enabling  interrupt
    ERTM;
	
	for(rx_loop=0;rx_loop<=4;rx_loop++) 
        {
          Sci_rx();
          ScibRegs.SCIFFRX.bit.RXFIFORESET = 0;
          Sci_tx();
		}
	
}
void Sci_Config()
{
    EALLOW;
    SysCtrlRegs.PCLKCR0.bit.SCIBENCLK = 1;     // enabiling peripheral clock
    EDIS;
    EALLOW;
    GpioCtrlRegs.GPAPUD.bit.GPIO18 = 0;
    GpioCtrlRegs.GPAPUD.bit.GPIO19 = 0;
    EDIS;
    ScibRegs.SCICCR.all = 0x0007; // sci control reg are set as 8-bit data, no parity, 1 stop bit
                                  //0000 0000 0000 0111
    ScibRegs.SCICTL1.all = 0x0063; // Enabling TX and RX   reset     
    ScibRegs.SCICTL2.all = 0x0000;             
    ScibRegs.SCIHBAUD = 0x0000;    // Setting the baud rate (high register)
    ScibRegs.SCILBAUD = 0x0079;      //Setting baud rate (low register) 38.46kHz
    
    ScibRegs.SCIFFTX.all = 0x0000;   
    ScibRegs.SCIFFRX.all = 0x0000;    
    ScibRegs.SCIFFTX.all = 0xE044;   //Try E044
    ScibRegs.SCIFFRX.all = 0x0064;   //Try 0064   //to check fifo status change 4 to 10
    ScibRegs.SCIFFCT.all = 0x0000;
    ScibRegs.SCIPRI.bit.FREE = 1; 
    /* Configure SCI Priority register for SOFT bit */
    ScibRegs.SCIPRI.bit.SOFT = 1;
    EALLOW;
    GpioCtrlRegs.GPAQSEL2.bit.GPIO19 = 3;     // Asynchronous input    (SCIRXDA)
    GpioCtrlRegs.GPAMUX2.bit.GPIO18 = 2; //config gpio as SCITXDA   Same in 28069
    GpioCtrlRegs.GPAMUX2.bit.GPIO19 = 2;           //config gpioas SCIRXDA
    EDIS;
  
    //Peripheral intialization
    PieCtrlRegs.PIECTRL.bit.ENPIE = 1;   // Enable the PIE block
    PieCtrlRegs.PIEIER9.bit.INTx3 = 1; // here Enabling SCI RX interrupt in PIE group 9
    PieCtrlRegs.PIEIER9.bit.INTx4 = 1; // here Enabling SCI TX interrupt in PIE group 9
    EDIS;
}
BOOL Sci_rx()
{
    UNS16 Rx_sts;
    UNS16 Rx_rdy = 0x0040;
    do
    {
        Rx_sts = ScibRegs.SCIRXST.all;
    }
    while ((Rx_sts & Rx_rdy) == 0);
    receivedData[rx_loop] = ScibRegs.SCIRXEMU;
    ScibRegs.SCIFFRX.bit.RXFIFORESET = 1;
    printf("rx :0x%x\n",receivedData[rx_loop]);
    
}
BOOL Sci_tx()
{
    while (ScibRegs.SCICTL2.bit.TXRDY == 0);
    {
        ScibRegs.SCITXBUF = receivedData[rx_loop];
         printf("tx : 0x%X\n", ScibRegs.SCITXBUF);
    }
}
Thanks & Regards,
Chaya
				
                          




