4

Good day! I would like to use pwm and interrupt on raspberry GPIO pins but i don't know which GPIO pins are actually dedicated for pwm output and which is for hardware interrupts, is there a way for me to know which is which? TIA!

Ghanima
  • 15,958
  • 17
  • 65
  • 125
Rev Inguito
  • 63
  • 1
  • 6

1 Answers1

1

All the GPIO may raise interrupts. On Pis with the 40 pin expansion header that is GPIO 2 to GPIO 27 (you can also use GPIO 0 and 1 but their use is discouraged).

The following GPIO may be connected to hardware PWM (note, there are only TWO channels).

12  PWM channel 0  A+/B+/Pi2/Zero and compute module only
13  PWM channel 1  A+/B+/Pi2/Zero and compute module only
18  PWM channel 0  All models
19  PWM channel 1  A+/B+/Pi2/Zero and compute module only

40  PWM channel 0  Compute module only
41  PWM channel 1  Compute module only
45  PWM channel 1  Compute module only
52  PWM channel 0  Compute module only
53  PWM channel 1  Compute module only

Hardware timed PWM can be provided by software on all GPIO on the expansion header (not as flexible as full hardware PWM, similar to Arduino e.g. 800Hz, 255 steps).

joan
  • 71,852
  • 5
  • 76
  • 108