73 7-channel PWM driver controlled via SPI bus

73 : 7-channel PWM driver controlled via SPI bus

Select Project123456789ONSW2
  • Author: Ivan Krasin
  • Description: PWM driver with 7 channels and 256 PWM levels from 0 to 1
  • GitHub repository
  • Clock: 1000 Hz

How it works

uses a 8-bit counter to drive PWM on 7 output channels. Each channel is controlled by a dedicated 8-bit register that specifies its PWM level: 0 means always off, 1 is for 1/255 on, 5 is for 5/255 on and 255 is 255/255 (always on)

How to test

after reset, all output pins will be low. Use SPI writes with register addresses (0..6) to set 8-bit PWM levels. The corresponding pin will start oscillating between 0 and 1 according to the clock and the set level.

IO

#InputOutput
0clockout0
1resetout1
2csout2
3sclkout3
4mosiout4
5reservedout5
6reservedout6
7reservedmiso