cancel
Showing results for 
Search instead for 
Did you mean: 

Tımer Triggered ADC+DMA+USART

MÖZDA.1
Associate II
/* USER CODE BEGIN 0 */
void myPrintf(const char *p)
{
uint32_t strlength1=0;
uint32_t strlength2=0;
 
const char *helpStartTextpointer=p;
strlength1=0;
strlength2=strlen(p);
while(*p)
{
strlength1++;
*p++;
}
 
if (strlength1==strlength2 ){
if(HAL_UART_Transmit_DMA(&huart2, (uint8_t *) helpStartTextpointer, strlength2)!=HAL_OK)
{
Error_Handler();
}
}
}
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc){
 
 
adc_value=HAL_ADC_GetValue(&hadc1);
sprintf(buffer,"%d",adc_value);
myPrintf(buffer);
 
}
/* USER CODE BEGIN 2 */
HAL_TIM_Base_Start(&htim3);
HAL_ADC_Start_IT(&hadc1);
/* USER CODE END 2 */
Hi, I used triggered ADC and tried to write the values with USART, but before mentioning about USART problems, I have problems with Live Expressions, at the beginning my ADC value (ex. 3876) for a couple of minutes can be seen then it disappears and drops to 0 value I could not understand its reason, and it is showing the same value in the USART. Can you help me?WhatsApp Görsel 2023-07-03 saat 00.48.22.jpgEkran Alıntısı.JPGputty.JPG
0 REPLIES 0