ADCv3 and ADCv4 Analog Watchdog

Report here problems in any of ChibiOS components. This forum is NOT for support.
User avatar
FXCoder
Posts: 384
Joined: Sun Jun 12, 2016 4:10 am
Location: Sydney, Australia
Has thanked: 180 times
Been thanked: 130 times

ADCv3 and ADCv4 Analog Watchdog

Postby FXCoder » Fri May 22, 2020 1:33 am

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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: ADCv3 and ADCv4 Analog Watchdog

Postby Giovanni » Sat Feb 13, 2021 10:35 am

bump

User avatar
FXCoder
Posts: 384
Joined: Sun Jun 12, 2016 4:10 am
Location: Sydney, Australia
Has thanked: 180 times
Been thanked: 130 times

Re: ADCv3 and ADCv4 Analog Watchdog

Postby FXCoder » Wed Feb 17, 2021 1:14 am

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 156 times


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 19 guests