2018-06-09 05:28 AM
Hey Guys,
I am using the ADC1 to sample A0 as a voltage input and A17 and A18 as temperature and VrefInt for Temperature and exact Vdda calculaion. So far my implementation works fine. I also calibrate the ADC everytime before I start the ADC. Datahandling is done via DMA in circular mode, so continous.
I also want to use the analog WatchDog to check wether my voltage on A0 is inside a specified range (0,8V - 3V). Sadly when I programm the lower and upper threshold value for the watchdog and try to test it with my laboratory power supply, The watchdog triggers from 2,7V not 3. When I compare the converted values I see some overshots in reading. As I am avagering my calculated values this is not bothering me, but for the accuracy of the WatchDog this is a problem.Has anybody seen this kind of behaviour before? Am I doing something wrong, or forgot something? Or is this inherent since the integrated ADC is simply not very accurate?
For the thresholds I used the following formula: HT = 3V * 4095/3,3V and LT = 0,8V * 4095/3,3V
So I would be happy for any help
best regards
Benjamin
#analog-watchdog #adc #adc-accuracy2018-06-19 06:47 AM
Hey AvaTar,
sorry for my late reply but I had other stuff to attend to. I measured the Vdda on the board after the L1 ferrite bead with my oscilloscope and a one second sampling intervall. There Vp+ is 3,3525V and Vp- is 3,3213V so this seems good for me. The power supply is very accurate i.e. 2,52V PS is 2,5205 on my calibrated multimeter. Concerning the shottky diodes I don't see them in the schematics of the Nucleo64..
best regards
Benjamin
2018-06-19 07:09 AM
I forgott to write that there seems to be a conversion fault of 0,001742,,,V . So for example I put in 1V, measure 1V at the A0 Input of the ADC but get 0,998258.. as a conversion result this would mean I have about 35 LSBs error. This seems a little high or am I misunderstanding here something?
Maybe this fault is due to my cnversion equation?
here it is:
Voltage.data = (float)((3.3 * (uint32_t) *VREFINT30_CAL_ADDR * tempVolt)/ (tempVref * 4095));
it's basically the suggestion from the manual..
best regards
Benjamin
2018-06-19 07:15 AM
but nevertheless the watchdog triggers at 0,84V allthoug I set it up for 0,799V at the lower end and at 2,99V at the upper end for a set threshold of 3V.
2018-06-19 07:19 AM
To be honest, I never really tried the AWD functionality of the F0 devices. Always used a software implementation (like you described), having the advantage of being adaptable e.g. for filtering, and portable to other platforms/devices.
Could be a matter of configuration settings, or settling time issues of the hardware. The AWD hardware supposedly consists of a DAC and a comparator.
2018-06-25 10:08 AM
Thanks so far for your help. I would say we keep it that way as everything is working fine without the AWD.
best regards
Benjamin