4.20.1 10-bit PWM

10-bit Pulse-Width Modulator

4.20.1.1 Introduction

This module is a 10-bit Pulse-Width Modulator (PWM) module that generates a pulse-width modulated signal determined by the duty cycle, period, and resolution.

4.20.1.2 Supported Device Families

PIC12/16F150x PIC12/16F161x PIC12/16F184x
PIC12/16LF155x PIC16F145x PIC16F152xx
PIC16F153xx PIC16F170x PIC16F171x
PIC16F176x PIC16F177x PIC16F180xx
PIC16F183xx PIC16F184xx PIC16F188xx
PIC16F191xx PIC16LF156x PIC18F-K40
PIC18F-K42 PIC18F-K83 PIC18F-Q10

4.20.1.3 Required Header Files

#include "mcc_generated_files/pwm/pwm[x].h"
Note: Replace [X] with the instance number of the selected PWM module.

4.20.1.4 Module Documentation

4.20.1.4.1 PWMx

This file contains the API prototypes for the PWMx driver.

Module description

This file contains the API prototypes for the PWMx driver.

Version: PWMx Driver Version 2.0.2

Function Documentation

PWMx_Initialize()

void PWMx_Initialize (void )

Initializes the PWMx interface.

Parameters:
None.
Returns:

None.

Section: Included FilesSection: PWM Module APIs

PWMx_LoadDutyValue()

void PWMx_LoadDutyValue (uint16_t dutyValue)

Loads the 16-bit duty cycle value.

Parameters:
uint16_t

dutyValue - PWMx duty cycle value to be loaded.

Returns:

None.

4.20.1.5 File Documentation

4.20.1.5.1 source/pwmx.c File Reference

This file contains the API implementations for the PWMx module.

#include <xc.h>
#include "../pwmx.h"

Detailed Description

This file contains the API implementations for the PWMx module.

PWMx Generated Driver File

Version: PWMx Driver Version 2.0.2

4.20.1.5.2 source/pwmx.h File Reference

#include <xc.h>
#include <stdint.h>

Detailed Description

PWMx Generated Driver API Header File

Macro Definition Documentation

PWMX_INITIALIZE_DUTY_VALUE

#define PWMX_INITIALIZE_DUTY_VALUE 511

Section: Included FilesSection: Macro Declarations