Skip to main content
Associate II
June 8, 2024
Question

stm32 F407 Timer4 [TIM Input Capture Start DMA]

  • June 8, 2024
  • 1 reply
  • 1312 views

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

 

 

1 reply

waclawek.jan
Super User
June 8, 2024
Associate II
June 8, 2024

thank you very much@ waclawek.jan

i will try it......