the DAC is external (the 8 PWMs gets filtered to get a fluctuating 0-3.3V DC). It's part of a much bigger circuit (multiple PCB's) (tuner for a synth), the schematic is just impossible to understand if you are not working on it
The 5V is supplyed by a filtered 78M05 wich ground is properly connected to Arduino's GND.
The DUE regulates its 3.3V from the 5V it regulates from the 12V supply. It is capable of driving 5V leds to my knowledge. Doesn't it?
Here is a simple code to illustrate the problem :
The values get outputted ONCE (strange because it is after the FastLED.show call) and then PWM stops working.
It works with NeoPixel's Library. Must be a problem with how FastLED handles it's output...
I'd still want to understand because i'd prefer to use FastLED.
#include <Adafruit_NeoPixel.h>
#define PIN 32
#define NUMPIXELS 10
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
}
void loop() {
pixels.clear(); // Set all pixel colors to 'off'
for(int i=0; i<NUMPIXELS; i++) { // For each pixel...
// pixels.Color() takes RGB values, from 0,0,0 up to 255,255,255
// Here we're using a moderately bright green color:
pixels.setPixelColor(i, pixels.Color(0, 150, 0));
pixels.show(); // Send the updated pixel colors to the hardware.
analogWrite(2, 4000);
delay(1000);
analogWrite(2, 0);
delay(1000);
}
}
The first sentence seems to be irrelevant, a 3V3 processor produces a 3V3 signal often less depending on the load it is driving.
The standard input signal to drive something is 0.7 Vcc, which for a 5V circuit is 3V5, so no it is not guaranteed to drive an WS2812 strip. It might work but you are In the flakey region of operations.
So in what way does these fluctuating voltages affect the DAC? An ADC I could understand but not an DAC.
More likely is that you have not set the data rate at 800KHz like you have done for the Adafruit version.
I mean, I used the DUE 5V output for my leds, but when the load increased (leds full bright), it affected the 3V3, so i switched to a external supply... wich outputs 5.2V.
But yeah you are very right!! I use the 3V3 to control them, and it's well beyond VCC-0.7... It still works to control the leds! From what i read, the first LED raises the signal to 5V. But do you think that some current my flow back to the PWM pin and mess with it?
Anyway if I have to reprint the PCB i'll add a level shifter.
So in what way does these fluctuating voltages affect the DAC? An ADC I could understand but not an DAC.
No no, the DAC converts PWM to a signal between 0v and 3V3, sorry I wasn't clear. But indeed, the leds loading arduino's 5V did lower the 3V3 PWM output wich is internally regulated from the 5V.
More likely is that you have not set the data rate at 800KHz like you have done for the Adafruit version.
I will look into this, but I think that Fastled does it when you set led type to WS2812. You think it could mess with analogwrite?
You were clear in what you said but I can't see what you did. Can you draw a schematic of the bit of the circuit between the PWM pin and the DAC.
Basically you don't need a DAC to do this, and given the nature of a PWM signal a DAC will not convert it into an analogue voltage.
Why use a DAC when a simple RC filter on the PWM pins will do this for you?
It could seeing you are on a Due which as a different clock speed.