analog watchdog in adc

Post here first, or if you can't find a relevant section!
ag123
Posts: 857
Joined: Thu Jul 21, 2016 4:24 pm

analog watchdog in adc

Post by ag123 » Sun Jan 07, 2018 8:21 am

https://jeelabs.org/article/1619b/
Image
it seemed to be there in stm32f103 (i.e. all the BP & MM etc), has anyone played with it?
it seemed like an underutilised useful stuff
:D

zmemw16
Posts: 1687
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: analog watchdog in adc

Post by zmemw16 » Sun Jan 07, 2018 1:41 pm

anyone got a 4th to english translator :D
srp

dannyf
Posts: 231
Joined: Wed May 11, 2016 4:29 pm

Re: analog watchdog in adc

Post by dannyf » Sun Jan 07, 2018 3:09 pm

You should just think about it as a high resolution analog comparator with programmable threshold.

User avatar
mrburnette
Posts: 2232
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: analog watchdog in adc

Post by mrburnette » Sun Jan 07, 2018 3:14 pm

ag123 wrote:
Sun Jan 07, 2018 8:21 am
<...>
it seemed to be there in stm32f103 (i.e. all the BP & MM etc), has anyone played with it?
it seemed like an underutilised useful stuff
:D
I have seen mention of the capability in the ST PDF AN2834

However, I have not personally implemented this on the bench. Sounds promising.

Ray

ag123
Posts: 857
Joined: Thu Jul 21, 2016 4:24 pm

Re: analog watchdog in adc

Post by ag123 » Sun Jan 07, 2018 8:28 pm

actually i'm looking for a comparator and in stm32f103, the simple analog comparator isn't there. instead st substituted the comparator with 2 digital threshold comparators hide it in the adc and called it 'analog watchdog', that sounds good as well :lol:

a conventional LC meter circuit based on the ne555 uses 2 analog comparators as trigger and threahold detectors and configured as an astable multivibrator and have a 8051 cpu counting the pulses to deduce frequency
https://www.electronicshub.org/lc-meter ... 555-timer/

i'm thinking that these digital thresholds / triggers could work just as well as those conventional analog ones, and i save the trouble of needing an additional comparator etc
but i'm thinking perhaps there are other / better ways such as setting a timer to trigger/fire the ADC to sample after a fixed interval
take a couple of samples and i'd be able to work out the inductance or capacitance

but i'd think this 'analog watchdog' would have many more use cases than a simple LC meter use case, it could for instance be used as sensing triggers from capacitive or inductive sensors or for instance it could be made to trigger when the temperature from the build in temperature sensor reaches a particular temperature
:D

arpruss
Posts: 156
Joined: Sat Sep 30, 2017 3:34 am

Re: analog watchdog in adc

Post by arpruss » Tue Jan 23, 2018 4:30 am

ag123 wrote:
Sun Jan 07, 2018 8:21 am
has anyone played with it?
I just used the analog watchdog to implement an adapter that captures the irDA-formatted data in a PalmOne folding wireless keyboard and converts it to USB HID. It was kind of hard to figure out how to use it, but it seems to work. The incoming data has a high level of about 1.53v, so I use the ADC rather than GPIO to capture it. (Interestingly, the data also has levels reversed from standard irDA, because of where I capture the data.)

The code is really messy, but maybe it will help somebody with using the analog watchdog:
https://github.com/arpruss/palmirkeyboard_stm32f1

ag123
Posts: 857
Joined: Thu Jul 21, 2016 4:24 pm

Re: analog watchdog in adc

Post by ag123 » Tue Jan 23, 2018 7:22 am

interesting ! :D

i found some better codes for using the STM32ADC, it is actually part of the libmaple core distribution for F1
https://github.com/rogerclarkmelbourne/ ... s/STM32ADC
seem like the codes may have been contributed by stevestrong etc.
i saw some codes that aid the use of the analog watchdog, i've not used it personally though

arpruss
Posts: 156
Joined: Sat Sep 30, 2017 3:34 am

Re: analog watchdog in adc

Post by arpruss » Tue Jan 23, 2018 2:05 pm

I started by using that library, but it looks unfinished, so I just ended up doing things directly with the core functions.

stevestrong
Posts: 2072
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany
Contact:

Re: analog watchdog in adc

Post by stevestrong » Tue Jan 23, 2018 3:34 pm

arpruss wrote:
Tue Jan 23, 2018 2:05 pm
I started by using that library, but it looks unfinished, so I just ended up doing things directly with the core functions.
The community would be very happy to see your development, this would be a minimum contribution from your side. :)

arpruss
Posts: 156
Joined: Sat Sep 30, 2017 3:34 am

Re: analog watchdog in adc

Post by arpruss » Wed Jan 24, 2018 5:02 am

stevestrong wrote:
Tue Jan 23, 2018 3:34 pm
arpruss wrote:
Tue Jan 23, 2018 2:05 pm
I started by using that library, but it looks unfinished, so I just ended up doing things directly with the core functions.
The community would be very happy to see your development, this would be a minimum contribution from your side. :)
Maybe eventually. I am still polishing my USBHID library to make it more developer friendly. (It's already quite developer friendly if you just want to use the Keyboard/Mouse/Joystick/X360 controller, but it's not very friendly if you want to implement new HID devices. And the feature/output report support is still a bit of a mess.)

Post Reply