English
Language : 

MEC1322 Datasheet, PDF (331/456 Pages) Microchip Technology – Keyboard and Embedded Controller for Notebook PC
MEC1322
28.8.2 BLINKING
When configured for blinking, a subset of the hardware used in breathing is used to implement the blinking function. The
PWM (an 8-bit accumulator plus an 8-bit duty cycle register) drives the LED directly. The Duty Cycle register is pro-
grammed directly by the user, and not modified further. The PWM accumulator is configured as a simple 8-bit up counter.
The counter uses the 32.768 KHz clock, and is pre-scaled by the Delay counter, to slow the PWM down from the 128Hz
provided by directly running the PWM on the 32.768 KHz clock.
With the pre-scaler, the blink rate of the LED could be as fast as 128Hz (which, because it is blinking faster than the eye
can distinguish, would appear as a continuous level) to 0.03125Hz (that is, with a period of 7.8ms to 32 seconds). Any
duty cycle from 0% (0h) to 100% (FFh) can be configured, with an 8-bit precision. An LED with a duty cycle value of 0h
will be fully off, while an LED with a duty cycle value of FFh will be fully on.
In Blinking mode the PWM counter is always in 8-bit mode.
Table 28-7, "LED Blink Configuration Examples" shows some example blinking configurations:
TABLE 28-7: LED BLINK CONFIGURATION EXAMPLES
Prescale
Duty Cycle
Blink Frequency
000h
000h
001h
003h
07Fh
0BFh
0FFh
180h
1FFh
00h
128Hz
FFh
128Hz
40h
64Hz
80h
32Hz
20h
1Hz
16h
0.66Hz
10h
0.5Hz
0Bh
0.33Hz
40h
0.25Hz
Blink
full off
full on
3.9ms on, 11.6ms off
15.5ms on, 15.5ms off
125ms on, 0.875s off
125ms on, 1.375s off
125ms on, 1.875s off
125ms on, 2.875s off
1s on, 3s off
The Blinking and General Purpose PWM modes share the hardware used in the breathing mode. The Prescale value
is derived from the LD field of the LED_DELAY register and the Duty Cycle is derived from the MIN field of the LED_LIM-
ITS register.
TABLE 28-8: BLINKING MODE CALCULATIONS
Parameter
Unit
Equation
Frequency
‘H’ Width
‘L’ Width
Hz
Seconds
Seconds
(32KHz_Clk frequency) /(PRESCALE + 1)/255
(1/PERIOD) x (DutyCycle/255)
(1/PERIOD) x (255 - DutyCycle)
28.8.3 GENERAL PURPOSE PWM
When used in the Blinking configuration with the 48 MHz Ring Oscillator, the LED module can be used as a general-
purpose programmable Pulse-Width Modulator with an 8-bit programmable pulse width. It can be used for fan speed
control, sound volume, etc. With the 48 MHz Ring Oscillator source, the PWM frequency can be configured in the range
shown in Table 28-9.
TABLE 28-9:
Prescale
000h
001h
003h
006h
00Bh
07Fh
1FFh
FFFh
PWM CONFIGURATION EXAMPLES
PWM Frequency
187.5 KHz
93.75 KHz
46.875 KHz
26.8 KHz
15.625 KHz
1.46 KHz
366 Hz
46 Hz
 2014 - 2015 Microchip Technology Inc.
DS00001719D-page 331