Page 1 of 1

ADCv3 and ADCv4 Analog Watchdog

Posted: Fri May 22, 2020 1:33 am
by FXCoder
Hi.
Seems that AWD support is only partially implemented in the ADCv3 and ADCv4 drivers.
So this is just a placeholder bug report at the moment pending implementation work yet to be done.
--
Bob

For example code in hal_adc_lld.c of ADCv4 at line 550...

Code: Select all

  /* ADC setup, if it is defined a callback for the analog watch dog then it
     is enabled.*/
  adcp->adcm->ISR   = adcp->adcm->ISR;
  adcp->adcm->IER   = ADC_IER_OVRIE | ADC_IER_AWD1IE;
 

And hal_adc_lld.c of ADCv3 at line 850...

Code: Select all

  /* ADC setup, if it is defined a callback for the analog watch dog then it
     is enabled.*/
  adcp->adcm->ISR   = adcp->adcm->ISR;
  adcp->adcm->IER   = ADC_IER_OVRIE | ADC_IER_AWD1IE;
  adcp->adcm->TR1   = grpp->tr1;
 


Also to be added callback fields in config and fields for TR2/3 (with any MCU conditional configuration).

Re: ADCv3 and ADCv4 Analog Watchdog

Posted: Sat Feb 13, 2021 10:35 am
by Giovanni
bump

Re: ADCv3 and ADCv4 Analog Watchdog

Posted: Wed Feb 17, 2021 1:14 am
by FXCoder
Hi Giovanni,
Did some work on ADCv4 patch which needs your review to see if I am on the right track.
1. Add new config fields for AWD2,3
2. Add handling for slave mode of above
3. Revise lld_start WRT setup for above
4. Revise handling in interrupt to process dual mode.
5. Probably needs some conditionals for H7 variants which remains TBI/TBD.

Do not have an H7 board on hand for testing ATM.
--
Bob