cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with DMA-ADC and LowPower Mode

enke
Associate II
Posted on December 06, 2009 at 11:57

Problem with DMA-ADC and LowPower Mode

6 REPLIES 6
16-32micros
Associate III
Posted on May 17, 2011 at 13:32

Hi mates,

Yes, This is absolutely possible; and this is the beauty of STM32 with DMA ;) .

However this is only in Sleep mode not in STOP like the case from enke, because in STOP mode , all clocks on the internal busses are freezed, In Sleep Mode only CPU is OFF and is no more fetching from Flash, SRAM and you can put inside your main polling routine

while(1)

{

{WFI or WFE } ;

}

With this scheme : DMA is working in Back-to-back and CPU will wake-up only for IRQ and exceptions and all with minimum Low power, saving some cycles on DMA accesses.

Cheers,

STOne-32.

[ This message was edited by: STOne-32 on 02-12-2009 21:54 ]

enke
Associate II
Posted on May 17, 2011 at 13:32

Hi,

i have a Problem with the ADC. I configured the ADC with DMA-Access. Sometimes, after a Wakeup from LowPower-Mode the ADC-Values does not update. The ADC does not work. Do you have any idea?

Do i have to restart the ADC?

Florian

Enter Sleep Mode:

PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);

WakeUp:

//Enable HSE

RCC_HSEConfig(RCC_HSE_ON);

//Wait till HSE is ready

HSEStartUpStatus = RCC_WaitForHSEStartUp();

if(HSEStartUpStatus == SUCCESS)

{

RCC_PLLCmd(ENABLE); //Enable PLL

while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET)

//Wait till PLL is ready

{}

RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK); //Select PLL as system clock source

while(RCC_GetSYSCLKSource() != 0x08) //Wait till PLL is used as system clock source

{}

}

else

{

NVIC_GenerateSystemReset();

}

spam3
Associate II
Posted on May 17, 2011 at 13:32

Hi enke, i'm having similar issues with mixing DMA access and sleep mode. In my case it's on the ethernet controller: everything seem to be ok with the ethernet chip itself, but there is nothing in the DMA buffer in the end. It seems that your issue is also related to the DMA controller rather than the ADC controller.

ST people: is it possible to use DMA while the chip is in sleep mode?

enke
Associate II
Posted on May 17, 2011 at 13:32

Hi ST,

do you have an Idea how i can fix my problem?

Florian

enke
Associate II
Posted on May 17, 2011 at 13:32

Hi STMicroelectronics,

can you give me an hint, how i can found a soluten for my problem? After a complete Reset the ADC works fine again. I tried to re_init the DMA. But that doesnt work. How can i restart my ADC or DMA without rebooting the controller?

Florian

tomas23
Associate II
Posted on May 17, 2011 at 13:32

Hi enke, the peripherals (DMA, ADC etc.) have their own ''peripheral'' reset (see ADC_DeInit, DMA_DeInit).

After wake-up, reset these peripherals and reconfigure. Tell us if it solved the case.