Go Down

Topic: attiny85 with 3 PWN pins (Read 13 times) previous topic - next topic

hilukasz

is there any way to get a third PWM pin from attiny85 using arduino, maybe more? I have read up on it and it seems some people are saying you have to go straight to AVR. I am using arduino as an ISP but there isn't much info on it. There are some people saying that OC1B can be turned into PWM, but not sure if current version of programmer handles this.
for(i = 0, i < 820480075, i++){ Design(); Code(); delay(1000); } // hellowoo.com

Nick Gammon

It's nothing to do with the programmer, either the chip does it or it doesn't. The documentation seems to say that Timer 1 will run in PWM mode.

hilukasz

#2
Nov 29, 2012, 02:39 am Last Edit: Nov 29, 2012, 02:45 am by hilukasz Reason: 1
ah, I was reading: http://forums.adafruit.com/viewtopic.php?f=24&t=23937 and they said only two are PWM.

what pin would timer 1 be? I'm looking at the documentation, but am new to going straight to the doc, so not sure where to find this info. I am using http://www.atmel.com/Images/doc2586.pdf not sure if that is correct one to reference since it has a few ICs in it.
for(i = 0, i < 820480075, i++){ Design(); Code(); delay(1000); } // hellowoo.com

Coding Badly

is there any way to get a third PWM pin from attiny85 using arduino, maybe more?


The ATtiny85 processor has three pins capable of normal PWM.  Use this core...
http://code.google.com/p/arduino-tiny/

Quote
I have read up on it and it seems some people are saying you have to go straight to AVR.


Not necessary.

Coding Badly

ah, I was reading: http://forums.adafruit.com/viewtopic.php?f=24&t=23937 and they said only two are PWM.


They are wrong.

Quote
what pin would timer 1 be? I'm looking at the documentation, but am new to going straight to the doc, so not sure where to find this info.


Datasheet for ATtiny85.  "1. Pin Configurations" section.  Pins labeled with "OC" are Output Compare pins which are capable of PWM.  Pins with a bar over the label are inverted output and are not used.

OC1B (PB4), OC0A (PB0), OC0B (PB1) are the three PWM pins.

Go Up