Class QADC_AIN

  • All Implemented Interfaces:
    Impc555, IntbMpc555HB, Ippc32

    public class QADC_AIN
    extends Object
    implements IntbMpc555HB
    This driver configures one of the QADC modules (QADC-A or QADC-B) for analog input sampling operation.
    Both modules comprise of 16 input channels each. If one of the modules is initialized with the method init(...) all its 16 channels ADC are repetitively sampled every 1 ms and could be read with the method read(...).
    The channels are grouped into two groups of 8 channels each, PortA and PortB.
    PortB: PQB0(AN0), PQB1(AN1), PQB2(AN2), PQB3(AN3), PQB4(AN48), PQB5(AN49), PQB6(AN50), PQB7(AN51)
    PortA: PQA0(AN52), PQA1(AN53), PQA2(AN54), PQA3(AN55), PQA4(AN56), PQA5(AN57), PQA6(AN58), PQA7(AN59)

    One or several of the channels can be configured for digital I/O with QADC_DIO while the remaining channels still being used for analog input sampling. However, the method read(...) will not return meaningful data on the channels configured for digital I/O. IMPORTANT: Connect AGnd to Gnd! The input offset current of the internal multiplexer is rather high. Please make sure that the source impedance of your signal is below 10kΩ.
    • Constructor Detail

      • QADC_AIN

        public QADC_AIN()
    • Method Detail

      • read

        public static short read​(boolean qadcA,
                                 int channel)
        Returns the converted value of the given ADC channel.
        Parameters:
        qadcA - true means ADC-A and false means ADC-B.
        channel - Channel to read. Allowed channel numbers are 0..3 and 48..59.
        Returns:
        the converted value of the given channel.
      • init

        public static void init​(boolean qadcA)
        Initialize the analog/digital converter.
        Parameters:
        qadcA - true means ADC-A and false means ADC-B.