dac+timer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-04-26 6:42 AM - last edited on ‎2024-04-26 6:49 AM by Sarra.S
void HAL_DAC_ConvCpltCallbackCh1(DAC_HandleTypeDef *hdac)
{
HAL_GPIO_TogglePin(START_OF_FRAME_GPIO_Port , START_OF_FRAME_Pin);
}
uint32_t val[] = { 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400};
HAL_DAC_Start_DMA(&hdac1, DAC_CHANNEL_1, val, 10, DAC_ALIGN_12B_R);
HAL_TIM_Base_Start(&htim2);
this is my simple code. why transfer complete interrupt is not on last data?
 
- Labels:
-
DAC
-
DMA
-
STM32U5 series
-
TIM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-04-26 6:58 AM
Hello @nimaltd,
Please share your DMA configuration
If you're configuring DMA in circular mode, it will automatically wrap around and start again from the beginning of the array once it reaches the end. This means the HAL_DAC_ConvCpltCallbackCh1 will be called not after the last data is transferred, but after each time the DMA completes a cycle through the array.
In your case, I think you want the interrupt to be triggered after the last data has been transferred, so, you need to configure the DMA in normal mode.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-04-26 7:03 AM
@Sarra.S thanks for answer. yes it is in circular mode. but starting again take lots of time, i need doing in circular mode and a callback for finishing the buffer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-04-29 12:46 AM
Dear @Sarra.S .  This is normal mode. but still has the same problem.
i have attached my project. please have a look. thanks
