Part Number: TMS320F28379D
Tool/software:
I am trying to use DMA to capture EPWM6 TBCTR as a timestamp.
DMA trigger is ADCA INT1
I see one capture initially, but it stops capturing further.
If instead of EPWM6 TBCTR as source, I use another variable in RAM, I see that the value *is* updated as expected.
Key parameters are below. Do you see any issue or have suggestions about what the issue may be?
In the linker, timestamp_data : > RAMGS5 to locate variables in DMA-accessible RAM
#pragma DATA_SECTION(timestamp, "timestamp_data");
uint16_t timestamp;
const void* TimeStamp_ptr = (void *)×tamp;
const void* epwm6_TBCTR = (void *)(EPWM6_BASE + EPWM_O_TBCTR);
SysCtl_selectSecMaster(SYSCTL_SEC_CONTROLLER_DMA,SYSCTL_SEC_CONTROLLER_CLA);
DMA_initController();
DMA_setEmulationMode(DMA_EMULATION_FREE_RUN);
DMA_configAddresses(DMA_CH2_BASE, TimeStamp_ptr, epwm6_TBCTR);
DMA_configBurst(DMA_CH2_BASE, 1U, 0, 0);
DMA_configTransfer(DMA_CH2_BASE, 1U, 0, 0);
DMA_configWrap(DMA_CH2_BASE, 65535U, 0, 65535U, 0);
DMA_configMode(DMA_CH2_BASE, DMA_TRIGGER_ADCA1, DMA_CFG_ONESHOT_DISABLE | DMA_CFG_CONTINUOUS_ENABLE | DMA_CFG_SIZE_16BIT);
DMA_enableTrigger(DMA_CH2_BASE);
DMA_startChannel(DMA_CH2_BASE);
As I said, if I use a variable instead of TBCTR, it works as expected, triggering on ADCA1:
#pragma DATA_SECTION(test_timestamp_src, "timestamp_data");
uint16_t test_timestamp_src;
const void* test_timestamp_ptr = (void *)&test_timestamp_src;
DMA_configAddresses(DMA_CH2_BASE, TimeStamp_ptr, test_timestamp_ptr);
Thanks!