4.10.1.2 EC Status Register.............................................................................................................................26
4.10.1.4 EC Command Program Sequence ...................................................................................................27
4.10.1.5 EC Index IO Mode............................................................................................................................27
Programmable 4-byte Index I/O ports to access internal registers
One Programmable I/O write byte-address decoding
X-Bus Interface (XBI)
SPI Flash support, the operation frequency runs at least 50MHz.
Addressable Memory range up to 24MB.
8051 64KB code memory can be mapped into 4 independent 16KB pages.
KB3700 Keyboard Controller Datasheet
8051 Microprocessor
Industry 8051 Instruction set complaint with 3~5 cycles per instruction.
Programmable 8/16/32 MHz clock
Fast instruction fetching from XBI Interface
128 bytes and 2KB tightly-coupled SRAM
24 extended interrupt sources.
Two 16-bit tightly-coupled timer
8042 Keyboard Controller
8 Standard keyboard commands processed by hardware
Each hardware command can be optionally processed by firmware
Embedded Controller (EC)
Five EC Standard Commands can be processed by hardware
ACPI Specification 2.0 compliant
Support customer command by firmware
Programmable EC I/O port addressing (default 62h/66h)
Analog To Digital Converter (ADC)
6 built-in ADCs with 8-bit resolution.
The ADC pins can be alternatively configured as General Purpose Inputs (GPI).
5 built-in PWMs
Selectable clock sources: 1MHz/64KHz/4KHz/256Hz.
Configurable cycle time (up to 1 sec) and duty cycle.
Watchdog Timer (WDT)
32.768KHz input clock with 20-bit time scale.
8-bit watchdog timer interrupt and reset setting
General Purpose Timer (GPT)
Two 16-bit, two 8-bit general purpose timers with 32.768KHz resolution
General Purpose Wake-Up (GPWU)
All General Purpose Input pins can be configured to generate interrupts or
wake-up event.
General Purpose Input/Output (GPIO)
All I/O pins are bi-direction and configurable
All outputs can be optionally tri-stated
All inputs equipped with pull-up, high/low active, edge/level trigger selection
All GPIO pins are bi-direction, input and output.
Max. 43 GPIOs
Power Management
Sleep State: 8051 Program Counter (PC) stopped
Deep Sleep State: Stop all internal clocks. Target power consumption ~10uA.
Hardware trap pins will latch the external signal levels at the rising edge of ECRST#. Either a High
or Low value will be stored internally to serve as control signals as described below.
For normal application, there is no application component required for selecting the normal mode
because KB3700 build-in internal pull up resistor to select the right operation mode.
After KB3700 booted, the pull up resistor may be disabled by GPIO register setting.
Pin name 64 Pins
TP_TEST
48
(GPIO16)
TP_PLL
53
(GPIO17)
TP_TEST: Clock Test Mode (for testing and ISP Mode)
Low: Clock Test Mode Enable. (all internal logic will use GPIO15 as clock
source)
TP_PLL: PLL Test Mode (for testing)
There are 2 power planes in this chip. One is used for all logic, the other is used for Analog
parts (ADC).
4.1.2 Clock Domains
There are 4 clock domain in KB3700.
Flash chip interface clock. The clock default in 16MHz, and can be to 32MHz or 64MHz.
8051 / XBI use high clock (setting in CLKCFG, FF0Dh), ranges from 22~4MHz.
WDT uses 32.768KHz clock. WDT default use internal 32KHz clock. The WDTCFG bit 7
options can switch WDT clock to external 32KHz clock oscillator.
Other peripherals (GPWU, PWM,.) use low clock (setting in CLKCFG, FF0Dh), ranges
from 8~2MHz.
4.1.3 Reset Domains
KB3700 Keyboard Controller Datasheet
This chip builds in power on reset. There is also a input reset signal (ECRST#) for global reset.
WDT reset can reset almost all logic, except WDT and GPIO modules. The WDT reset can be
set to only reset 8051 by EC register (PXCFG, FF14h).
There is additional 8051 reset source from EC register (PXCFG, FF14h).
4.2 GPIO
4.2.1 GPIO Functional Description
Multi-function pin Output Function Selection (FS) bit = 0, is set for GPIO Output Function,
and FS bit = 1, is set for Alternative Output. The alternative input function is enabled by Input
Enable register (IE), and is not affected by FS register.
Offset
00
~
03
10
~
15
20
~
Register
Abbreviation
GPIOFS00
GPIOFS08
GPIOFS10
GPIOFS18
GPIOOE00
GPIOOE08
GPIOOE10
GPIOOE18
GPIOEOE0
GPIOEOE8
GPIOD08
Register Full Name
Bit Attr Description
GPIO 00~1B Output Function Selection (0: GPO, 1: Alternative Output)
01h: GPIOFS08 for GPIO08~0F 0
02h: GPIOFS10 for GPIO10~17 0
03h: GPIOFS18 for GPIO18~1B 0
10h: GPIOOE00 for GPIO00~07 0
11h: GPIOOE08 for GPIO08~0F 0
12h: GPIOOE10 for GPIO10~17 0
13h: GPIOOE18 for GPIO18~1B 0
14h: GPIOEOE0 for GPIOE0~7 0
15h: GPIOEOE8 for GPIOE8~F (GPIOE9~A is N.A.) 0
21h: GPIOD08 for GPIO08~0F 0
22h: GPIOD10 for GPIO10~17 0
23h: GPIOD18 for GPIO18~1B 0
24h: GPIOED0 for GPIOE0~7 0
25h: GPIOED8 for GPIOE8~F (GPIOE9~A is N.A.) 0
GPIO 00~1B Input Status
30h: GPIOIN00 for GPIO00~07
31h: GPIOIN08 for GPIO08~0F
32h: GPIOIN10 for GPIO10~17
7~0 R/W
GPIO 00~1B Pull Up Enable
R/WC
7~0
1
GPIO 00~1B Open Drain Enable
7~0 R/W
GPIO 00~1B Input Enable
7~0 R/W
GPIO MISC
33h: GPIOIN18 for GPIO18~1B
34h: GPIOEIN0 for GPIOEIN0~7
35h: GPIOEIN8 for GPIOEIN8~F (GPIOEIN9~A is N.A.)
36h: GPIAD0 for GPIAD0~5
40h: GPIOPU00 for GPIO00~07 0
41h: GPIOPU08 for GPIO08~0F 20
42h: GPIOPU10 for GPIO10~17 E0
43h: GPIOPU18 for GPIO18~1B 03
44h: GPIOEPU0 for GPIOE0~7 0
45h: GPIOEPU8 for GPIOE8~F (GPIOE9~A is N.A.) 0
50h: GPIOOD00 for GPIO00~07 0
51h: GPIOOD08 for GPIO08~0F 0
52h: GPIOOD10 for GPIO10~17 0
53h: GPIOOD18 for GPIO18~1F 0
60h: GPIOIE00 for GPIO00~07 0
61h: GPIOIE08 for GPIO08~0F 20
62h: GPIOIE10 for GPIO10~17 E0
63h: GPIOIE18 for GPIO18~1B 03
64h: GPIOEIN0 for GPIOE0~7 0
65h: GPIOEIN8 for GPIOE8~F (GPIOE9~A is N.A.) 0
66h: GPIAD0 for GPIAD0~5 0
FC
0
FC
FC
FC
70 GPIOMISC
7~2 RSV 0
FC
1 R/W Select GPIO07 as E51_CLK. 0
0 R/W Select GPIO06 as E51_TXD. 0
Read the output port of 8042 P2. Because there is no real 8042 in the chip, this command
just emulates the function.
will just emulate the function and set/clear GA20 based on data bit 1.
Auxiliary data
Always return 00h
4.3 KBC
4.3.1 KBC Functional Description
a. IO 60h: KBC Data Input Register (KBDIN):
When the host writes I/O ports 60h and 64h, the data is stored in KBDIN. At the same
time, the input buffer full flag (IBF bit in KBSTS) is set. The input data stored in KBDIN is
directly fetched by the command processing logic and IBF is also cleared automatically
b. I/O 60h: KBC Data Output Register (KBDOUT)
The data responded to the host is generated by the hardware circuit. The data is pushed
into KBDOUT and the output buffer full flag (OBF bit in KBSTS) is set automatically.
KB3700 can be configured to generate interrupts to the host when OBF is set. OBF is
automatically cleared after that the host reads KBDOUT (through I/O port 60h)
c. I/O 64h: KBC Status Register (KBSTS)
The host read it through I/O port 64h. The bit format of this register is as follows:
Status Bit
7 Parity Error PS/2 Bus parity error.
6 General Timeout PS/2 Bus timeout.
5 Aux OBF KBDOUT data is from PS/2 auxiliary device.
4 Uninhibited Keyboard is not inhibited.
3 A2 Address of the previous write cycle.
2 System Flag POST of the system is finished.
1 IBF Input Buffer Full flag.
0 OBF Output Buffer Full flag.
Name Description
KB3700 Keyboard Controller Datasheet
.
.
d. Hardware Processed Command
The following standard commands are processed by hardware directly.
Value Command Description
20h
D0h
D2h
D3h
E0h
FEh
Read Command Byte
Read P1
Read P2
Write P2
Write KB Output Buffer
Write AUX Output Buffer
Read Test Input
KB Reset This command generates a 6us low pulse on KBRST#.
Read the command byte of KBC
Response Command byte
Read the input port of 8042 P1. Because there is no real 8042 in the chip, this command
Response
Response Bit1 is the status of GA20
Write the output port of 8042 P2. Because there is no real 8042 in the chip, this command
Argument Bit1 is the status of GA20 Write data into KBDOUT as if it comes from the keyboard.
Argument Keyboard data
Write data into KBDOUT as if it comes from the auxiliary device.
Argument
Read the test inputs T0 and T1 of 8042. Because there is no real 8042 in the chip, this
command will just emulate the function.
7 R/W Keyboard Lock Enable
6 R/W Fast Gate A20 Control
5~4 RSV
3 R/W Keyboard Lock
2 RSV
IBF Interrupt Enable.
1 R/W
0 R/W
KBC Interrupt Pending Flag
7~3 RSV
2 R/WC1
1 R/WC1 IBF interrupt pending flag
0 R/WC1 OBF interrupt pending flag
KBC Hardware Command Enable
7 R/W FEh: KB Reset command processed by hardware
6 R/W E0h: read test input command processed by hardware
5 R/W D3h: write AUX output buffer
4 R/W D2h: write KB output buffer
3 R/W D1h: write P2 command processed by hardware
2 R/W D0h: read P2 command processed by hardware
1 R/W C0h: read P0 command processed by hardware
0 R/W 20h: read command byte processed by hardware
KBC Command Buffer
7~0 RO The data written to I/O port 64h will be stored in this register.
KBC Data Input / Output Buffer
7~0 R/W
KBC Host Status
7 R/W
6 R/W
5 R/W Auxiliary Data Flag
4 RO Uninhibited
3 RO Address (A2)
2 RO System Flag
1 R/WC1 IBF, write IBF = 1 to clear IBF
0 R/WC1 OBF, write KBCDAT will set OBF to 1. Write OBF = 1 to clear OBF
This bit enables KBC to generate interrupt to the 8051 at the rising edge of
IBF, when the KBC command being received will be bypassed to firmware for
processing.
OBF Interrupt Enable.
This bit enables KBC to generate interrupt to the core processor at the falling
edge of OBF.
KBC firmware mode in processing flag,
Exit KBC firmware mode and re-enable hardware mode by writing 1
Writing to this register will cause the output buffer full flag OBF to be set. The
host can read this register through I/O port 60h.
Parity Error.
When PS/2 protocol has a parity error, this bit will be set to high. This bit is
also used as port indicator for PS/2 active multiplexing mode.
TimeOut.
When PS/2 protocol has a timeout error, this bit will be set to high. This bit is
also used as port indicator for PS/2 active multiplexing mode.
1 RSV 0
0 R/W PWM0 Enable 0
PWM0 High Period Length 0
7~0 R/W The High Period Length of PWM should be small than Cycle Length. 0
PWM0 Cycle Length 0
7~0 R/W The Cycle Length of a PWM cycle, includes high and low Length.
PWM1 High Period Length 0
7~0 R/W The High Period Length of PWM should be small than Cycle Length. 0
PWM1 Cycle Length 0
7~0 R/W The Cycle Length of a PWM cycle, includes high and low Length.
PWM prescaler Clock Select
0: peripheral clock(by clock setting in EC CLKCFG(FF0Dh)
1: 1MHz clock(recommend set this bit to fixed clock in different clock setting)
7~5 RSV
4 R/W GPT test mode, the GPT base clock will be system clock
3 R/W Enable GPT3 counting and GPT3 interrupt
2 R/W Enable GPT2 counting and GPT2 interrupt
1 R/W Enable GPT1 counting and GPT1 interrupt
0 R/W Enable GPT0 counting and GPT0 interrupt
GPT Pending Flag 0
7 WO GPT3 write 1 to restart 0
6 WO GPT2 write 1 to restart
5 WO GPT1 write 1 to restart
4 WO GPT0 write 1 to restart
3 R/WC1 GPT3 Interrupt Pending Flag
2 R/WC1 GPT2 Interrupt Pending Flag
1 R/WC1 GPT1 Interrupt Pending Flag
0 R/WC1 GPT0 Interrupt Pending Flag GPT0 Count Value
7~0 R/W
GPT1 Count Value
7~0 R/W
GPT2 Count Value
7~0 R/W
GPT3 Count Value
7~0 R/W
After GPT0 reach this value and interrupt will occur and
GPT0 reset and counting from zero again.
After GPT1 reach this value and interrupt will occur and
GPT1 reset and counting from zero again.
After GPT2 reach this value and interrupt will occur and
GPT2 reset and counting from zero again.
After GPT3 reach this value and interrupt will occur and
GPT3 reset and counting from zero again.
Write 00h to reset all rest mode.
Write A3h to enable flash write cycles.
Write C5h to SRAM test.
SPIA0 = A7~0
SPIA1 = A15~8
SPIA2 = A22~16
Output(write SPIDAT) / Input(read SPIDAT) data to/from SPI flash
interface.
04h FEh
0 FEh
0 FEh
0 FEh
0 FEh
Page 19
ADh SPICFG
AEh SPIDATR
AFh SPICFG2
KB3700 Keyboard Controller Datasheet
The issued SPI command to SPI flash chip. The write to this register will
start the SPI accessing, so that the SPIA2~0 and SPIDAT should be ready
before SPICMD is written.
SPICMD support command :
01h Write Status Register
02h Byte Program
03h Read
04h Write Disable
A23~16 will not be used. A16 = 1 if 31h command. A16=0 if 30h command.
The address phase will only contain A15~0, and don't care fast mode
enable bit of SPICFG bit 2.
SPICS# force output low.
After set this bit, the protocol will control by firmware. The SPICMD will
output to SPI BUS each time the write operation to SPICMD.
The SPIDAT will store the read operation data from SPI BUS.
SPICMD write enable.
Enable SPICMD write action to start SPI flash protocol accessing.
Enable SPI Flash Dummy Byte for Read Command.
Enable SPI flash read by 8051 instruction by Fast Mode (High Speed
Read) 0Bh command.
SPI flash accessing in progress status.
Use this bit to check if the SPI accessing is finished or not.
SPICS# force output low.
After set this bit, the protocol will control by firmware. The SPICMD will
output to SPI BUS each time the write operation to SPICMD.
The SPIDAT will store the read operation data from SPI BUS.
SPICMD write enable.
Enable SPICMD write action to start SPI flash protocol accessing.
SPI flash read by 8051 instruction by
SPI flash accessing in progress status.
Use this bit to check if the SPI accessing is finished or not.
0
0
ISP SPI ISP RS232 Baud Rate Setting
In ISP mode, 8051_SFR(SCON2) always 0
7-0 WO
7
refer to the yellow part, and read operation please refer to the green part.
ISPSCON3
***
7~4 RSV
3~0 RO
*** Please note, ISPSCON3 register gives different bitmap definition according to access. For write operation, please
write this reg to program 8051_SFR(SCON3)
Default: SCON3 = 0x89, baud-rate = 57600 (while 8051 clk = 8Mhz)
set SCON3 = 0x45 for baud-rate =115200 (while 8051 clk = 8Mhz)
WDT timer clock uses 32.768 KHz oscillator clock and base unit is 64ms.
WDT register can only be reset by power on reset and ECRST#.
WDT range is between 64 ms to 16 seconds.
WDT reset time is between 128ms to 32 seconds.
WDT reset can reset all logic in the chip, except GPIO registers. Thus, the GPIO setting can
be preserved after WDT reset occurred. The WDT reset can optionally be set only to reset 8051
logic in EC register space.
1: WDT is 24-bit timer (setting for PLLLOW in STOP mode).
If EC CLKCFG.7 (PLLLOW Enable) is set, the WDT clock will become PLL
output clock automatically. Set this bit to 1 before enter STOP mode to let WDT
become 24-bit timer by 1~2MHz PLL output clock.
Register Full Name
Description
Def Bnk
80 WDTCFG
81 WDTPF
82 WDTCNT
6~3 R/W
2 R/W
1 R/W Enable WDT interrupt (WDT reset warning)
0 R/W
WDT Pending Flag
7~5 RSV
1
R/WC1
0
R/WC1
WDT 8-bit Count Value (for Watch Dog Timer reset system)
7~0 R/W
Force to disable WDT by writing 1001b to this field.
Write 1011b to set WDT be shorter timer. (Enable WDT shorter test mode).
Write 1111b to disable WDT shorter test mode.
WDT Clock Selection for testing
0: WDT clock is from WDT Clock Selection 2 (normal setting).
1: WDT clock is PLL output / 2 (i.e. 16MHz as PLL output 32MHz, maybe
stopped at STOP mode. This option is only for testing).
Enable WDT reset, and reset WDT timer,
the WDT timer and 2 pending flags will be reset and count from zero again.
If the WDT and reset after a interrupt occurred, the next interrupt will occurred
after 16 seconds.
WDT interrupt pending, WDT half timeout flag. If this bit is set, the following
WDT timeout event will cause a WDT reset signal to system.
WDT reset event pending flag (the last WDT reset was ever happened),
WDT reset will assert if WDT count to WDT and WDT interrupt is pending.
After WDT counts to this value the half of WDT/2 , the interrupt will occur. The
WDT timer unit is 64ms.
3. EC I/O Index and Data Ports: Through which the system host can access KB3925
internal registers more efficiently than through EC commands F0h/F1h. The EC I/O Index
and Data Ports are two 8-bit registers with base address defined in FE92h and FE93h.
Default Index Port ={002Dh, 002Eh}, Data port =002Fh.
4. LPC/FWH memory access.
5. Extended LPC write byte: can be programmed to port 80 and generate interrupt to 8051.
4.8.1.1 LPC Decoding IO Ports
The keyboard I/O ports are 60h/64h, while the EC I/O ports are programmable in
LPCEBA (FE98h, FE99h). The enable/disable of I/O ports decoding on LPC bus can be
KB3700 Keyboard Controller Datasheet
configured individually via register LPCCFG (FE95h).
The host is accessing the 68/6Ch IO. If this bit is set, the software doesn't
9Eh LPC68CSR
9Fh LPC68DAT
7 RO
6 RO A2 (address bit 2) of the last write 68/6C IO.
5~4
3 R/WC1 IBF Interupt Pending Flag
2 R/WC1 OBF Interrupt Pending Flag.
1 R/WC1 IBF
0 R/WC1 OBF
LPC 6Ch IO Data Register
7-0 R/W The data byte of current memory cycle.
4.9 PS / 2 Interface
4.9.1 PS/2 Functional Description
KB3700 Keyboard Controller Datasheet
0 FEh
The PS2 Controller supports byte-level programming interface to PS2 devices, including IKB
module. A PS/2 TX action will be pending if a PS/2 RX is active. After PS/2 RX is completed
(received a byte), the TX will start transmitting to the specified port. PS2 Controller will maintain
the PS2 channel’s integrity in byte level. But the input signal should not be floating not drive low
if the PS2 channel is not used (MUST set correct GPIOFS and PS2CFG Enable PS2 ports).
6 R/W Transmit Byte Port is PS2 port 2 0
5 R/W Transmit Byte Port is PS2 port 1 0
4 RSV 0
3 WO Write 1 to force reset PS2 transmitter state, for emergency usage. 0
2 WO Write 1 to force reset PS2 receiver state, for emergency usage. 0
1 RO Flag of PS2 RX timeout 0
EC standard commands as described in ACPI 2.0 spec. are processed by hardware logic
directly without the intervention of firmware. For EC extended commands, EC controller will
forward them to 8051 and thereby processed by the firmware. The data and command/status
ports are default to 62h and 66h respectively, and can be optionally mapped to other I/O
address space by KBC command 61h.
4.10.1.2 EC Status Register
To read EC Status IO port register is described as follows:
Status Bit Name Description
7 Reserved Not used.
6 Reserved Not used.
This bit is set to 1 by the EC to indicate that there is/are a/more SCI event(s) in the SCI
5 SCI
4 Burst Enable The Burst Enable flag. 1=Enabled. 0=Disabled.
3 Command or Data Flag
2 Reserved Not used.
1 IBF Input Buffer Full flag.
0 OBF Output Buffer Full flag.
queue. The system upon detecting this bit being set should thereafter query the SCI event
queue (by issuing EC command 84h) to obtain the SCI ID number. EC standard
commands (80h,81h,82h,83h,84h) being received and completed by the EC will not cause
the SCI bit to be set.
1=Previous access port is command port (EC_CMD/EC_STS).
0=Previous access port is data port (EC_DAT).
4.10.1.3 EC Command Register
There are 7 valid EC Commands for EC command register (write IO 66h); other values are “don’t
care” by EC if being written.
Value Command Description
80h EC Read Read operation for an internal register in EC Space.
81h EC Write Write operation for an internal register in EC Space.
82h EC Burst Enable Enable EC burst operation mode.
83h EC Burst Disable Disable EC burst operation mode.
84h EC Query Query the SCI event queue.
Others Firmware Command No responded from hardware EC. Firmware EC commands.
Wait SCI for IBF=0
Write address byte to EC_DAT (62h=EC address)
Wait SCI for OBF=1
Read EC_DAT with data in (read data = 62h)
Write EC_CMD with 81h (66h=81h)
Wait SCI for IBF=0
Write address byte to EC_DAT (62h=EC address)
Wait SCI for IBF=0
Write data byte to EC_DAT (62h = write data)
Wait SCI for IBF=0
Write EC_CMD with 82h (66h=82h)
Wait SCI for OBF=1
Read EC_DAT with 90h(Burst ACK)
Write EC_CMD with 83h (66h=83h)
Wait SCI for IBF=0
Write EC_CMD with 84h (66h=84h)
Wait SCI for OBF=1
Read EC_DAT with SCI ID number (read data = 62h).
4.10.1.5 EC Index IO Mode
You may use EC Index IO mode to access the KB3925 register space (F400h ~FFFFh). The
EC Index IO base is set in LPC register FE92h, FE93h. The base address + 1 is index high byte
address. The base address + 2 is index low byte address. The base address + 3 is data port for
reading from or writing to KB3925 internal register space. For example, set the base address in
FE92h=00h, FE93h = 2Ch. The system IO write set 002Dh = FFh, 002Eh = 01h. The read / write
to 002Fh will read / write ECFV register (FF01h).
4.10.1.6 SCI Generation
Most interrupts generated from KB3925 internal modules are connected to the 8051 core and
are optionally to generate a SCI event. Each SCI has an associated SCI Enable and SCI Flag
bits in EC Space 05h~0Ah. The three extended interrupt ports of 8051, each supporting 8
interrupt channels, can accommodate totally 24 interrupt channels. The pulse-width of SCI is
adjustable by setting SCICFG (default is low-active with 250ns pulse-width). Setting ECCFG bit
0=1 (default=0, enabled) to disable the generation of SCI.
In addition to the 24 SCI events generated by KB3925 internal hardware logic, 8051 firmware
or system BIOS can also generate a SCI event by writing the desired SCI ID into SCID register
(0Bh) in EC space. The SCID should be first enabled in ECCFG bit3. The SCI IDs are defined
as follows.
system software’s recognition. ADC test data input when ADC test enable.
4.10.1.7 SCI ID Table
SCI ID
00
01h
02h
03h
04h
05h
06h~07
08h
09h
0Ah
0Bh
0Ch
0Dh
0Eh
SCID
10h
11h
12h
13h
14h
15h
16h
17h
18h
19h
1Ah
1Bh
1Ch
1Dh
1Eh
1Fh
Name PxI
Nothing N.A.
N.A.
N.A.
N.A.
N.A.
N.A.
N.A.
WDT P0I.0
RSV P0I.1
PS2 P0I.2
KBC P0I.3
RSV P0I.4
LPC P0I.5
ECFW P0I.6
SCID P0I.7 Write SCI ID, Query value is SCID.
RSV P1I.0
RSV P1I.1
RSV P1I.2
P1I.3
GPT0 P1I.4
GPT1 P1I.5
GPT2 P1I.6
GPT3 P1I.7
EXTWIO P3I.0
GPIO00~0F P3I.1 Indicates a GPIO00~0F event.
GPIO10~1B P3I.2 Indicates a GPIO10~1B event.
RSV P3I.3
RSV P3I.4
RSV P3I.5
RSV P3I.6
ADC P3I.7 Indicates a ADC updated event.
KB3700 Keyboard Controller Datasheet
Description Priority
Indicates a EC Command is received from the Host. Alternatively also means nothing
happens
Not used.
Indicates a Watchdog Timer event.
Indicates a PS2 event.
Indicates a KBC Host Interface event.
LPC cycle interrupt
EC firmware mode SCI (IBF/OBF SCI).
Not used.
Indicates a General Purpose Timer 0 event.
Indicates a General Purpose Timer 1 event.
Indicates a General Purpose Timer 2 event.
Indicates a General Purpose Timer 3 event.
Indicates a Write Extended IO interrupt (Port80).
EC SCI ID Write Port for 8051 firmware to generate SCI event
7 – 0 R/W
PMU Control / Configuration
7 WO Enter STOP mode by writing this bit = 1, the same as 8051 PCON STOP
6 WO Enter IDLE mode by writing this bit = 1, the same as 8051 PCON IDLE
5 R/W Enable LPC cycle wake up from STOP mode.
4 R/W MUST be set to '1' to enable wakeup feature.
3 R/W
2 R/W EnableWatchdog interrupt wake up from STOP mode
1 R/W Enable GPWU wake up from STOP mode
0 R/W Enable Interrupt wake up from IDLE mode
Register Full Name
Bit Attr. Description
Clock Configuration
7 R/W
6 R/W
5 R/W
High-byte address of the 64KB EC address space. Used for standard EC
R/W
commands to access F000~FFFFh internal space. The default setting will let
host accessing the FF00~FFFFh (EC, GPWU, SMBus) space.
SCI pulse width = SCIPW x 64us, max length = 1 ms, as no width=0.
IF width = 0, the pulse width will be a system clock.
Enable EPB Fast Access
A enhanced option to speed up EPB performance during accessing.
IBF Interrupt Enable, also be the Firmware Mode Enable.
This bit enables KBC to generate interrupt to the 8051 at the rising edge of
IBF, when the KBC command being received will be bypassed to firmware for
processing.
OBF Interrupt Enable.
This bit enables KBC to generate interrupt to the core processor at the falling
edge of OBF.
Flags for extended 8051 Port 0, 1, 3 Interrupt to SCI.
EC Query will clear the query SCI ID flag automatically, or write 1 to clear
8051 firmware can write to this port with SCI_ID value to generate a SCI
event. The host can use EC Query command to read this specified value.
Enable SCI to be one of wake up interrupt source
8051 interrupt source will always exit Ultra Low clock to normal clock
Enable PLL enter low speed state in STOP mode.
Set PLL frequency control value to be PLLLOW in STOP mode.
The CLKCFG bit 4 should also be enabled for this option.
Flash (SPI) Interface Clock Control
1: full speed (Internal clock is 66(+-%25) MHz )
0: half speed (default, ½ of supplied clock)
SPI clock is 16MHz if CLKCFG set to 8 / 4 MHz.
SPI clock is stopped when 8051 in IDLE if CLKCFG.0 is set.
Enable PLL to generate a good 32.768MHz. (default reset PLL)
This bit should be set after PCICLK is stable.
When 8051 enters IDLE state, the clock of 8051 and peripherals will changed
should be disabled.
controller) . After reset, the 8051 will restart from reset vector if this bit is reset
0Eh EXTIO
0Fh PLLCFG
11h RSV
12h CLKCFG2
13h PLLCFG2
KB3700 Keyboard Controller Datasheet
4 R/W Enable PLL enter low power state in STOP mode
8051 / Peripherals Normal Run Clock Selection.
10: 22 / 8 MHz
3-2 R/W
1 R/W
0 R/W
EC Extended Write IO data
7~0 R/W Read this byte to get the host write extended IO data.
PLL Configuration
7~0 R/W
Clock Configuration 2
7 – 0 R/W
PLL Configuration 2
7 – 6 R/W
5 R/W
4 R/W
01: 16 / 8 MHz
00: 8 / 4 MHz (default) The SPI clock is 16MHz in this setting.
Clock rate is fixed in 2/1MHz when 8051 in IDLE if CLKCFG.0 is set.
The flash interface (SPI or ISA) is fixed in 32.768 MHz or higher by
CLKCFG.6 setting.
Enable Peripheral Auto Slow Clock Control to be 1 MHz.
The Peripheral's clock will be 1 MHz when no host accessing.
Enable 8051 IDLE Mode Slow Clock Control to be 2 / 1 MHz.
automatically to 2 / 1 MHz. And the flash interface clock will be stop if this bit
is set.
PLLINIT (PLL Initial value)
PLL initial value for output a default frequency. (070h)
1 us time unit by PLL output clock.
If PLL output 32MHz(default),
the setting should be 32(1Fh) or 33(20h) for 1000 ns/30.518 = 32.76 .
If PLL output 25MHz,
the setting should be 24(18h) for 1000 ns/40 = 25.
PLLINIT High Bits (PLLINITH)
High 2 bits of PLL frequency control initial value(PLLINIT).
Combine with FF0Fh to be 10 bits frequency control value.
PLL Reference Selection
0: select PCI clock(LPC clock) as reference clock of PLL.(default)
1: select alternative clock source from GPIO02 Alt. input.
PLL Source Clock Divider
0: Disable
1: Enable (default)
The PLL build-in a 1024(10-bit) divider for source clock.For PLL reference
clock is high speed, as PCICLK, the divider should be enabled. For PLL
reference clock is low speed, as 32KHz from GPIO02 Alt. Input, the divider
Set PLL frequency count don't care bits
0: all comparing
1: don't care bit 1
2: don't care bit 1~0
3: don't care bit 2~0
Select converting ADC channel (ADC5~0)
NOTE: ONLY Channel 3~0 is valid in A0 and A1 version. All these three bit
need to set ZERO if channel 4 or 5 selected using ADDAEN.
EC firmware mode in processing flag,
Exit EC firmware mode and re-enable hardware mode by writing 1
The EC Data Port serves as the window between system host and EC. Write
This register stored the latest EC command from host writing EC
port. Normally, standard EC commands will be processed by EC hardware
directly. For extended EC commands, 8051 firmware may handle the
processing. The port is read-only by the EC.
A2 (Command or Data Flag)
=0, previous host write is Data
=1, previous host write is Command
Each GPIO with GPI pin can generate events (interrupt or wakeup). The GPI input can be set
as Level or Edge trigger or Change trigger. Polarity bit setting will affect Level and Edge trigger,
but it poses no meaning to Change trigger.
Enable bit to generate event (interrupt, and wakeup) for a active input.
Also Enable bit for waking up from STOP mode.
GPIO00~1B input active polarity selection
0: Low active (falling for edge trigger)
1: High active (rising for edge trigger)
GPIO00~1B input is edge or level trigger
0: Edge
1: Level
Register Full Name
Description
Def Bnk
0 FF
0 FF
0 FF
0 FF
4.12 8051 Microprocessor
The embedded 8051 is compatible with industrial standard 8051(or 8031). There are 3 standard
8051 peripherals, including the Interrupt controller, the Serial port and two 16-bit timers.
KB3700 extends the channels of Interrupt Controller in the original 8051 to 24 channels
supporting internal peripheral devices. The Serial port use SCON2 to achieve high speed serial
transmission rate up to 115200 bps. The two 16-bit timers are basically the same as that in the
standard 8051’s, except when SCON2 is used to generate high-speed baud rate. Under such
circumstances the 2 timers will not be used for baud-rate generation but for other purposes.
The 8051 uses MOVX and MOVC instructions to read or write KB3925 peripherals, i.e., EC, SMBus, GPIO, GPWU, KBC, IKB, GPT, PWM, PS2, XBI, LPC, XRAM…etc.
Hereunder lists the differences between the KB3925’s embedded 8051 and that of the industrial
standard 8051:
P3IE, P1IE, P0IE are read/write registers used as Interrupt Enable (IE) to their corresponding
interrupt inputs. These three registers are original 8051 port registers with contains 8-bits. For the
embedded 8051 inside KB3925, the 3 ports are used for interrupt input (always rise pulses)
extensions. Totally there are 24 interrupt events.
P3IF, P1IF, P0IF are Interrupt Flag(IF) corresponding to the 24 interrupt inputs. The Ifs are set by
external interrupt event (always a rising pulse, one clock width), and are cleared by software
(execute IRET instruction for active interrupt).
The original alternate 8051 port 3 functions are not related with P3IE and P3IF.
7 R/W Enable level trigger interrupt (KB910L should set to 0)
TTST, Timer 0/1 test mode, let timer 12 times faster.
Next Interrupt Coming Flag. The same extended interrupt coming during ISR
before IRET. After exit ISR with IRET instruction, the 8051 will re-enter
again if the flag is 1. Write 0 to clear the flag and prevent from 8051
re-entering the interrupt again after exit ISR.
, Interrupt vector highest bit. Let interrupt vector to be 00xxh or 80xxh,
including standard and extended interrupt.
GF1, general purposes flag.
GF0, general purposes flag.
Stop all 8051 clock, including all peripherals (timer, interrupt, serial port). An
external Async. wake-up event can reset the latch of 8051 gated clock. Write
Set 1 to stop processor fetching instructions. But the clock will not stop.
Peripheral interrupt events will let processor exit IDLE mode. Write 1 to enter
TF1
TR1
TF0
TR0
IE1
IT1
IE0
IT0
GATE1
CT1
TM1
GATE0
CT0
TM0
Timer 1 overflow flag.
Timer 1 run control bit.
Timer 0 overflow flag.
Time 0 run control bit.
External Interrupt 1 edge detected flag.
Interrupt 1 falling edge / low active control bit
External Interrupt 0 edge detected flag.
Interrupt 0 falling edge / low active control bit
Gating control of TR1 and INT1.
=0, be a timer 1. =1, be a counter 1.
=0, Timer 1 is 13-bit timer (8048 timer).
=1, Timer 1 is 16-bit timer
=2, Timer 1 is 8-bit auto-reload timer
Gating control of TR0 and INT0.
=0, be a timer 0. =1, be a counter 0.
=0, Timer 0 is 13-bit timer (8048 timer).
=1, Timer 0 is 16-bit timer
7 – 0 R/W Port 2, high address of external bank accessing.
Interrupt Enable Register
7 R/W
6~5 R/W
4 R/W
3 R/W
2 R/W
1 R/W
0 R/W
Port 3 Interrupt Enable
7 – 0 R/W P3 Interrupt Enable Register
Interrupt Priority Register
7~5 NA
4 R/W
3 R/W
2 R/W
1 R/W
0 R/W
Processor Status Word
7 R/W
6 R/W
5 R/W
4 R/W
SM1
SM0
REN
TB8
RB8
TI
RI
SCON2 is high-byte, SCON3 is low byte to be a 16-bit counter for baud rate
based on 8051 clock.
EA
ES
ET1
EX1
ET0
EX0
PS
PT1
PX1
PT0
PX0
CY
AC
F0
RS1
00: 8-bit shift register mode, E51RX should be E51CLK shift clock.
01: 8-bit Serial Port(variable)
10: 9-bit Serial Port (variable)
Reserved
Enable Serial Port reception
The 9th bit of transmitted in mode 2 & 3.
The 9th bit of received.
Transmit Interrupt flag.
Receive Interrupt flag.
Disable all interrupt (include extended) if clear to 0. If set to 1, all