AnsweredAssumed Answered

bf609 eppi2 transmit data

Question asked by daijun on Nov 21, 2013
Latest reply on Dec 4, 2013 by Yves1982

hello, i want to transmit data through eppi2 with internal clock and sync, but my code could't get correct result.

my code is like this:

void EPPI2_CH0_HANDLER(uint32_t iid, void *handlerArg)

{

          *pREG_DMA31_STAT = ENUM_DMA_STAT_IRQDONE;

}

 

 

void initPPI2(void)

{

          *pREG_EPPI2_CTL = ENUM_EPPI_CTL_PACK_EN |     //pack enable

                                                    ENUM_EPPI_CTL_SWAP_EN |     //fist data on MSB data

                                                    ENUM_EPPI_CTL_DLEN08 |      //8bit transmit

                                                    ENUM_EPPI_CTL_FS1HI_FS2HI | //data valid on high level

                                                    ENUM_EPPI_CTL_POLC11 |      //sample data and sync signal on rising edge

                                                    ENUM_EPPI_CTL_SYNC2 | // 2 FS mode

                                                    ENUM_EPPI_CTL_INTFS | // internal frame sync

                                                    ENUM_EPPI_CTL_INTCLK | // internal clock

                                                    ENUM_EPPI_CTL_NON656 | // GP mode

                                                    ENUM_EPPI_CTL_TXMODE; // transmit mode (write memory)

          *pREG_EPPI2_CLKDIV = 0x3;

          *pREG_EPPI2_LINE = COL;

          *pREG_EPPI2_FRAME = ROW;

}

 

 

void initPPI2DMA(void)

{

          *pREG_DMA31_ADDRSTART = (void*)g_txBuffer;

          *pREG_DMA31_XCNT = COL / 32;

          *pREG_DMA31_XMOD = 32;

          *pREG_DMA31_YCNT = ROW;

          *pREG_DMA31_YMOD = 32;

          *pREG_DMA31_CFG = ENUM_DMA_CFG_MSIZE32 | ENUM_DMA_CFG_PSIZE04

                              | ENUM_DMA_CFG_ADDR2D | ENUM_DMA_CFG_YCNT_INT | ENUM_DMA_CFG_SYNC

                              | ENUM_DMA_CFG_READ | ENUM_DMA_CFG_AUTO;

          adi_int_InstallHandler(INTR_EPPI2_CH0_DMA, EPPI2_CH0_HANDLER, 0, true);

}

 

 

void enableEPPI2(void)

{

          *pREG_DMA31_CFG |= ENUM_DMA_CFG_EN;

          ssync();

          *pREG_EPPI2_CTL |= ENUM_EPPI_CTL_EN;

          ssync();

}

 

 

void disableEPPI2(void)

{

          *pREG_DMA31_CFG &= ~ENUM_DMA_CFG_EN;

          ssync();

          *pREG_EPPI2_CTL &= ~ENUM_EPPI_CTL_EN;

          ssync();

}

int main(void)

{

          adi_initComponents();

          adi_pwr_Init(25 * MHZTOHZ, 500 * MHZTOHZ, 125 * MHZTOHZ, 72 * MHZTOHZ);

          initPPI2();

          initPPI2DMA();

          enableEPPI2();

          while(1);

          return 0;

}

 

 

when i call enableEPPI2 function after init ppi and dma, the dma didn't send data to peripheral device.

Outcomes