I'm trying to control an RGBW analog LED-strip by PWM modulation.
When using an Attiny45 the LED-strip just blinks at a low frequency (approx. 2-3 hz). However, using a Raspberry Pi 3 to control PWM works without a problem, and at any frequency of PWM I try.
Any ideas as to why that could be?
In my test setup I power the Attiny45 by connecting to the 3.3V pin on the Pi (for now, will change later).
I have programmed the Attiny45 via SPI on the Pi using the Avrdude linuxspi module, following this instructable.
The setup is the same for both tested controllers:
The control pin with PWM output drives a MOSFET (IRLZ34NPBF), which connects one of the color leads on the strip to ground (which is connected to the Pi's ground).
An external power supply, rated for use with my LED-strip powers the strip, with the ground connected to the Pi's ground.
I have tried all different PWM frequencies on the Attiny45 (by default clocked at 8MHz, so I shouldn't even see a flicker on the lowest PWM frequency, which is 8MHz/(256*1024)=~30.5Hz (according to the official Datasheet, page 74)) and the same frequency on the Pi, which works without flickering.
The Attiny45 can drive a single LED using the same MOSFET setup without flickering.
I tried adding a small value resistor (R1, 620Ohm) between gate and source of the MOSFET to counteract a floating state when the PWM is off, but it doesn't make a difference.
I'm looking forward to your input!