Project

General

Profile

ADC demo

Added by Johan Henning over 1 year ago

A few remarks / opinions:
1. Instead of an attenuation value in dB I would prefer a scaling factor. Or a full range value (e.g. instead of 0dB a range of 0 .. 0.84V; instead of 2.5 dB a range of 0 .. 1.15V and so on). Or both indications (for the audio people and for the DVM people)
2. The maximum voltage seems to be 2.6V (with an attenuation of 11 dB). Is it not possible to use the full range (0..3.3V) with a higher attenuation?
3. Two warnings are generated (see below). Change the example to avoid this warning (set the sample time for the ADC block to for example 0.1 s)
4. It would be nice if the resolution and the attenuation can be set per ADC channel. Now it is per ADC module. What if I add two ADC modules, set them both to ADC Module 2 and specify a different resolution and/or attenuation and/or sample time. Is that possible, does that work?
5. When selecting module 2 the sample time disappears from the block. Why is that? It is still in the settings window of the block.

Warnings
Source 'esp32_adc_demo/ADC' specifies that its sample time (-1) is back-inherited. You should explicitly specify the sample time of sources. You can disable this diagnostic by setting the 'Source block specifies -1 sample time' diagnostic to 'none' in the Sample Time group on the Diagnostics pane of the Configuration Parameters dialog box.

The model reference sample time inheritance rule for block 'esp32_adc_demo/ADC' is not set and the model is sample time independent. The generated code from the block might produce incorrect results if it is referenced by a Model block. For S-functions, specify the model reference sample time inheritance rule through the ssSetModelReferenceSampleTimeInheritanceRule macro. You can suppress the diagnostic by setting Unspecified inheritability of sample time to 'none'. [5 similar]

Regards,
johan.