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.

TMS570LC4357: MibSPI with DMA buffer transfer CS issue

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Hi,

I am working for data transfer between two TMS570LC4357 controllers, both side MibSPI-1 connected with CS0, CLK, MISO[0], MOSI[0] and ENA pins. I am using the code to configure DMA from example. The data transfer is fine when I have tested with ECOUNT as 4 and FCOUNT as 4. As per my application requirement configured the DMA buffer transfer with ECOUNT as 94 and FCOUNT as 4. The transfer is initially OK, but after few transfers, the data started rolling. I have started checking with the SPI analyzer.

The CS insertion with 4X4 data is much clear and the CS was inserted regularly. With the bigger buffer transfer, the CS looks bit different, and would like to check what could be the possible issue.

The entire buffer looks like this.

Zoom in the first section (there are 2 first set of identical buffers)

Further zoom (each is of 4 words of 16 bit each)

 Zoom the large buffer (there are 90 words of 16 bit each)

In total 4+4+90+4+4+90+4+4+90+4+4+90 (total 98 x 4)

The CS is not uniform during the bigger buffer as below (Not sure why?)

  

The DMA configuration as below.

/* - initialize transfer groups */
mibspiREG1->TGCTRL[0U] = (uint32)((uint32)1U << 30U) //oneshot
| (uint32)((uint32)0U << 29U) //pcurrent reset
| (uint32)((uint32)TRG_ALWAYS<< 20U) //trigger event
| (uint32)((uint32)TRG_DISABLED << 16U) //trigger source
| (uint32)((uint32)0U << 8U); //start buffer

mibspiREG1->TGCTRL[1U] = (uint32)((uint32)1U << 30U) //oneshot
| (uint32)((uint32)0U << 29U) //pcurrent reset
| (uint32)((uint32)TRG_ALWAYS << 20U) //trigger event
| (uint32)((uint32)TRG_DISABLED << 16U) //trigger source
| (uint32)((uint32)98U << 8U); //start buffer

//MibSPI1 TG0
for (i=0; i<3; i++)
{
mibspiRAM1->tx[i].control = (uint16)((uint16)5U << 13U) //buffer mode
| (uint16)((uint16)1U << 12U) //chip select hold
| (uint16)((uint16)0U << 10U) //enable WDELAY
| (uint16)((uint16)0U << 11U) //lock transmission
| (uint16)((uint16)0U << 8U) //data format
| ((uint16)(~((uint16)0xFFU ^ (uint16)CS_0)) & (uint16)0x00FFU); //chip select
}
mibspiRAM1->tx[3].control = (uint16)((uint16)5U << 13U) //buffer mode
| (uint16)((uint16)0U << 12U) //chip select hold
| (uint16)((uint16)0U << 10U) //enable WDELAY
| (uint16)((uint16)0U << 8U) //data format
| ((uint16)(~((uint16)0xFFU ^ (uint16)CS_0)) & (uint16)0x00FFU); //chip select

//MibSPI1 TG1
for (i=4; i<7; i++)
{
mibspiRAM1->tx[i].control = (uint16)((uint16)5U << 13U) //buffer mode
| (uint16)((uint16)1U << 12U) //chip select hold
| (uint16)((uint16)0U << 10U) //enable WDELAY
| (uint16)((uint16)0U << 11U) //lock transmission
| (uint16)((uint16)0U << 8U) //data format
| ((uint16)(~((uint16)0xFFU ^ (uint16)CS_0)) & (uint16)0x00FFU); //chip select
}
mibspiRAM1->tx[7].control = (uint16)((uint16)5U << 13U) //buffer mode
| (uint16)((uint16)0U << 12U) //chip select hold
| (uint16)((uint16)0U << 10U) //enable WDELAY
| (uint16)((uint16)0U << 8U) //data format
| ((uint16)(~((uint16)0xFFU ^ (uint16)CS_0)) & (uint16)0x00FFU); // chip select

