11. External bus xBUS

11. External bus xBUS

11.1 External bus registers

External bus auxiliary setting register (XBUS_AUX):

BitNameAccessDescriptionReset value
7bUART0_TXR0Indicate the transmission status of UART0, 1 means it is transmitting0
6bUART0_RXR0Indicate the receiving status of UART0, 1 means it is receiving0
5bSAFE_MOD_ACTR0Indicate the safe mode status, 1 means that it is currently in safe mode0
4bALE_CLK_ENRWALE pin clock output enable, this bit is 1 to allow ALE to output the system's main frequency of 12 when there is no xBUS operation, that is, Fsys / 12; this bit is 0 to disable the output of clock signals and only output when necessary to access the external bus Low 8-bit address latch signal to reduce EMI0
3GF2RWGeneral flag bit 2: user can define by himself, can be cleared or set by software0
2bDPTR_AUTO_INCRWEnable auto-increment DPTR by 1 after the MOVX_@DPTR instruction is completed0
1reservedR0reserved0
0DPSRW

Dual DPTR data pointer selection bits:

This bit is 0 to select DPTR0. This bit is 1 to select DPTR1
0

External bus speed configuration register (XBUS_SPEED):

BitNameAccessDescriptionReset value
7bXBUS1_SETUPRWSelect XBUS1 settling time: if this bit is 0, then 2 clock cycles. If this bit is 1, then 3 clock cycles1
6bXBUS1_HOLDRWSelect XBUS1 hold time: if this bit is 0, it will take 1 clock cycle. If this bit is 1, it will take 2 clock cycles1
5bXBUS1_WIDTH1RWXBUS1 bus pulse width high1
4bXBUS1_WIDTH0RWXBUS1 bus pulse width low bit1
3bXBUS0_SETUPRWSelect XBUS0 settling time: If this bit is 0, it will take 2 clock cycles. If this bit is 1, it will take 3 clock cycles1
2bXBUS0_HOLDRWSelect XBUS0 hold time: if this bit is 0, it will take 1 clock cycle. If this bit is 1, it will take 2 clock cycles1
1bXBUS0_WIDTH1RWXBUS0 bus pulse width high order1
0bXBUS0_WIDTH0RWXBUS0 bus pulse width low bit1

11.2 External bus pins

Table 11.2.1 External bus pin list

GPIODirect Address Mode PinMultiplexed Address Mode PinDescription
P3.7RDRDExternal bus read signal output pin, active low, rising edge sampling input
P3.6WRWRExternal bus write signal output pin, active low
P0.0~P0.7D0~D7D0~D78-bit bidirectional data bus
A0~A7Multiplex lower 8-bit address A [0:7] output, latched by external circuit controlled by ALE
P4.0~P4.5A0~A5UnusedDirect bus address A [0: 5] output pin, P4_DIR output must be set
P3.5A6UnusedBus direct address A6 output pin
P2.7A7Bus direct address A7 output pin
A15Bus address A15 output pin
P2.0~P2.6A8~A14A8~A14Bus address A [8:14] output pin
P3.4XCS0XCS0Chip select 0 output pin, address range 4000h~7FFFh, active low
P3.3!A15!A15Bus address A15 inverting output pin, equivalent to chip select 1 output, address range 8000h~FFFFh, active low, only available in ALE disabled state
P5.5!A15!A15Bus address A15 inverting output pin, equivalent to chip select 1 output, address range 8000h~FFFFh, active low, available only in ALE enabled state
P5.4ALEMultiplexed low 8-bit address latch control output pin, active high
ALESystem frequency 12-division clock Fsys / 12 output pin, duty cycle 1/12

Some of the above unused pins such as address output and chip select output in the external bus state can be used for other modules according to the GPIO multiplexing priority order, and the unused pins in P4.0~P4.5 can also be used. Set P4_DIR to keep the input status.

When bXBUS_CS_OE = 1, the inverting signal of bus address A15 will select the output pin according to the ALE output status. When ALE is allowed to output, !A15 chooses to output from P5.5. When ALE is disabled to output, !A15 chooses from P3.3 output. The ALE output status is determined by the combination of bUH1_DISABLE, bXBUS_EN, bXBUS_AL_OE, and bALE_CLK_EN, refer to Table 11.2.2 below.

Table 11.2.2 P5.4 Pin Multiplexing ALE Output Status Table

bUH1_DISABLEbXBUS_ENbXBUS_AL_OEbALE_CLK_ENP5.4 pin function description
0xxxDisable ALE output, priority as HM (P5.5 as HP)
10x0Disable ALE output, used as XB by default (P5.5 as XA)
10x1ALE only outputs the system's 12th-frequency clock signal
1110Disable ALE output, default for XB (P5.5 is used as XA)
1111ALE only outputs the system's 12th-frequency clock signal
1100ALE outputs the lower 8-bit address latch signal only on the bus
1101ALE outputs the lower 8-bit address latch signal when accessing the bus, and outputs the system's main frequency 12-frequency clock signal when idle