ATTINY84 Arduino PWM Pins not working

Hey guys, this is my first post so please help me out.

I am using the attiny84 with the core from http://code.google.com/p/arduino-tiny/ and am trying to get all four PWM pins to work.

I am using really simple code to test it out

#define led1pin 5
#define led2pin 6
#define led3pin 7
#define led4pin 8

void setup()
{
  pinMode(led1pin,OUTPUT);
  pinMode(led2pin,OUTPUT);
  pinMode(led3pin,OUTPUT);
  pinMode(led4pin,OUTPUT);
}

void loop()
{
  analogWrite(led1pin,200);
  analogWrite(led2pin,200);
  analogWrite(led3pin,200);
  analogWrite(led4pin,200);
  delay(200);
  analogWrite(led1pin,0);
  analogWrite(led2pin,0);
  analogWrite(led3pin,0);
  analogWrite(led4pin,0);
  delay(200);
}

but for some reason only the led put on pin 5 is flashing, the rest of the them wont respond at all. can anyone tell me how to approach this problem? I am not sure what exactly I can do since shouldnt the core files take care of PWM for all four pins?

Thanks, Din See

http://code.google.com/p/arduino-tiny/source/browse/trunk/hardware/tiny/cores/tiny/pins_arduino.c#161

Pins 2 through 5 are PWM pins.

WOW i am so silly. Thank you so much. I was following the pin out from this website but I forgot that he might be using a different core...

http://academy.cba.mit.edu/content/tutorials/09_Embedded_Programming/Programming_ATtiny_with_Arduino_IDE.html

The Microcontroller Reference Sheet (http://www.akafugu.jp/images/microcontroller-reference-sheet.png) shows the pin names and functions for a bunch of Arduino cores.

so if i am refering to a digital pin i just use the pin number but if i am referring to a analog pin i use A#?

I don't think the Tiny Core has the A* constants defined but the test is trivial to run.

Do not call pinMode when using pins for analogRead.

Analogs are reference by their ADC number (ADC2 is Analog 2).

I can find no diagrams at all that refer to those pin numbers for the pwm pins yet i used those numbers in my sketch and it all works fine! in this instance 2 is bottom right, 3,4 and 5 are bottom left and work up? All the diagrams i have seen refer to them as 5,6,7 and 8? Any explanations welcome please :)

There are two pin mappings in widespread use for the attiny84 - one has the pins numbered clockwise, the other has them numbered counterclockwise. This just effects the mapping of the arduino pin numbers, so the PWM pins have different numbers under the two numbering systems - the arduino pin numbers are assigned by the core, and are totally arbitrary (though clever pin numbering can slightly change the size of the compiled binary - sometimes you can eliminate the lookup table)

My ATTinyCore supports both pin numberings (with a submenu in tools after selecting the board)

https://github.com/SpenceKonde/ATTinyCore