• Featured User: kurt


    Open-source hardware project hosting is my passion. I spend most of my free time building neat gadgets or planning what I'll build next. I love building things, and I want to make Open Hardware Hub a place that inspires others to build, ...

    Learn More

  • Updates 2013 February 18

    It's been a while, hasn't it? Well, that's ok because we've got a lot of updates to talk about. Most of these have been effective on the site fora couple weeks now. A few may or may not be active when this article gets posted, but they'll certainly be applied in the ...

    Find Out More

Explanation of 27-channel PWM shield

Download this project


By: Sasha-w

This LinkSprite PWM shield adds 27 independent  PWM channels to Arduino or pcDuino by using a dedicated PWM generation MCU: STM32F103C8T6. All the PWM pins of STM32 can support up to 5V.


The total number of PWM channels is 27. The duty cycle can be adjusted.  The channel number is labeled on the shield as below:



The four jump headers next to pwm 27 are for the selection of communication ports, such as SPI, UART and I2C.  Right now, the sample code we provide has only SPI interface.

The external power supply is specified to be between 7V to 24V.   The three pins header SWD is for firmware download to STM32.


The PWM shield has 27 PWM channels in total. Among these 27 channels, the 16 channels implemented by hardware in STM32 are  2, 3, 4, 7, 8, 9, 10, 11, 17, 18, 19, 20, 22, 23, 24 ,25, and are divided into  four groups. The channels within the same group has same output frequency, but with different adjustable duty cycles. Channels 2, 3, 4, and 7 are in the same group, channels 8, 9, 10, 11 are in the same group, 17, 18, 19, 20 are in the same group, and 22, 23, 24, 25 are in the same group.  The other channels are implemented by software, and each channel has its own frequency, but the higher the frequencies, the worse the resolution.


The communication protocol is as following:

/****************************Message format***************************************

index     Byte1   Byte2   Byte3     Byte4       Byte5       Byte6



The command has 6 bytes in total:

The command starts with a first byte “0x87”.

The second byte is the commands that need to be executed. The supported one are following:


#define CMD_SET_ON_OFF 0x01 (Turn on or off)

#define CMD_SET_POLARITY 0x02 (Polarity of the signal)

#define CMD_SET_FREQ 0x03 (Frequency of the signal)

#define CMD_SET_DUTY 0x04 (Duty cycle of the signal)


Description of the parameters:

1. The range of the duty cycle is between 0-10000, which corresponds to 0-100%.

2.  The precision of the channels implemented by software is 5uS, and the ones implemented by hardware is 0.5uS.

Download project description w/o images
Download project description w/ images


This open source hardware project contains no files.

Bill of Materials

This open source hardware project contains no parts.


This open source hardware project contains no steps.


2 -
1 - Initial project release
Add revision

blog comments powered by Disqus