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.

questions about DMA of TMS570LS3137

Other Parts Discussed in Thread: TMS570LS3137, HALCOGEN

I need to use MibSPI with DMA , I feel confuesd when I see Figure 16-6 ,Figure 16-7,Figure 16-8 of TRM of TMS570LS3137, Could you explain more detail about how to use DMA  of TMS570LS3137?

  • I don't understand the meaning of Index , why source Element Index is 12 , I only see E8 is the max number ,so I guess the element is 8 , and I see f4, so I guess the Frame is 4, why write Frame Index = 1 ?

  •   185 {
      186   g_dmaCTRLPKT.SADD      = sadd;              /* source address             */
      187   g_dmaCTRLPKT.DADD      = dadd;              /* destination  address       */
      188   g_dmaCTRLPKT.CHCTRL    = 0;                 /* channel control            */
      189   g_dmaCTRLPKT.FRCNT     = 1;                 /* frame count                */
      190   g_dmaCTRLPKT.ELCNT     = dsize;             /* element count              */
      191   g_dmaCTRLPKT.ELDOFFSET = 4;                 /* element destination offset */
      192   g_dmaCTRLPKT.ELSOFFSET = 0;                 /* element destination offset */
      193   g_dmaCTRLPKT.FRDOFFSET = 0;                 /* frame destination offset   */
      194   g_dmaCTRLPKT.FRSOFFSET = 0;                 /* frame destination offset   */
      195   g_dmaCTRLPKT.PORTASGN  = 4;                 /* port b                     */
      196   g_dmaCTRLPKT.RDSIZE    = ACCESS_16_BIT;     /* read size                  */
      197   g_dmaCTRLPKT.WRSIZE    = ACCESS_16_BIT;     /* write size                 */
      198   g_dmaCTRLPKT.TTYPE     = FRAME_TRANSFER ;   /* transfer type              */
      199   g_dmaCTRLPKT.ADDMODERD = ADDR_INC1;         /* address mode read          */
      200   g_dmaCTRLPKT.ADDMODEWR = ADDR_OFFSET;       /* address mode write         */
      201   g_dmaCTRLPKT.AUTOINIT  = AUTOINIT_ON;       /* autoinit                   */
      202 }
     
    Hi,all
        I want to know the line 191~194 the element offset meaning(the code is copied from HALCOGEN example "example_mibspiDma.c") , for example ,g_dmaCTRLPKT.ELDOFFSET = 4,
    what does 4 mean?why use 4 ?and other use 0? I am confused.
        Hope to get answer soon.
  • Jiaming,

    Would you please provide more details about what you want to achieve with DMA as a system level function?Then we can discuss in detail about the implementation.

    Thanks and regards,

    Zhaohong

  • I want to use MibSPI with DMA to send message to another board ,  I think DMA could reduce the CPU load , and the message's size  I want to send may change.So I need to understand the principle of DMA and MIbSPI.When I read the TRM of TMS570, I feel confused. 

  • I want to write data to a region of RAM  first ,then DMA move this region's data to MIbSPI's RAM ,then the MibSPI send this data out. Next time,I write other data to RAM ,then repeat the process .

  • I wrote data and tested, I use oscilloscope measuring the tx pin of MibSPI1 ,and I saw the signal square wave came out ,but the error pin of TMS570LS3137 is low ,this pin  accounts for something wrong with TMS570, but why the MIbSPI seems work ?

  • Jiaming,

    If you do not need to do multiple transfer groups, I would recommend you use SPI (MibSPI compatibility mode) with DMA. When you have different message size, all you need to be is to change the DMA block size. I am attaching some code snip. In this example, MibSPI operates in three modes: SPI with interrupt, SPI with DMA, and MibSPI. You should be able to see what is needed to set MibSPI for those operations.

    4503.spi_dma.zip

    Thanks and regards,

    Zhaohong