C8051F340/1/2/3/4/5/6/7

22.2. Capture/Compare Modules

Each module can be configured to operate independently in one of six operation modes: Edge-triggered Capture, Software Timer, High Speed Output, Frequency Output, 8-Bit Pulse Width Modulator, or 16-Bit Pulse Width Modulator. Each module has Special Function Registers (SFRs) associated with it in the CIP-51 system controller. These registers are used to exchange data with a module and configure the module's mode of operation.

Table 22.2 summarizes the bit settings in the PCA0CPMn registers used to select the PCA capture/com- pare module’s operating modes. Setting the ECCFn bit in a PCA0CPMn register enables the module's CCFn interrupt. Note: PCA0 interrupts must be globally enabled before individual CCFn interrupts are rec- ognized. PCA0 interrupts are globally enabled by setting the EA bit and the EPCA0 bit to logic 1. See Figure 22.3 for details on the PCA interrupt configuration.

Table 22.2. PCA0CPM Register Settings for PCA Capture/Compare Modules

PWM16

ECOM

CAPP

CAPN

MAT

TOG

PWM

ECCF

Operation Mode

X

X

1

0

0

0

0

X

Capture triggered by positive edge on

CEXn

 

 

 

 

 

 

 

 

X

X

0

1

0

0

0

X

Capture triggered by negative edge on

CEXn

 

 

 

 

 

 

 

 

X

X

1

1

0

0

0

X

Capture triggered by transition on CEXn

X

1

0

0

1

0

0

X

Software Timer

X

1

0

0

1

1

0

X

High Speed Output

X

1

0

0

X

1

1

X

Frequency Output

0

1

0

0

X

0

1

X

8-Bit Pulse Width Modulator

1

1

0

0

X

0

1

X

16-Bit Pulse Width Modulator

X = Don’t Care

(for n = 0 to 4)

 

 

PCA0CPMn

 

 

 

PCA0CN

 

 

PCA0MD

 

 

P

E

C

C

M

T

P

E

 

C

C

 

C

C

C

C

C

 

C

WW

 

C

C

C

E

 

 

W

C

A

A

A

O

W

C

 

F

R

 

C

C

C

C

C

 

I

D D

 

P

P

P

C

 

 

M

O

P

P

T

G

M

C

 

 

 

 

F

F

F

F

F

 

D

T L

 

S

S

S

F

 

 

1

M

P

N

n

n

n

F

 

 

 

 

4

3

2

1

0

 

L

E C

 

2

1

0

 

 

 

 

6

n

n

n

 

 

 

n

 

 

 

 

 

 

 

 

 

 

 

K

 

 

 

 

 

 

 

 

n

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

PCA Counter/

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Timer Overflow

 

 

 

 

 

 

 

 

 

 

 

 

 

1

 

ECCF0

 

PCA Module 0

0

EPCA0

 

 

(CCF0)

1

 

 

ECCF1

 

PCA Module 1

0

 

(CCF1)

1

 

 

ECCF2

PCA Module 2

0

(CCF2)

1

 

ECCF3

PCA Module 3

0

(CCF3)

1

 

ECCF4

PCA Module 4

0

(CCF4)

1

 

EA

 

0

0

Interrupt

1

1

Priority

Decoder

 

 

Figure 22.3. PCA Interrupt Block Diagram

Rev. 0.5

265

Page 265
Image 265
Silicon Laboratories C8051F346, C8051F347 PCA0CPM Register Settings for PCA Capture/Compare Modules, Operation Mode