command for ADC in DMA

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

command for ADC in DMA

1,139 次查看
mastupristi
Senior Contributor I

hallo,

I use Kinetis K64, and I need to send command to ADC by DMA.

I found some app note and quick guide that explain how to do:

adc-dma.png

If the command buffer is in RAM, it seems that DMA can access it and correctly transfer those commands in ADCx_SC1A.

Instead, if that buffer is in flash (ie. const declaration) it doesn't works:

adc-dma-flash.png

I cannot figure out why.

any suggestion?

best regards

Max

标签 (1)
标记 (5)
0 项奖励
回复
5 回复数

637 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi Max,

I've modified the edma demo which be included in the KSDK 1.2 for transfer the data from the Flash to SRAM by through the DMA mechanism.

And this demo can run on the FRDM-K64F board well. So I was wondering if you can share your demo, then I can reproduce this issue on the FRDM-K64 board.

I'm looking forward to your reply.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

637 次查看
mastupristi
Senior Contributor I

I also have FRDM-K64F board.

code is here

I use kds 3.0.0 with ksdk 1.3.0

if you go in main.c line 52

you can try to change

static  const uint8_t svett[ADC_CH_TOT] = { 20, 1 };

with

static  uint8_t svett[ADC_CH_TOT] = { 20, 1 };

best regards

max

0 项奖励
回复

637 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi Max,

When you debug the demo, I'd like to suggest that you can open the memory window to check what address the svett[ADC_CH_TOT] locates.

Hope it helps.
Have a great day,

Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

637 次查看
mjbcswitzerland
Specialist V

Hello Massimiliano

There may be another application note of interest here: http://www.utasker.com/docs/uTasker/uTaskerADC.pdf

Your DMA bus master should have authority to access Flash by default but check that you haven't taken it away by modifying FMC_PFAPR.

Regards

Mark

Kinetis: http://www.utasker.com/kinetis.html

K64: http://www.utasker.com/kinetis/FRDM-K64F.html / http://www.utasker.com/kinetis/TWR-K64F120M.html / http://www.utasker.com/kinetis/TWR-K65F180M.html

For the complete "out-of-the-box" Kinetis experience and faster time to market

:smileyinfo: Out-of-the-box support for 46 Kinetis boards and 10 IDEs (460 combinations from a single code source with no porting required)

0 项奖励
回复

637 次查看
mastupristi
Senior Contributor I

I tried modifing FMC_PFAPR in this way:

  FMC->PFAPR |= 0xFFFF;

without any cange in the behaviour

best regards

max

0 项奖励
回复