Adc Dma with BCTU

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

Adc Dma with BCTU

354 Views
emerging
Contributor III

Hello Team,

I have three adc groups contain 11 adc channels. Group1(3 channels) group2(5 channels) group3(3 channels)
We already done it as bctu triggered and adc read with transfer type is interrupt. Now i need to change the trasfer mode from interrupt to DMA
For this i enabled AdcEnableDmaTransferMode and changed AdcTransferType as ADC_DMA inside AdcHwUnit,also configured dma in mcl for this adc. Other than this there is anymore configuration i have to do like enabling CtuEnableDmaTransferMode and configuration inside BctuHwUnits etc are needed.
If possible please share any example that can support my activity

 

Thanks and regards,

Tags (3)
0 Kudos
Reply
4 Replies

97 Views
NamLee
NXP Employee
NXP Employee

Hi emerging,

I saw you got many issues with configuration, so i've done to create example working with your expectation in correctly RTD 2.0.0 version.

Please check the attached file. Password: NXP

3 things you should focus on:

- The Bctu hw unit configure, with the LIST channels and DMA transfer channel. This is important. Please follow my configuration in example.

- The Index of Internal trigger of Adc using for Bctu, should go with the correct value of source trigger. This is a bug from driver 2.0.0, when the source trigger not follow the index, but the value of source.

E.g AdcHwTrigger2, with source eMIOS0_4, then the index of it should be 2. But the driver takes the value of source as 4, then the register TRGCFG_[4] be setup, instead of  TRGCFG_[0]

My solution is, using the Index equal with trigger source. For example, the index0 should go with hardware trigger source 0, which is eMIOS0_0

NamLee_1-1722507931674.png

- One last suggestion, in the DMA configuration, due to 2.0.0 the DMA configure is not separate to Rm module, so in this configuration, please pay attention to not Enable the DMAMUX Trigger

NamLee_3-1722508022965.png

Other than that, all configuration of this quite common, you can follow my configuration.

As my test, the Dma raised request isr

NamLee_0-1722507267213.png

and the BctuDmaFifo1 buffer has data in it.

NamLee_4-1722508364894.png

Please check the example and give me questions here if you have.

Thank you,

Nam.

 

0 Kudos
Reply

258 Views
NamLee
NXP Employee
NXP Employee

Hi emerging,

After checking and supporting in private message, i think the reason comes from the BctuHwUnit did not get configured and the Trigger sources for ADC group are not correct.

Since the DMA works with external triggers, than i assume that the groups with BCTU trigger are not working.

If you intend to use BCTU triggers, then you have to configure the BCTU Hw Unit by enabling the CTU Control Mode API

NamLee_2-1721132228272.png

 

Then you can configure the BCTU group source with the corresponding eMIOS trigger

NamLee_3-1721132228280.png

The conversions can run with Single channel or LIST

Also, you can configure FIFO data to storage the ADC conversion results,...

As your channel groups are:

For trigger one i have to read
P6_ChanNum6
P0_ChanNum0
P2_ChanNum2

For trigger 2 i have to read
P7_ChanNum7
P3_ChanNum3
S8_ChanNum32
P1_ChanNum1
P5_ChanNum5

For trigger 3 i have to read
P6_ChanNum6 ( repeat)
P0_ChanNum0 ( repeat)
P4_ChanNum4

So, 

you put all channel stick together from ID 0 to ID 10.

The Trigger_0 should start from ID 0

NamLee_4-1721132360769.png

And in the Channel 2, you tick it as Last channel.

For Trigger_1, the Start ID is 3

and In channel 7 (P5_ChanNum5), select it as Last Channel.

This sequence is 2 lists with different number of channels, breakpoints and start ID

NamLee_5-1721132383236.png

You can read chapter 64.3.2.3 with CL channel rules

Also the FIFO data will be storage, with last channel conversion notification you can check the data for each group.

This should be describe in RM chapter 64.3.3

64.3.3 ADC conversion results access

 

This below is my summary, please let me know if you have further updates about this.

Thank you,

Nam.

0 Kudos
Reply

294 Views
nxf78987
NXP Employee
NXP Employee

Hello @emerging,

Could you let me know which is the RTD package you are using?

Best regards,

Dan

298 Views
NamLee
NXP Employee
NXP Employee

Hi emerging,

I got your private message. Please help me log a ticket in AP-Software community for tracking: https://community.nxp.com/t5/AP-Software-Support/bd-p/ap-software-support

Please share the version of RTD package that you're using, also the name of derivative.

If you can share the configuration files (.xdm) it will be better for checking.

Thank you,

Nam.

0 Kudos
Reply