Triggering SAR ADC conversion with BCTU, followed by a DMA transfer on the MPC5746R

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

Triggering SAR ADC conversion with BCTU, followed by a DMA transfer on the MPC5746R

Jump to solution
1,657 Views
erickarr
Contributor II

Hello,

I am using the PIT, to trigger the BCTU, to collect SAR ADC readings. I then want to use the BCTU to trigger a DMA transfer that will push that data into a location in RAM. So far, I successfully have the PIT, triggering the BCTU, which is gathering results from SAR2 ADC, and I can read them back in the BCTU ADC2DR register. I also have, a successful memory to memory DMA transfer setup, that I can trigger manually from software.

My belief, is that I should use the DMAMUX to configure the source of the DMA transfer, if so, then I am unsure if the source should be the BCTU, or the SAR of which the conversion is being triggered on. I have attached a screenshot of an excerpt from the reference manual with highlights to my references.

One of my confusions, is the reference to 'BCTU_n' in said table. I say that, because there is only a singular BCTU module in the MPC5746R. But, I am making the assumption, that 'BCTU_2' would align with a trigger from a completed conversion on SAR channel 2 through the BCTU.

I have tried using 'BCTU_2' as a source for my DMA transfer, on DMA channel 0, through DMAMUX 0. For DMA, I am using round robin groups and fixed priority channels within those groups. Then, I have also tried using 'SAR_ADC_2' as a trigger on DMAMUX 1, with a DMA channel of 16. I always configure my DMA channels before the MUX channels.

I can provide additional information, and code, if required. Just curious what I could be missing. Like I said, the PIT, BCTU, and SAR, have all been tested together successfully. As well as a DMA transfer from memory-to-memory, on various other channels.

Thank you very much for the help.

Regards,

Eric

0 Kudos
1 Solution
1,358 Views
erickarr
Contributor II

After leaving this, and coming back to it a month later and working on it for 5 minutes, it turns out I was configuring the DMAMUX incorrectly.

For anyones future reference, the DMAMUX CHCFG register to be written to, must be the DMA channel modulus 16. So if you are trying to configure DMAMUX 1 for DMA channel 7, then configure DMAMUX.CHCFG[7].

Cheers,

Eric

View solution in original post

2 Replies
766 Views
chenls
Contributor I

Hi Eric:

    Nice to see your issue. so far, I have similar problems to your issue. 

https://community.nxp.com/t5/Processor-Expert-Software/MPC5746C-PIT-BCTU-ADC-DMA/td-p/1516556

   Could you help me? Thank you very much.

0 Kudos
1,359 Views
erickarr
Contributor II

After leaving this, and coming back to it a month later and working on it for 5 minutes, it turns out I was configuring the DMAMUX incorrectly.

For anyones future reference, the DMAMUX CHCFG register to be written to, must be the DMA channel modulus 16. So if you are trying to configure DMAMUX 1 for DMA channel 7, then configure DMAMUX.CHCFG[7].

Cheers,

Eric