English
Language : 

MEC1404 Datasheet, PDF (391/572 Pages) Microchip Technology – Keyboard and Embedded Controller Products for Notebook PC
MEC140X/1X
The frequency of the PWM pulse waveform is determined by the formula:
fPWM = ---2---5---6------f--c--l--Lo---cD--k----+-----1------
where fPWM is the frequency of the PWM, fclock is the frequency of the input clock (32.768 KHz clock or 48 MHz clock)
and LD is the contents of the LD field.
Note:
At a duty cycle value of 00h (in the MIN register), the LED output is fully off. At a duty cycle value of 255h,
the LED output is fully on. Alternatively, In order to force the LED to be fully on, firmware can set the CON-
TROL field of the Configuration register to 3 (always on).
The other registers in the block do not affect the PWM or the LED output in Blinking/PWM mode.
28.9.3 BREATHING EXAMPLES
28.9.3.1 Linear LED brightness change
In this example, the brightness of the LED increases and diminishes in a linear fashion. The entire cycle takes 5 sec-
onds. The rise time and fall time are 1.6 seconds, with a hold time at maximum brightness of 200ms and a hold time at
minimum brightness of 1.6 seconds. The LED brightness varies between full off and full on. The PWM size is set to 8-
bit, so the time unit for adjusting the PWM is approximately 8ms. The registers are configured as follows:
TABLE 28-9: LINEAR EXAMPLE CONFIGURATION
Field
PSIZE
MAX
MIN
HD
LD
Duty cycle most
significant bits
LED_INT
LED_STEP
8-bit
255
0
25 ticks (200ms)
200 ticks (1.6s)
000b
001b
8
8
10
10
010b
8
10
Value
011b
8
10
100b
8
10
101b
8
10
110b
8
10
1110
8
10
 2015 - 2016 Microchip Technology Inc.
DS00001956D-page 391