Something wrong with ATTiny85 and its 2 PWM outputs

Hi, i have a problem with an attiny85 when using both PWM outputs.

Configured everything from this article using the Tiny AVR Programmer:
https://learn.sparkfun.com/tutorials/tiny-avr-programmer-hookup-guide/

This is my sample code:

int led0 = 0;    
int led1 = 1; 

void setup()  { 
  pinMode(led0, OUTPUT);
  pinMode(led1, OUTPUT);
} 

void loop()  { 
  analogWrite(led0, 50);   
  analogWrite(led1, 50);
  delay(1000);
  analogWrite(led0, 250);   
  analogWrite(led1, 250);
  delay(1000);
}

So in short it should light up 2 LEDS and vary its light intensity every 1 second.
Pretty simple sample that works on an Arduino with no issues.

On an ATTiny85 the LED's flicker, both on 1mhz internal clock and 8mhz internal clock, if i disconnect one LED from the PIN it works again, the problem is only when both are in use.

Tried BlinkWithoutDelay to not use Delay function, it didn't solve the problem.

I dunno why this is happening, I've seen samples on using the ATTiny85 to control an RBG LED using 3 PWM's i cant seem to work with 2.

Here is a video to demonstrate
http://1drv.ms/1AD8OeH

Hi Se3ker

Please post a schematic diagram of how your hardware is connected.

Your link takes me to an empty folder on OneDrive.

Thanks

Ray

Try now

OK, video works now.

I don't see any resistors in series with the LEDs?

Also... where is your decoupling capacitor?

ATtiny85 processors have three Arduino compatible PWM pins.

  1. D0 (IC pin 5)
  2. D1 (IC pin 6)
    and
  3. is on which?

seeker,
I can't make out your wiring from your video.
A photo would be best.

PB4, physical pin 3.

You need resistors on the LEDS. You may be drawing too much current through the microcontroller causing a reset loop.
If you keep using it like that you WILL burn something out

fungus:
Also... where is your decoupling capacitor?

Which ones and how many do i actually need??

Se3ker:

fungus:
Also... where is your decoupling capacitor?

Which ones and how many do i actually need??

If there was more than one I'd have said "decoupling capacitorS".