English
Language : 

W79E825A Datasheet, PDF (99/127 Pages) Winbond – 8-BIT MICROCONTROLLER
W79E825A/824A/823B/822B Data Sheet
The W79E825 series devices support brake function which can be activated by software or external
pin (P0.2). The Brake function is controlled by the PWMCON2 register. The setting and details
description of software brake and external pin brake can be found at the brake condition table at the
SFR section.
As for external brake, the user program can poll the brake flag (BKF) or enable PWM’s brake interrupt
to determine when the external Brake Pin is asserted and causes a brake to occur. The brake pin
(P0.2) can be set to trigger the brake function by either low or high level, by clearing or setting the
PWMCON2.6 (BKPS) bit respectively. The details description of varies brake functions can be found
in the brake condition table.
Since the Brake Pin being asserted will automatically clear the Run bit of PWMCON1.7 and BKF
(PWMCON3.0) flag will be set, the user program can poll this bit or enable PWM’s brake interrupt to
determine when the Brake Pin causes a brake to occur. The other method for detecting a brake
caused by the Brake Pin would be to tie the Brake Pin to one of the external interrupt pins. This latter
approach is needed if the Brake signal is of insufficient length to ensure that it can be captured by a
polling routine. When, after being asserted, the condition causing the brake is removed, the PWM
outputs go to whatever state that had immediately prior to the brake. This means that in order to go
from brake being asserted to having the PWM run without going through an indeterminate state, care
must be taken. If the Brake Pin causes brake to be asserted, the following prototype code will allow
the PWM to go from brake and then run smoothly after brake is released.
- 99 -
Publication Release Date: February 21, 2008
Revision A9