Dear friends,
I want to use SCI2 TX and DMA. I searched both this forum and google. I tried everything which experts suggested. Also I downloaded an example code from this forum, even it did not work. (code is in the attachment) .
The steps I follwed are:
_enable_IRQ();
//loadDataPattern(D_SIZE1,&TX_DATA1[0]);
//loadDataPattern(D_SIZE2,&TX_DATA2[0]);
/* - initializing mibspi - enabling tg 0 */
sciInit();
/* - DMA Configuration */
/* Enable DMA */
dmaEnable();
/* Enable Interrupt after reception of data */
dmaEnableInterrupt(DMA_CH0, BTC);
/* assigning dma request: channel-0 with request line - 1 - TX*/
/* DMA Request 29 is for LIN ( SCI2) Transmit */
/* Refer Data sheet - Default DMA Request Map section */
dmaReqAssign(DMA_CH0,29);
/* --------------------------- */
/* First Transfer of 120 Words */
/* --------------------------- */
/* Reset the Flag */
DMA_Comp_Flag = 0xAAAA5555;
/* - Populate dma control packets structure */
dmaConfigCtrlTxPacket((uint32)(&TX_DATA1),
(uint32)(&(scilinREG->TD)),
D_SIZE1);
/* - setting dma control packets for transmit */
dmaSetCtrlPacket(DMA_CH0,g_dmaCTRLPKT);
/* Enable TX DMA */
scilinREG->SETINT |= (1 << 16);
/* - setting the dma channel to trigger on h/w request */
dmaSetChEnable(DMA_CH0, DMA_HW);
/* Wait for the DMA interrupt ISR to set the Flag */
while(DMA_Comp_Flag != 0x5555AAAA); //set in the DMA irq routine
/* Disable TX DMA */
scilinREG->CLEARINT = (1 < 16);
So, I need help :)
Levent