Coldfire+ MCF51QM128VLH: Problems with DMA and ADC

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

Coldfire+ MCF51QM128VLH: Problems with DMA and ADC

697 Views
marcwagner
Contributor I

Hello!

I would like to trigger the DMA after completed ADC Measurement. At the moment I am working with Processor Expert.

I configured the DMA module following the second example of Component DMATransfer_LDD with some modifications.

Some of the modifications are:

Trigger source type: Peripheral device

Trigger source: ADC0_DMA_Request

Data source Address: (uint32_t)&ADC0_RA

Data destination Address: &destBuffer

External object declaration: extern uint16_t destBuffer[];

For "Transfer control" I can't change to "Nested transfer". At the moment I set "Single transfer".

Event masks "OnComplete" and "OnError" are enabled.

After the initialisation of ADC and DMA y also allocate and enable the DMA channel for the DMA transfer.

The AD measurement is called in a loop with a delay of a few seconds. Unfortunately the DMA isn't  triggered and the event "OnComplete" is never reached.

What could be wrong? Has anybody an idea?

I am using Coldfire+ MCF51QM128VLH.

Thank you.

Regards,

Marc

Tags (3)
0 Kudos
Reply
2 Replies

511 Views
marcwagner
Contributor I

Hello again,

I almost could fix the problem myself by setting the DMA channel 2 instead of the channel 0.

But still isn't possible to set the Transfer control to "Nested transfer".

It appears following error:

Transfer mode is not supported by selected device! In this case, what does "device" mean ?

Beside of this problem after the first measurement a configuration error occurs.

By calling DMAT1_GetLastError I get the ErrorFlags 0x40000000 on Channel 2.

What could be the reason for this error?

Regards,

Marc

0 Kudos
Reply

511 Views
Petr_H
NXP Employee
NXP Employee

Hi,

it's probably too late be here are some findings regarding this issue:

-  There should be source address (&ADC_R0)+2 instead of &ADC0_R0, because of endian on the ColdFire+

- For channel 0  should be used trigger 14, instead of 13. The trigger 13 works only with channel 2.

- Regarding the error "Transfer mode is not supported by selected device! In this case, what does "device" mean ?" - the DMA component can work on different microcontrollers where the nested transfer  is supported. However, at ColdFire+ it's not.However, it's not clear why nested transfer is needed here...

The ErrorFlags 0x40000000 is a value of the DSC_BCR register which means "configuration error" which can have several causes. It could be

that ADC is still running = requests DMA transfer but all requested data has already been transmitted =DMA_BCR register = 0.

You can set  “Disable after transfer” property in the DMA_Transfer component  to “yes” value in order to disable next requests from ADC as soon as all data are transmitted -> DMA _BCR = 0.


In the current version of CodeWarrior (10.5) and DriverSuite (10.3) I recommend to use the newer component DMAChannel_LDD instead. It should be used for new design, because it has simpler configuration with more possibilities and and generates cleaner driver code.

Best regards

Petr Hradsky

Processor Expert Support Team

0 Kudos
Reply