I wanna use PIT to trigger the BCTU, to trigger a conversion list for SAR ADC sampling. and then want to use the BCTU to trigger a DMA transfer that will push that data into a location in RAM. I have done something, some succeeded,and some failed.
I tried to use pit channel 7 to trigger BCTU channel 55 , and I found that pit channel 7 worked normally,but bctu was not triggered successfully. And then I used software to trigger BCTU ,I succeeded. I could read data from ADC1_DATA, the register of BCTU. And then I found ADC had been triggered Successfully. But eDma failed.
So I have two questions:
(1) How to use hardware to trigger bctu?
(2)How to use bctu to trigger DMA request?
I read the manual, and I did some configuration on processor expert, like the following:
So Could you tell me what was wrong about my configuration, and how to resolve my questions above i have mentioned. Thanks. The sincerity anticipates your reply.
Hi,
1) trigger config looks normal and should be enough to call below with trgIndex=55
BCTU_DRV_ConfigTriggerSingle(INST_BCTU1, trigIndex, &bctu1_trigConfig0, ADC_CHAN_NUM);
DEV_ASSERT(status == STATUS_SUCCESS);
/* Move out of configuration mode */
BCTU_DRV_WriteGlobalTriggerEn(INST_BCTU1, true);
2) if ADC_1 is triggered and ADC1DR data transferring by DMA enabled, then you should select BCTU[1] request within DMA setting.
Finally with software DMA channel have to be configured. You can refer to edma_transfer example.
BR, Petr