[MPC5746C] PIT+BCTU+ADC+DMA

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[MPC5746C] PIT+BCTU+ADC+DMA

751 Views
chenls
Contributor I

       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:

chenls_1-1662217042033.png

chenls_0-1662217747758.png

 

chenls_4-1662217302326.png

 

chenls_3-1662217188238.png

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.

 

 

 

 

0 Kudos
1 Reply

708 Views
PetrS
NXP TechSupport
NXP TechSupport

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

 

0 Kudos