/* TG start address. PSTARTx stores the start address of the corresponding TG. The corresponding */
/* end address is inherently defined by the subsequent TG start address minus 1 (PENDx[TGx] = */
/* PSTARTx[TGx+1]-1). PSTARTx is copied into PCURRENTx when:*/
for(i=0; i<8; i++)
{
tgPSTART1[i] = (mibspiREG1->TGCTRL[i] >> 8) & 0xFF;
}

I have given enough delay for both CS and ENA pins before and after insertion.

The data is also simple array of UINT16 size.

Looking help to understand what could be the issue and how to solve.

Chandra

  • Hello Chandra,

    From the code in your post, MibSPI1 TG0 has 98 buffers (start of TG1). But MibSPI RAM configuration is not consistent with the TG0 and TG1 defined in TGxCTRL register.

    Please use HALCogen to generate MibSPI code.

  • Hi Wang,

    Thanks for the reply. I have modified my example and using the configuration generated by the HALCoGen. I still see the in consistent data on RX and discontinuities in the CS signal. I am also attaching my example project for both Master and slave. Can you please check and help me in resolving the issues.

    Have a look below - 3 data packets of 98 X 4 data

    Zoom one packet

    Zoom one frame

    Zoom the frame do not have proper clock

    Improper clocking


    TMS570LC4357_MibSPI1_DMA_Master&Slave.zip

    Chandra

  • Hello Chandra,

    I saw the improper SPI clock in the last diagram. 

    In your MibSPI configuration, the CSHOLD is set to 1 in both master side and slave side. So the CS pin should not to be deasserted between two buffer transfers (within one frame transfer). Why the CS is deasserted in your last diagram:

  • In slave side, if CSHOLD is disabled, the de-assertation of CS signal is to trigger copying the received data to RXRAM. If CSHOLD is set,  MibSPI does not wait for the SPICS's de-assertation for copying the received data to the receive RAM. My understanding is that the SPICS toggle between the buffer transfer should not affect the data reception in SPI slave.

  • Hi Wang,

    My issue is with Rx data, both on Master and slave.

    The data is offset by one or two frames most of the time. in between, we have proper alignment.

    for more clarity for the first instance on slave, the first element data will be 0x5A00, and after few transfers it will be 0x5A62 and after few cycles it can be 0x5A00 or 0x5B26. This start frame alignment with RAM is not consistent. Not sure, what could be the reason. We have also connected ENA line. I have checked between 1MHz baud and 20MHz. It is same result. I wish you have a look and run my code please.

    Chandra

  • Hi Chandra,

    Can we produce this kind of issue using MibSPI1 and MibSPI3 on the same device? MibSPI is used as master, and MibSPI3 as slave. 

    I have only one LC43x launchpad to run your code.

  • Hi Wang, I am trying to make one example, which I have downloaded from e2e forum some time back posted by you with MibSPI 1 & 3 channels with DMA. But I could not able to see it is working on my boards. Not sure what is the issue. If this is working example then I can try to modify this example to emulate my issue. Can you please check the example working on your board or need some fix. Sorry that I am troubling you, but I have tried three days with this example and did not work for me.TMS570LC4357_MibSPI1-3_DMA.zip

    Chandra  

  • Hi Chandra,

    The example project includes two linker cmd files: HL_sys_link.cmd and HL_sys_link_ecc.cmd.

    1. If HL_sys_link.cmd is used (exclude other link cmd from compiling), please check the "Auto ECC generation" when loading the program to flash

    2.  If HL_sys_link_ecc.cmd is used (exclude other link cmd from compiling), please uncheck "Auto ECC generation" and select "NONE" for Flash Verification Settings. To enable Linker ECC generation, please change the project linker output setting:

    I just tested the project, it works without any issue.

  • Hi Wang,

    I was able to execute the example, and modified the code with dmaGroupANotification instead of mibspiGroupNotification. It worked on the TMS570LC43x Hercules Development Kit (HDK). I have started creating project with FreeRTOS with multiple task to regenerate issue. During the testing my HDK gone bad and I have tried to test the same code on Launchpad. Surprisingly, there is no RX data on both side. I have verified all the configuration and everything looks OK. Can you please verify the code for me once. May be my Launchpad also bad one!! Also I am planning to change the controller on my HDK. When I have tried to order few samples, I could not make. Can you please help me in getting samples of the controller. Earlier I got few DAC chips by e2e help, place request for me. 

    ChandraTMS570LC4357_MibSPI1x3_DMA.zip

  • Hi Sunil, I have the following message  "Your company or university does not have access to order free samples from Texas Instruments. If you have reached this page, you have been declined access to place sample orders". I have tried both the Infosys account and NTU account, but still have the same message unfortunately. This is the reason seek your help.

    Regards,

    Chandra

  • These parts are not available as free samples, and must be ordered. The price is automatically quoted based on the volumes you order.

  • Hi Sunil, I had the same issue before when I am working with DAC and got the samples ordered by e2e representative due to the same message. I will be ordering the controllers as part of the development activity by manufacturer of the custom board. As I am working with R&D team in Singapore, to order and get the items will take good amount of time due to process. I have to wait. Thanks for the information.

  • Just tested, it doesn't work on my launchpad. 

    Noticed that the "Wait for Enable" is checked in your MibSPI1/3 configuration, do you connect MibSPI3_nENA to MibSPI1_nENA? 

    I disabled "Wait for Enable", the code works.

    mibspiInit();

    mibspiREG1->FMT0 &= (0xFFDFFFFF); //disable "Wait on Enable"
    mibspiREG3->FMT0 &= (0xFFDFFFFF);

    This is the RX data and TX data:

  • Hi Wang,

    Thanks for checking the code many times. I am using Enable signal connected on the board.

    Finally I could able to make the code to reproduce the issue (Frame loss), which I am facing on single board. This is project with FreeRTOS.

    The code in the folder HL_include and HL_source are manually merged from Halcogen generated code.

    I am attaching the code. Please check, and please connect Enable pins.

    Few Questions.

    1.When the BTC interrupt was hit, I am reconfiguring the DMA to trigger TX. May be this is not correct. Please let me know, what is the proper method.

    2.To synchronize the TX and RX between both the channels I am using buffer mode as 5 (Wait until TX full). Please note that my communication is between two different controllers, and I need to create mirror image of global data buffer with least possible latency. Shall I need to use different buffer mode for proper sync.

    3.What is the highest clock speed can be used practically with MibSPI.

    4.I am using motor control FOC in the ETPWM interrupt, which was configured for 25 KHz cycle time.

    MotorMainController.zip

    Chandra

  • Hi Wang,

    Please Ignore the previous code and use this.

    1.The first element of RXDATA_TG10 is always improper one and will not get updated. 

    2.The MibSPI clock is set to 1000, we need to change to higher as 25 MHz.

    6366.MotorMainController.zip

    Chandra

  • I will check later

  • Hi Wang, Thanks.

    Can you please try to use the updated file with tasks triggering the BTC flag.

    Some how the scenario I see with two controllers is a bit different from this, but still we may get a clue.

    /*
     * ipc.c
     *
     *  Created on: Aug 29, 2019
     *      Author:
     */
    #include "FreeRTOS.h"
    #include "HL_sys_core.h"
    #include "task.h"
    #include "ipc_primary.h"
    #include "HL_mibspi.h"
    #include "HL_esm.h"
    #include "HL_sys_dma.h"
    #include "globalvar_primary.h"
    
    //#define E_COUNT      4   /*Element count*/
    //#define F_COUNT      4   /*Frame count*/
    #define E_COUNT         72   /*Element count*/
    #define F_COUNT         4   /*Frame count*/
    #define D_SIZE          E_COUNT * F_COUNT
    #define TG0             1
    #define TG1             0
    
    uint64 RXFailCount = 0;
    
    g_dmaCTRL g_dmaCTRLPKT_RX, g_dmaCTRLPKT_TX;
    
    void vReadDataTunnel(void *pvParameters);
    void vWriteDataTunnel(void *pvParameters);
    void interProcessorCommInit(void);
    void loadDataPattern(uint32 psize, uint16* pptr, uint16 pattern);
    void mibspiDmaConfig(mibspiBASE_t *mibspi,uint32 channel, uint32 txchannel, uint32 rxchannel);
    
    void dmaConfigCtrlRxPacket(uint32 sadd, uint32 dadd, uint16 ElmntCnt, uint16 FrameCnt);
    void dmaConfigCtrlTxPacket(uint32 sadd, uint32 dadd, uint16 ElmntCnt, uint16 FrameCnt);
    
    /* TG start address */
    uint16 tgPSTART1[8];   //for MibSPI1
    uint16 tgPSTART3[8];   //for MibSPI3
    uint16 flag_TX = false;
    uint16 flag_RX = false;
    
    
    #pragma SET_DATA_SECTION(".sharedRAM")
    uint16 RXDATA_TG10[D_SIZE]= {0};     //receive  buffer in sys ram, MibSPI1 TG0
    uint16 TXDATA_TG10[D_SIZE];          //transmit buffer in sys ram, MibSPI1 TG0
    uint16 RXDATA_TG30[D_SIZE]= {0};     //receive  buffer in sys ram, MibSPI3 TG0
    uint16 TXDATA_TG30[D_SIZE];          //transmit buffer in sys ram, MibSPI3 TG0
    #pragma SET_DATA_SECTION()
    
    
    /* Task vReadDataInTunnel Definition */
    void vReadDataTunnel(void *pvParameters)
    {
        for(;;)
        {
            if(flag_RX == true)
            {
                mibspiDmaConfig(mibspiREG1,0,0,1);
                flag_RX = false;
            }
    
            /* call Task functions here */
            vTaskDelay(100);
        }
    }
    
    /* Task vWriteDataOutTunnel Definition */
    void vWriteDataTunnel(void *pvParameters)
    {
        for(;;)
        {
            if(flag_TX == true)
            {
                mibspiDmaConfig(mibspiREG3, 0, 0, 1);
                flag_TX = false;
            }
            /* call Task functions here */
            vTaskDelay(100);
        }
    }
    
    void dmaGroupANotification(dmaInterrupt_t inttype, uint32 channel)
    {
    
        int m;
        m=channel;
       if(m==0)
       {
    
        int testflag=dmaREG->BTCFLAG;     //read int flag
       // dmaREG->BTCFLAG=0;              //test for clear flag to see
    
        //mibspiDmaConfig(mibspiREG1,0,0,1);
        flag_RX = true;
    
       }
       else if(m==8)
       {
           int testflag=dmaREG->BTCFLAG;     //read int flag
          // dmaREG->BTCFLAG=0;              //test for clear flag to see
    
           //mibspiDmaConfig(mibspiREG3,0,0,1);
           flag_TX = true;
       }
    
    }
    
    void interProcessorCommInit(void)
    {
       uint16 i;
    
       /* TXDATA_TG10 ->MibSPI1 TG0 */
       //mibspiEnableLoopback(mibspiREG1, Analog_Lbk );        //testing   Analog_Lbk
       //loadDataPattern(D_SIZE, &TXDATA_TG10[0], 0x5A00);     //for testing
    
       /* TG start address. PSTARTx stores the start address of the corresponding TG. The corresponding */
       /* end address is inherently defined by the subsequent TG start address minus 1 (PENDx[TGx] =    */
       /* PSTARTx[TGx+1]-1). PSTARTx is copied into PCURRENTx when:*/
       for(i=0; i<8; i++)
       {
           tgPSTART1[i] = (mibspiREG1->TGCTRL[i] >> 8) & 0xFF;
           tgPSTART3[i] = (mibspiREG3->TGCTRL[i] >> 8) & 0xFF;
       }
    
       /*MibSPI1 TG0, DMA config*/
       /* - creating a data chunk in system ram to start with ... */
       /* TXDATA_TG10 ->MibSPI1 TG0 */
       loadDataPattern(D_SIZE, &TXDATA_TG10[0], 0x5A00);
    
       dmaConfigCtrlTxPacket((uint32)TXDATA_TG10, (uint32)&(mibspiRAM1->tx[tgPSTART1[0]].data), E_COUNT, F_COUNT);
       dmaConfigCtrlRxPacket((uint32)&(mibspiRAM1->rx[tgPSTART1[0]].data), (uint32)RXDATA_TG10, E_COUNT, F_COUNT);
    
       //using DAM_CH0 for RX, DMA_CH1 for TX
       /* - setting dma control packets */
       dmaSetCtrlPacket(DMA_CH1,g_dmaCTRLPKT_TX);  //tx
       dmaSetCtrlPacket(DMA_CH0,g_dmaCTRLPKT_RX);  //rx
    
       /* - setting the dma channel to trigger on h/w request */
       dmaSetChEnable(DMA_CH1, DMA_HW);
       dmaSetChEnable(DMA_CH0, DMA_HW);
    
       dmaReqAssign(DMA_CH1, DMA_REQ1); //DMA request line 1, TX
       dmaReqAssign(DMA_CH0, DMA_REQ0); //DMA request line 0, RX
    
       /* - configuring the mibspi dma , channel 0 , tx line -0 , rxline -1     */
       /* - refer to the device data sheet dma request source for mibspi tx/rx  */
       mibspiDmaConfig(mibspiREG1,0,0,1);   //RX_DMA_Line=1, TX_DMA_Line=0
    
       /* Enable Block Transfer Complete interrupt for the receive after transfer complete */
       dmaEnableInterrupt(DMA_CH0, BTC, DMA_INTA);   // for transmit
    
       /* MibSPI3, Slave, TG0, DMA*/
       //using DAM_CH6 for RX, DMA_CH8 for TX
       /* - creating a data chunk in system ram to start with ... */
       /* TXDATA_TG30 --> MibSPI3, TG0*/
       loadDataPattern(D_SIZE, &TXDATA_TG30[0], 0x6C00);
    
       dmaConfigCtrlTxPacket((uint32)TXDATA_TG30, (uint32)&(mibspiRAM3->tx[tgPSTART3[0]].data), E_COUNT, F_COUNT);
       dmaConfigCtrlRxPacket((uint32)&(mibspiRAM3->rx[tgPSTART3[0]].data), (uint32)RXDATA_TG30, E_COUNT, F_COUNT);
       /* - setting dma control packets */
       dmaSetCtrlPacket(DMA_CH9,g_dmaCTRLPKT_TX);  //tx
       dmaSetCtrlPacket(DMA_CH8,g_dmaCTRLPKT_RX);  //rx
    
        /* - setting the dma channel to trigger on h/w request */
       dmaSetChEnable(DMA_CH9, DMA_HW);
       dmaSetChEnable(DMA_CH8, DMA_HW);
    
       dmaReqAssign(DMA_CH9, DMA_REQ4);   //DMA request line 4  -- TX   (last col, Table 6-41)
       dmaReqAssign(DMA_CH8, DMA_REQ5);   //DMA request line 5  -- RX   (last col, Table 6-41)
    
       /* - configuring the mibspi dma , channel 2, MibSPI TX Line -2 , MibSPI RX Line - 3    */
       /* MibSPI TX Line and MibSPI RX Line are in the parentheses following MibSPI1  */
       /* MibSPI3 transfer group 0*/
       mibspiDmaConfig(mibspiREG3,0,2,3);
    
       /* Enable Block Transfer Complete interrupt for the receive after transfer complete */
       dmaEnableInterrupt(DMA_CH8, BTC, DMA_INTA);
    
       dmaEnable();
       //enable flag for first TX
       flag_TX = true;
       /* - start the mibspi transfer tg 0 */
       mibspiTransfer(mibspiREG3, 0);
       mibspiTransfer(mibspiREG1, 0);
    }
    void loadDataPattern(uint32 psize, uint16* pptr, uint16 pattern)
    {
        int i;
        for(i=0;i<psize;i++)
        {
            *(pptr++) = pattern + i;
        }
    }
    
    void mibspiDmaConfig(mibspiBASE_t *mibspi,uint32 channel, uint32 txchannel, uint32 rxchannel)
    {
        uint32 bufid;
    
        if (mibspi == mibspiREG1){
             bufid  = tgPSTART1[channel] + E_COUNT - 1;
        }else{
             bufid  = tgPSTART3[channel] + E_COUNT - 1;
        }
    
        /* setting transmit and receive channels */
        mibspi->DMACTRL[channel] |= (rxchannel << 20) | (txchannel << 16);
    
        if (F_COUNT > 1) {
             mibspi->TGCTRL[channel] &= 0xBFFFFFFF; // Disable ONESHOT
        } else {
             mibspi->TGCTRL[channel] |= 0x40000000; // Enable ONESHOT
        }
    
        /* enabling transmit and receive dma */
        mibspi->DMACTRL[channel] |=  0x8000C000;
    
        /* setting Initial Count of DMA transfers and the buffer utilized for DMA transfer */
        mibspi->DMACTRL[channel] |=  (bufid<<24);
    
        /* Enable Large count transfer */
        mibspi->DMACNTLEN = 0x1;
        mibspi->DMACOUNT[channel] = (F_COUNT - 1) << 16;
    
    }
    
    void dmaConfigCtrlRxPacket(uint32 sadd, uint32 dadd, uint16 ElmntCnt, uint16 FrameCnt)
    {
          g_dmaCTRLPKT_RX.SADD       = sadd;              /* source address             */
          g_dmaCTRLPKT_RX.DADD       = dadd;           /* destination  address       */
          g_dmaCTRLPKT_RX.CHCTRL     = 0;                 /* channel control            */
          g_dmaCTRLPKT_RX.FRCNT      = FrameCnt;                 /* frame count                */
          g_dmaCTRLPKT_RX.ELCNT      = ElmntCnt;             /* element count              */
          g_dmaCTRLPKT_RX.ELDOFFSET  = 0;                 /* element destination offset */
          g_dmaCTRLPKT_RX.ELSOFFSET  = 4;                 /* element source offset */
          g_dmaCTRLPKT_RX.FRDOFFSET  = 0;                  /* frame destination offset   */
          g_dmaCTRLPKT_RX.FRSOFFSET  = 0;                 /* frame destination offset   */
          g_dmaCTRLPKT_RX.PORTASGN   = PORTB_READ_PORTA_WRITE;   /* port b                     */
          g_dmaCTRLPKT_RX.RDSIZE     = ACCESS_16_BIT;      /* read size                  */
          g_dmaCTRLPKT_RX.WRSIZE     = ACCESS_16_BIT;      /* write size                 */
          g_dmaCTRLPKT_RX.TTYPE      = FRAME_TRANSFER ;   /* transfer type              */
          g_dmaCTRLPKT_RX.ADDMODERD  = ADDR_OFFSET;         /* address mode read          */
          g_dmaCTRLPKT_RX.ADDMODEWR  = ADDR_INC1;       /* address mode write         */
          g_dmaCTRLPKT_RX.AUTOINIT   = AUTOINIT_ON ;       /* autoinit                   */
    
          //return g_dmaCTRLPKT_RX;
    }
    
    void dmaConfigCtrlTxPacket(uint32 sadd, uint32 dadd, uint16 ElmntCnt, uint16 FrameCnt)
    {
          g_dmaCTRLPKT_TX.SADD       = sadd;              /* source address             */
          g_dmaCTRLPKT_TX.DADD       = dadd;           /* destination  address       */
          g_dmaCTRLPKT_TX.CHCTRL     = 0;                 /* channel control            */
          g_dmaCTRLPKT_TX.FRCNT      = FrameCnt ;                 /* frame count                */
          g_dmaCTRLPKT_TX.ELCNT      = ElmntCnt;             /* element count              */
          g_dmaCTRLPKT_TX.ELDOFFSET  = 4;                 /* element destination offset */
          g_dmaCTRLPKT_TX.ELSOFFSET  = 0;             /* element destination offset */
          g_dmaCTRLPKT_TX.FRDOFFSET  = 0;                  /* frame destination offset   */
          g_dmaCTRLPKT_TX.FRSOFFSET  = 0;                 /* frame destination offset   */
          g_dmaCTRLPKT_TX.PORTASGN   = PORTA_READ_PORTB_WRITE;                 /* port b                     */
          g_dmaCTRLPKT_TX.RDSIZE     = ACCESS_16_BIT;     /* read size                  */
          g_dmaCTRLPKT_TX.WRSIZE     = ACCESS_16_BIT;      /* write size                 */
          g_dmaCTRLPKT_TX.TTYPE      = FRAME_TRANSFER ;   /* transfer type              */
          g_dmaCTRLPKT_TX.ADDMODERD  = ADDR_INC1;         /* address mode read          */
          g_dmaCTRLPKT_TX.ADDMODEWR  = ADDR_OFFSET;       /* address mode write         */
          g_dmaCTRLPKT_TX.AUTOINIT   = AUTOINIT_ON ;       /* autoinit                   */
    
          //return g_dmaCTRLPKT_TX;
    }
    

    Chandra

  • With your updated code, the MibSPI CS issue can be produced using just one MCU (MibSPI1--MibSPI3), right? 

  • The CS is clean on a single MCU. I did not see issue. But still I see frame loss, with 25 MHz clock set and task delay changed to 2 tick for both TX and RX task.

    Chandra

  • Hi Wang,

    Can you please have a look in to the issue, and answer my questions on 12 May.

    Thanks. Chandra

  • I will run the test on LC43 Launchpad.

  • Hi Wang, I was checking the signals on the scope instead of the logic probe. I see the level of CS signal is removed it is 2.8V and active 0.78V with some noise could be because of scope or wires. This capture was taken with clock configured to 15 MHz. I see that the frame overlap being low, when the clock frequency is low and increasing with higher frequency. Similarly, the frame overlap is also increasing if I am decreasing the delay of the task, means more frequent transmission of data.

    I think the noise is making the logic probe catching unwanted CS signals. I have a 10K pull-up resistor on the CS line. 

    Is it possible for you to get one more LC43 launchpad and try my code on two different boards? I hope you can get it quickly.

    My aim is to send and receive data for every 1mSec.

    Eagerly waiting for your reply.

    Chandra

  • Hi Wang, wish you are doing good and safe. I am looking for a reply from you. 

    I have made few more testing. With 10 MHz clock and 100 ticks task delay, the data transfer is stable. 

    I have changed the clock to 20 MHz and see very few times the frame loss and the data stable again.

    I have changed the task delay to 10 ticks. The frame loss is frequent than earlier and also the data offset present. That means at the RX buffer the first data element is 0x6A80 instead of 0x6A00. with this offset the data transfer goes on.

    I do not have any clue how I can put back the right data set again. 

    I have removed the load on CPU by disabling the FOC function execution.

    Please makeup some time to answer my questions, below again.

    1.When the BTC interrupt was hit, I am reconfiguring the DMA to trigger TX. May be this is not correct. Please let me know, what is the proper method.

    2.To synchronize the TX and RX between both the channels I am using buffer mode as 5 (Wait until TX full). Please note that my communication is between two different controllers, and I need to create mirror image of global data buffer with least possible latency. Shall I need to use different buffer mode for proper sync.

    3.What is the highest clock speed can be used practically with MibSPI.

    4.I am using motor control FOC in the ETPWM interrupt, which was configured for 25 KHz cycle time.

     Chandra

  • Hi, Can some one reply to my above questions?

    Chandra

  • Hi, I am still waiting for a reply and some help.

    Chandra