EM77950
BB Controller
The following formula describes how to calculate the PWM duty cycle:
Duty Cycle = (DTX+1) * (2/Fosc)
PRD0L (0x23): Period of PWM0 low byte
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
PRD07
PRD06
PRD05
PRD04
PRD03
PRD02
PRD01
PRD00
PRD0H (0x24): Period of PWM0 high byte
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
PRD0F
PRD0E
PRD0D
PRD0C
PRD0B
PRD0A
PRD09
PRD08
PRD1L (0x29): Period of PWM1 low byte
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
PRD17
PRD16
PRD15
PRD14
PRD13
PRD12
PRD11
PRD10
PRD1H (0x2A): Period of PWM1 high byte
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
PRD1F
PRD1E
PRD1D
PRD1C
PRD1B
PRD1A
PRD19
PRD18
The PWM period is defined by writing to PRDX. When TMRX is equal to PRDX, the
following events occur on the next increment cycle:
TMRX is cleared.
The PWMX pin is set to 1.
The PWMX duty cycle is latched from DTPS to DUTY.
NOTE
The PWMX will not be set, if the duty cycle is 0;
The PWMXIF pin is set to 1.
The following formula describes how to calculate the PWM period:
Period = (PRD +2) * (2/Fosc)
The function of PWM must be disabled before a new period being executed. In other
word, bit PWMXE has to be reset by advance, if the contents of PRDX are reloaded.
PRIE (0x80): Peripherals enable control
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
SPIE
-
BBE
ADE
PWM1E
PWM0E
TCCE
FRCE
INTE (0x81): Interrupt enable control
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
GIE
RBFIE
PWM1IE PWM0IE
EINT1E
EINT0E
TCCOE
FRCOE
PWMCR (0x98): PWM control
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
-
-
-
-
S_PWM1 S_PWM0
-
-
Product Specification (V1.0) 10.09.2007
(This specification is subject to change without further notice)
• 77