English
Language : 

W681307DG Datasheet, PDF (50/160 Pages) Winbond – USB1.1 CODEC Microprocessor Control Unit with 32KB Mask ROM and 4KB RAM.
W681307
9.1.2
Use of the Keypad Scanner
The software should set up the KeyPadSize register so that the keypad can be used. This register sets the keypad size and the de-bounce
period.
Once a key has been de-bounced a KeyIntrpt interrupt is generated and the key value is stored in the KeyLocation register. When the key
is released a further KeyIntrpt interrupt is generated. (Note that only two interrupts are generated in a key press release sequence and that
holding a key down for extended periods does not result in multiple interrupts.)
The KeyPress register bit in the KeyLocation states whether a key is pressed. When a key is pressed the bit is active once the key press
has been de-bounced and is removed once the key is released.
Where ports are being used with the hardware keypad scanner, the corresponding data bit in the Key IO port output data register must be
set to zero.
9.1.3
Use of a Software Keypad Scanner
If keypad scanning is done in software than the keypad scanner functionality is not used and the pins are treated as general purpose I/O
ports KeyC[3:0] and KeyR[4:0].
9.2
I/O Ports
Pins not used by the Keypad scanner are available as standard IO Ports, controlled by KeyIoDR, KeyIoDC, KeyIoIpR, KeyIoIpC,
KeyIoOpR and KeyIoOpC. An interrupt event will be generated if there is a change in the value of any one of KeyIoIp and the
corresponding bit of KeyIoMsk is set.
Note that the direction of KeyC[3:0] amd KeyR[4:0] are always controlled by the KeyIoDC[3:0], KeyIoDR[4:0] registers.
- 50 -
Publication Release Date: May, 2007
Revision 1.3