Pulse-width modulation (PWM) is a technique that modifies the duty cycle of a pulsing signal to encode information or to control the amount of energy provided to a charge. The MCA implements pulse-width modulation in its firmware.

The MCA on the ConnectCore 8M Mini system-on-module provides one PWM controller. The controller has several channels and each channel maps to one MCA IO pin:

PWM controller Number of channels Channel IO

PWM0

6

0

MCA_IO0

1

MCA_IO12

2

MCA_IO15

3

MCA_IO16

4

MCA_IO17

5

MCA_IO18

On the ConnectCore 8M Mini:

  • All MCA PWM channels are available on the LGA pads.

  • PWM0 channel 0 is available on the castellated pads.

On the ConnectCore 8M Mini Development Kit: Most of the MCA pins with PWM capability are connected to different peripherals on the base board; make sure the pin is not in use for other functionality when evaluating it as PWM:

  • PWM0 channel 0 is available on J22-2 as SWD_DIO.

  • PWM0 channel 1 is connected to USER_LED1.

  • PWM0 channel 2 is available on J39-5 as XBEE1_RESET_N.

  • PWM0 channel 3 is available on J40-8 as XBEE1_ON/SLEEP_N.

  • PWM0 channel 4 is available on J32-16 as LVDS_PWM_OUT.

  • PWM0 channel 5 is connected to USER_LED2.

See MCA I/O pads for a list of all available MCA IOs and their capabilities.

Kernel configuration

You can manage the ConnectCore 8M Mini MCA PWM driver support through the following kernel configuration option:

  • Digi MCA PWM support (CONFIG_PWM_MCA)

This option is enabled as built-in on the default ConnectCore 8M Mini kernel configuration file.

Kernel driver

The driver for the ConnectCore 8M Mini MCA PWM is located at:

File Description

drivers/pwm/pwm-mca.c

MCA PWM driver

Device tree bindings and customization

The ConnectCore 8M Mini MCA PWM interface is documented at Documentation/devicetree/bindings/pwm/digi,mca-pwm.txt.

ConnectCore 8M Mini MCA PWM interfaces

The common ConnectCore 8M Mini device tree file contains entries for all the MCA PWM controllers:

ConnectCore 8M Mini device tree
mca_cc8m: mca@63 {
	pwms {
		compatible = "digi,mca-pwm";
		#address-cells = <1>;
		#size-cells = <0>;

		mca_pwm0: pwm@0 {
			reg = <0>;
			pwm-channels = <6>;
			#pwm-cells = <3>;
		};
	};
};

Using the MCA PWM channels

You can access PWM channels from your Android application. See PWM API for more information about the PWM APIx.

Sample application

The PWM Sample Application demonstrates the usage of the PWM API. In this example you can list all the available PWM chips and channels and configure the different PWM parameters.

Go to GitHub to see the application instructions and source code.

See also