Skip to content

Disabling DAC when reading from ADC is a problem sometimes #703

Open
@tedtoal

Description

@tedtoal

In wiring_analog.c, analogRead() disables the DAC if analogWrite() was previously used to enabled the DAC on the same pin.

In my situation, I am writing a value out the DAC and reading back in on the same pin using the ADC, as part of ADC calibration. Therefore, I don't want the DAC disabled.

A suggested fix is to add another function that is a copy of analogRead() with a new name (e.g. analogReadOptionalDisable()) with an additional argument 'bool disableDAC'. Use the argument to decide whether to disable the DAC or not. Change analogRead() to call this function with the argument 'true'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions