Hi,
I would like to use the DMA to receive a parallel 16Bit word on each Clock Cycle from an external Device, that also creates a Clock Signal for the corresponding Data.
I'm looking for some settings or configuration that allows only one DMA transfer per rising Clock edge or per high level of DMAE0 (as I could do so at the MSP430 DMA).
For test purposes i used some of the example codes, and connected an output Pin to the DMAE0 Pin that creates a simulated clock. In future this is created by an external Clock (about 1Mhz).
int main(void)
{
/* Halting Watchdog */
MAP_WDT_A_holdTimer();
/* Zero Filling the Destination */
memset(destinationArray, 0x00, 1024);
isFinished = false;
uint8_t* destptr=&destinationArray;
/* Configuring DMA module */
MAP_DMA_enableModule();
MAP_DMA_setControlBase(controlTable);
/* Setting Control Indexes. In this case we will set the source of the
* DMA transfer to our random data array and the destination to the
* destination data array. Set as auto mode with no need to retrigger
* after each arbitration */
MAP_DMA_setChannelControl(DMA_CH6_RESERVED0|UDMA_PRI_SELECT,
UDMA_SIZE_16 | UDMA_SRC_INC_NONE | UDMA_DST_INC_16 | UDMA_ARB_1);
MAP_DMA_setChannelTransfer(DMA_CH6_RESERVED0|UDMA_PRI_SELECT, UDMA_MODE_BASIC,(void*) &PCIN,
destptr, 512);
/* Assigning/Enabling Interrupts */
MAP_DMA_assignInterrupt(DMA_INT1, 6);
MAP_DMA_assignChannel(DMA_CH6_EXTERNALPIN);
MAP_Interrupt_enableInterrupt(INT_DMA_INT1);
MAP_Interrupt_disableSleepOnIsrExit();
//P9.4<-->P7.0;
//Set P9.4 to Output
P9OUT &= ~0x10;
P9DIR |= 0x10;//output
//set P7.0 to DMAE0
P7DIR &= ~0x01;
P7SEL0 |= 0x01;
P7SEL1 &= ~0x01;
/* Enabling DMA Channel 0 */
MAP_DMA_enableChannel(6);
while(1)
{
//Trigger DMAE0 for a single DMA Transfer?
P9OUT |= 0x10;
P9OUT &= ~0x10;
if(isFinished)
while(1);
}
}