# pHAT DAC vs ws28128-rpi

**URL:** <https://forums.pimoroni.com/t/phat-dac-vs-ws28128-rpi/4905>\
**Category:** Support\
**Created:** [May 26, 2017, 10:10pm UTC](https://forums.pimoroni.com/t/phat-dac-vs-ws28128-rpi/4905 "2017-05-26T22:10:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![logickphp](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/logickphp/32/2460_2.png) [@logickphp](https://forums.pimoroni.com/u/logickphp)\
**Post date:** [May 26, 2017, 10:10pm UTC](https://forums.pimoroni.com/t/phat-dac-vs-ws28128-rpi/4905/1 "2017-05-26T22:10:02Z")

</div>

There is impossible to configure pHAT DAC HAT with other PWM Leds library because both uses the same GPIO PWM port (Physically 12 PIN). When play sound the led sequence STOP and then I am get error trying to play sound again.  
¿How I can configure additional PWM port in Raspberry PI ZERO when use pHAT DAC?  
Than you.

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [May 27, 2017, 7:39am UTC](https://forums.pimoroni.com/t/phat-dac-vs-ws28128-rpi/4905/2 "2017-05-27T07:39:40Z")

</div>

The library works out most of the details for you, you should be able to just change the pin, as defined here, to a PWM supporting alternative: [https://github.com/pimoroni/unicorn-hat/blob/master/library/UnicornHat/unicornhat.py#L9](https://github.com/pimoroni/unicorn-hat/blob/master/library/UnicornHat/unicornhat.py#L9)

---

<div class="post-metadata">

**Author:** ![logickphp](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/logickphp/32/2460_2.png) [@logickphp](https://forums.pimoroni.com/u/logickphp)\
**Post date:** [May 27, 2017, 10:00am UTC](https://forums.pimoroni.com/t/phat-dac-vs-ws28128-rpi/4905/3 "2017-05-27T10:00:25Z")

</div>

Yes I know but when change to anoher PWM pin obtain error when execute script  
It is no possible to set or output pwm.

---

<div class="post-metadata">

**Author:** ![RogueM](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/roguem/32/311_2.png) [@RogueM](https://forums.pimoroni.com/u/RogueM)\
**Post date:** [May 29, 2017, 9:02am UTC](https://forums.pimoroni.com/t/phat-dac-vs-ws28128-rpi/4905/4 "2017-05-29T09:02:21Z")

</div>

you must use a PWM capable pin, obviously, as per commentary in the referenced line @gadgetoid posted. In practice, you should use bcm13 and PWM channel 1 (on line 13).

---

<div class="post-metadata">

**Author:** ![logickphp](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/logickphp/32/2460_2.png) [@logickphp](https://forums.pimoroni.com/u/logickphp)\
**Post date:** [May 31, 2017, 4:03pm UTC](https://forums.pimoroni.com/t/phat-dac-vs-ws28128-rpi/4905/5 "2017-05-31T16:03:10Z")

</div>

It is not possible:

from neopixel import \*

# LED strip configuration:

LED\_COUNT = 20 # Number of LED pixels.  
LED\_PIN = 13 # GPIO pin connected to the pixels (must support PWM!).

then:

sudo python [strandtest.py](http://strandtest.py)  
Gpio 13 is illegal for LED channel 0  
Traceback (most recent call last):  
File “[strandtest.py](http://strandtest.py)”, line 83, in   
strip.begin()  
File “build/bdist.linux-armv6l/egg/neopixel.py”, line 115, in begin  
RuntimeError: ws2811\_init failed with code -11 (Selected GPIO not possible)  
ioctl\_set\_msg failed  
: Inappropriate ioctl for device  
ioctl\_set\_msg failed  
: Inappropriate ioctl for device

---

<div class="post-metadata">

**Author:** ![RogueM](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/roguem/32/311_2.png) [@RogueM](https://forums.pimoroni.com/u/RogueM)\
**Post date:** [May 31, 2017, 4:40pm UTC](https://forums.pimoroni.com/t/phat-dac-vs-ws28128-rpi/4905/6 "2017-05-31T16:40:48Z")

</div>

please read the commentaries in the code and responses within this topic carefully… as mentioned you want channel 1, not 0. It works, I tried it when we decided to include a contributor’s pull request adding support for it.

---

<div class="post-metadata">

**Author:** ![logickphp](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/logickphp/32/2460_2.png) [@logickphp](https://forums.pimoroni.com/u/logickphp)\
**Post date:** [May 31, 2017, 4:57pm UTC](https://forums.pimoroni.com/t/phat-dac-vs-ws28128-rpi/4905/7 "2017-05-31T16:57:40Z")

</div>

Yes.  
I need two PWM output because One for Phat Dac and other for Led Strip.  
The idea is led’s and sound works together in the same raspberry pi ZERO.

---

<div class="post-metadata">

**Author:** ![RogueM](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/roguem/32/311_2.png) [@RogueM](https://forums.pimoroni.com/u/RogueM)\
**Post date:** [May 31, 2017, 5:13pm UTC](https://forums.pimoroni.com/t/phat-dac-vs-ws28128-rpi/4905/8 "2017-05-31T17:13:59Z")

</div>

yes, that is the whole point of addressing the WS28xx via an alternative pin… the DAC will pipe sounds out through the I2S interface as normal while you will be driving the neopixels over PWM ch 1, as indicated.
