cancel
Showing results for 
Search instead for 
Did you mean: 

stm32 F407 Timer4 [TIM Input Capture Start DMA]

Bingtanghulu
Associate II

Dear experts,

i used stm32F407 ve make  a project.

Through GPIOE connected parallel 16 bit ADC,ADC_busy pin connected F407 Tim4_ch3, enable  Input Capture functions, and enable DMA (P to M mode).get a mounts of data one times.

i Referenced st demo,its demo is OK.

this demo is through DMA take tim4 register(CCR3) to internal RAM.

details:

HAL_StatusTypeDef HAL_TIM_IC_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length)

in this function internal,

///////////////////////////////////

case TIM_CHANNEL_3:
{
/* Set the DMA capture callbacks */
htim->hdma[TIM_DMA_ID_CC3]->XferCpltCallback = TIM_DMACaptureCplt;
htim->hdma[TIM_DMA_ID_CC3]->XferHalfCpltCallback = TIM_DMACaptureHalfCplt;

/* Set the DMA error callback */
htim->hdma[TIM_DMA_ID_CC3]->XferErrorCallback = TIM_DMAError ;

/* Enable the DMA stream */
if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC3], (uint32_t)&htim->Instance->CCR3, (uint32_t)pData,
Length) != HAL_OK)
{
/* Return error status */
return HAL_ERROR;
}
/* Enable the TIM Capture/Compare 3 DMA request */
__HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC3);
break;
}

/////////////////////////////

i want changed  (uint32_t)&htim->Instance->CCR3 to (uint32_t)(&(GPIOE->IDR))

to get ADC data,

but it not worked.

 

why?

 

thanks everybody!

my email:

wxqhit@126.com

 

 

3 REPLIES 3

thank you very much@ waclawek.jan

i will try it......

 

today,

I select TIM8 to DMA get GPIOE IDR, it's work. well, i am exciting.

thanks