# Photon DAC pin output not working - stuck at 3.26V

**URL:** <https://community.particle.io/t/photon-dac-pin-output-not-working-stuck-at-3-26v/16367>\
**Category:** Troubleshooting\
**Created:** [October 8, 2015, 9:40pm UTC](https://community.particle.io/t/photon-dac-pin-output-not-working-stuck-at-3-26v/16367 "2015-10-08T21:40:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![spoff](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@spoff](https://community.particle.io/u/spoff)\
**Post date:** [October 8, 2015, 9:40pm UTC](https://community.particle.io/t/photon-dac-pin-output-not-working-stuck-at-3-26v/16367/1 "2015-10-08T21:40:35Z")

</div>

I’m running a simple program to test the DAC output, making sure to use the pinMode before each analogWrite:

```auto

int led = D7;

void setup() {
  pinMode(led, OUTPUT);
}

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

  delay(5000);

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

  delay(5000);
}

```

I’m just reading a constant 3.26V on the DAC pin. I’ve tried changing the code to use the DAC2 pin (A3) and I’m also seeing a constant 3.26V there.

I’ve confirmed that I can read the voltage change on the D7 pin, so I don’t think it’s my meter. I’m using the Sparkfun Photon Redboard. Any thoughts?

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [October 9, 2015, 2:20pm UTC](https://community.particle.io/t/photon-dac-pin-output-not-working-stuck-at-3-26v/16367/2 "2015-10-09T14:20:06Z")

</div>

I think you are seeing this issue

> <https://github.com/particle-iot/firmware/issues/671>

---

<div class="post-metadata">

**Author:** ![spoff](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@spoff](https://community.particle.io/u/spoff)\
**Post date:** [October 9, 2015, 3:46pm UTC](https://community.particle.io/t/photon-dac-pin-output-not-working-stuck-at-3-26v/16367/3 "2015-10-09T15:46:13Z")

</div>

Confirmed.

I was able to get it working by flashing back to 0.4.5.

Thanks!

---

<div class="post-metadata">

**Author:** ![rocksetta](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rocksetta/32/5099_2.png) [@rocksetta](https://community.particle.io/u/rocksetta)\
**Post date:** [October 14, 2015, 9:50pm UTC](https://community.particle.io/t/photon-dac-pin-output-not-working-stuck-at-3-26v/16367/4 "2015-10-14T21:50:26Z")

</div>

@spoff hopefully not a stupid question. To flash back to 0.4.5 just select it from the build Devices menu and then click flash??

Also on the same tone of silly questions. Is anyone having issues with analog read from A0, A1 and A2 with firmware 0.4.6?

---

<div class="post-metadata">

**Author:** ![spoff](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@spoff](https://community.particle.io/u/spoff)\
**Post date:** [October 15, 2015, 12:38am UTC](https://community.particle.io/t/photon-dac-pin-output-not-working-stuck-at-3-26v/16367/5 "2015-10-15T00:38:13Z")

</div>

Unfortunately no. I was also hoping it was just a matter of selecting 0.4.5 in the menu as well.

To go back to 0.4.5, I had to install the Particle CLI and then flash the 0.4.5 version to my device through the CLI. But in order to do that, it was a somewhat laborious process of installing all the supporting software (I don’t work with this stuff often so it was a learning experience).

I would start here: [Tutorial: Particle-cli on Windows [07 Jun 2015]](https://community.particle.io/t/tutorial-particle-cli-on-windows-07-jun-2015/3112)

I believe I got the 0.4.5 files (there’s a part 1 and part 2) from the github page, but honestly don’t remember where. I think if you search the forums there’s a guidance on flashing the firmware. Hopefully that helps!

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [October 15, 2015, 7:30am UTC](https://community.particle.io/t/photon-dac-pin-output-not-working-stuck-at-3-26v/16367/6 "2015-10-15T07:30:47Z")

</div>

Once you got your system set up, in order to downgrade you need to make sure to flash part2 before flashing part1 (reverse order than upgrade).

Similar question with a link to the pre-built binaries here  
[analogWrite DAC only once for each pinMode( ,OUTPUT)](https://community.particle.io/t/analogwrite-dac-only-once-for-each-pinmode-output/15393/12?u=scruffr)

---

<div class="post-metadata">

**Author:** ![rocksetta](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rocksetta/32/5099_2.png) [@rocksetta](https://community.particle.io/u/rocksetta)\
**Post date:** [October 15, 2015, 2:21pm UTC](https://community.particle.io/t/photon-dac-pin-output-not-working-stuck-at-3-26v/16367/7 "2015-10-15T14:21:58Z")

</div>

@spoff @ScruffR. Can you clear something up for me? Does the Photon automatically upgrade to new firmware on a regular basis or just when you boot up for the first time? If it does automatically, can this ability be controlled in code? I would only like to upgrade the firmware when I know my Wifi strength is good.

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [October 15, 2015, 4:00pm UTC](https://community.particle.io/t/photon-dac-pin-output-not-working-stuck-at-3-26v/16367/8 "2015-10-15T16:00:55Z")

</div>

The Photon only upgrades automatically when you flash new code that is targeting this new version.  
Which currently is the default behaviour of Particle Dev and CLI, but on Web IDE you got the choice.  
If you change the target version from currently **`latest (0.4.6)`** to **`0.4.6`** or any of the previous ones your Photon will not be upgraded automatically when 0.4.7 arrives.

---

<div class="post-metadata">

**Author:** ![rocksetta](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rocksetta/32/5099_2.png) [@rocksetta](https://community.particle.io/u/rocksetta)\
**Post date:** [October 15, 2015, 6:16pm UTC](https://community.particle.io/t/photon-dac-pin-output-not-working-stuck-at-3-26v/16367/9 "2015-10-15T18:16:10Z")

</div>

That makes sense. So @spoff just sets his to 0.4.5 and it will not update even if he flashes new code. Thank you very much.
