beautypg.com

Section 14 – pwm, 1 – detailed description, 1 – pwmcn and pwmdata sfrs – Maxim Integrated DS4830 Optical Microcontroller User Manual

Page 113: Section 14, Detailed description, Pwmcn and pwmdata sfrs

background image

DS4830 User’s Guide

113


SECTION 14

– PWM


The DS4830 provides ten independent PWM output pins that can be used to create DC-DC power supply controllers or a
Thermoelectric Cooler Controller (TECC).

14.1

– Detailed Description


The DS4830 provides 10 independently configurable PWM outputs. The DS4830 PWM controller has 3 SFRs PWMCN,
PWMDATA and PWMSYNC for configuration and control of the 10 PWM outputs.

Using PWMCN and PWMDATA,

individual PWM channels can be programmed for unique duty cycles (DCYCn), configurations (PWMCFGn), and delays
(PWMDLYn), where n represents the PWM channel number.

PWM SFRs

The PWM block has 3 SFRs that are accessed in module 5 (PWMCN, PWMDATA and PWMSYNC). All aspects of the
PWM block can be programmed using these 3 SFRs.

14.1.1

– PWMCN and PWMDATA SFRs


The PWM Control SFR (PWMCN) along with the PWM Data SFR (PWMDATA) is used to configure and control individual
PWM channels. All the channels can be independently configured. Figure 14-1 illustrates how this is accomplished.

The PWMCN SFR has 4 bits (PWM_SEL) that select a particular PWM channel to be configured (See PWM Register
Descriptions for details). 2 bits (REG_SEL) within the PWMCN SFR allows for programming of 3 local registers for each
PWM Channel:

Duty Cycle (Register DCYCn),

Configuration (Register PWMCFGn)

Delay (Register PWMDLYn).


The PWMDATA SFR writes data to the particular local register pointed to by the PWM_SEL and REG_SEL bits as
illustrated in Figure 14-1. PWM_SEL auto increments after each read or write operation to PWMDATA register allowing
quick configuration.

The PWMCN SFR additionally allows enabling or disabling individual PWM Channels independently as well as update of
the Duty Cycle programmed in the DCYCn local register. Table 14-1 explains how the different Local Registers are
selected, and is discussed further in the Individual PWM detailed description section.

Table 14-1. Selecting the Local registers.

REG_SEL

Local Register Selected

00b

Duty Cycle Register (DCYCn)

01b

PWM Configuration Register (PWMCFGn)

1xb

Delay Setting Register (PWMDLYn)