DAC not working on Photon

Hello,

I started working on a project and for it I need a DAC to implement it. I wanted to get a basic program running using the DAC but I have not been able to. I have the output of the DAC connected to a 5k resistor and I am measuring the voltage across that resistor and I always get ~3.3V.

int led = D7;
void setup() {
    pinMode(DAC1, OUTPUT);
    pinMode(D7, OUTPUT);
    digitalWrite(led, LOW);
}


void loop() 
{
    pinMode(DAC1, OUTPUT);
    analogWrite(DAC1, 4095);
    digitalWrite(led, HIGH);

    delay(5000);
    pinMode(DAC1, OUTPUT);
    analogWrite(DAC1, 0);
    
    digitalWrite(led, LOW);
    delay(5000);
}

@sbradford26, I can’t vouch for firmware 0.4.7 but I can tell you that in the soon to be released 0.4.9 firmware, the DAC works and no longer needs a pinMode() call. The new firmware is slated for release this week or next.

1 Like

There definetly was is an issue in 0.4.7, but as @peekay123 said, it’s been fixed and will be released soon
https://github.com/spark/firmware/issues/671

1 Like