ADCv3 and ADCv4 Analog Watchdog

Report here problems in any of ChibiOS components. This forum is NOT for support.
Post Reply
User avatar
FXCoder
Posts: 403
Joined: Sun Jun 12, 2016 4:10 am
Has thanked: 188 times
Been thanked: 134 times

ADCv3 and ADCv4 Analog Watchdog

Post 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).
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: ADCv3 and ADCv4 Analog Watchdog

Post by Giovanni »

bump
User avatar
FXCoder
Posts: 403
Joined: Sun Jun 12, 2016 4:10 am
Has thanked: 188 times
Been thanked: 134 times

Re: ADCv3 and ADCv4 Analog Watchdog

Post 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
Attachments
ADCv4_AWD_patch.zip
(1.99 KiB) Downloaded 529 times
Post Reply