Skip to main content
added 4 characters in body; edited title
Source Link
dda
  • 1.6k
  • 1
  • 12
  • 18

PWM output while using i2cI2C with the ATTiny library

I've noticed that when using the USI interface on the ATTiny to send i2cI2C via the methods from "Wire.h" with the ATTiny Arduino implementation included from the library manager (ATTinyCore) that, while analogWrite PWM on PB4 (Arduino pin 4, physical pin 3) works OK, it seems attempting to use it on PB1 (Arduino pin 1, physical pin 6) behaves erratically or hangs the processor. 

Is this expected behavior, and is there a workaround? With the SDA line on PWM pin 0, physical pin 5 if that's the case it means when using the hardware USI to do i2cI2C communications, I'm down to a single hardware PWM output, which is kind of a bummer. 

enter image description here

PWM output while using i2c with the ATTiny library

I've noticed that when using the USI interface on the ATTiny to send i2c via the methods from "Wire.h" with the ATTiny Arduino implementation included from the library manager (ATTinyCore) that while analogWrite PWM on PB4 (Arduino pin 4, physical pin 3) works OK, it seems attempting to use it on PB1 (Arduino pin 1, physical pin 6) behaves erratically or hangs the processor. Is this expected behavior, and is there a workaround? With the SDA line on PWM pin 0, physical pin 5 if that's the case it means when using the hardware USI to do i2c communications I'm down to a single hardware PWM output, which is kind of a bummer.enter image description here

PWM output while using I2C with the ATTiny library

I've noticed that when using the USI interface on the ATTiny to send I2C via the methods from "Wire.h" with the ATTiny Arduino implementation included from the library manager (ATTinyCore), while analogWrite PWM on PB4 (Arduino pin 4, physical pin 3) works OK, it seems attempting to use it on PB1 (Arduino pin 1, physical pin 6) behaves erratically or hangs the processor. 

Is this expected behavior, and is there a workaround? With the SDA line on PWM pin 0, physical pin 5 if that's the case it means when using the hardware USI to do I2C communications, I'm down to a single hardware PWM output, which is kind of a bummer. 

enter image description here

Source Link
MattyZ
  • 135
  • 2
  • 5

PWM output while using i2c with the ATTiny library

I've noticed that when using the USI interface on the ATTiny to send i2c via the methods from "Wire.h" with the ATTiny Arduino implementation included from the library manager (ATTinyCore) that while analogWrite PWM on PB4 (Arduino pin 4, physical pin 3) works OK, it seems attempting to use it on PB1 (Arduino pin 1, physical pin 6) behaves erratically or hangs the processor. Is this expected behavior, and is there a workaround? With the SDA line on PWM pin 0, physical pin 5 if that's the case it means when using the hardware USI to do i2c communications I'm down to a single hardware PWM output, which is kind of a bummer.enter image description here