Top Banner
Darwin Altamirno Jaime Tipanluisa Microcontrolador es
17

PWM 16f887

Oct 22, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: PWM 16f887

Darwin Altamirno

Jaime Tipanluisa

Microcontroladores

Page 2: PWM 16f887

MODULO CCP PWM

Page 3: PWM 16f887

El pic 16f887 tiene dos módulos CCP

CCP1

CCP2

Page 4: PWM 16f887

Configuración PWM Para manejar el modulo CCP como PWM

debemos tener en cuenta las siguientes características.

Page 5: PWM 16f887
Page 6: PWM 16f887
Page 7: PWM 16f887

• Periodo PWM

Periodo PWM (T) = (PR2 +1) * Tosc * PRE

Frecuencia PWMFrecuencia_pwm  =  F_osc / [4 x PRE x (PR2+1)]

Ciclo de Trabajo PWM (Duty Cycle)

Ancho de Pulso= (CCPR1L,DC1B1,DC1B0) * Tosc * TMR2

Page 8: PWM 16f887
Page 9: PWM 16f887

Resolucion del PWM

Page 10: PWM 16f887
Page 11: PWM 16f887
Page 12: PWM 16f887

Registro CCP1CON

Si CCP1M<3:2> = 11:00 = Single output; P1A modulated; P1B, P1C, P1D assigned as port pins01 = Full-Bridge output forward; P1D modulated; P1A active; P1B, P1C inactive10 = Half-Bridge output; P1A, P1B modulated with dead-band control; P1C, P1D assigned as port pins11 = Full-Bridge output reverse; P1B modulated; P1C active; P1A, P1D inactive

bit 5-4 DC1B<1:0>: Bits menos significativos del ciclo de trabajo PWM

Page 13: PWM 16f887

bit 3-0 1100 = PWM mode; P1A, P1C active-high; P1B, P1D active-high

1101 = PWM mode; P1A, P1C active-high; P1B, P1D active-low

1110 = PWM mode; P1A, P1C active-low; P1B, P1D active-high

1111 = PWM mode; P1A, P1C active-low; P1B, P1D active-low

Page 14: PWM 16f887
Page 15: PWM 16f887
Page 16: PWM 16f887

bit 7-6

No implementados se lee como cero

bit 5-4

DC2B<1:0>: Bits menos significativos del ciclo de trabajo PWM

bit 3-0

CCP2M<3:0>: Modo de trabajo del modulo CCP2

11xx = modo PWM.

Page 17: PWM 16f887

GRACIAS