Background of the Invention
[0001] This invention pertains to a microcomputer and a method for controlling its bus cycle,
and in particular to a microcomputer and a bus cycle control method with an improved
wait control of the bus cycle.
[0002] With recent advances in the microcomputer field, demand for improved functions has
necessarily increased. Various special LSIs, i.e. peripheral devices (chips), for
executing particular functions by augmenting CPUs (microprocessors) have been developed.
Microprocessors for controlling peripheral devices need to have a wait state inserted
into their bus cycle to make their speed correspond with that of low-speed peripheral
devices.
Description of the Related Art
[0003] To cope with lower-speed peripheral devices, a conventional microcomputer samples
input signals from the wait request input terminal of its microprocessor in a predetermined
cycle. If the sampled signal indicates a wait instruction, one wait state is inserted
into the current bus cycle. If the wait request signal sampled in a wait state indicates
a wait instruction, one wait state is inserted into the next bus cycle. By repeating
this process, a plurality of wait states are inserted into the bus cycle.
[0004] However, in such a conventional microcomputer, except for an address decoding circuit
for selecting the address of a wait request, an external circuit separate from the
microprocessor must perform a time control from the beginning of the wait request
to its clearing. Thus, a complex configuration due to a large number of poorly designed
external circuits becomes more probable. Increased design cost is necessary to prevent
this from occurring.
[0005] The external circuit needs a counter for counting the number of wait states for the
time control from the beginning of the wait request to its clearing, and the period
of time proportionate to the requested number of wait states must be measured. Further,
the counter has to be initialized at the beginning of the wait request. Count-ups
or count-downs proportionate to the bus cycle of the microprocessor are performed,
and when the counter reaches a predetermined value, a signal indicating a wait request
clearing needs to be outputted to the microprocessor. Further, the wait request/clearing
signal must be outputted to the microprocessor at a timing requested by the microprocessor.
This makes the configuration of the external circuit more complex, thus increasing
the cost. When the wait request/clearing timing determined by the microprocessor becomes
more complex, a failure in the external circuit's design becomes more probable.
[0006] Some microprocessors are loaded with so-called automatic wait control functions.
To cope with a lower-speed peripheral device, such a microprocessor performs the bus
cycle wait automatically without requiring a wait request input terminal by using
a programmably set wait address setting register, a corresponding number of wait states
setting register, a wait address judging circuit for judging by comparison whether
or not the address outputted from the microprocessor is set in the wait address setting
register, and a control circuit for inserting, in the present bus cycle, wait states
whose number is equal to that of the wait states provided in the corresponding number
of wait states setting registers when an address is judged to be caused to wait.
[0007] However, such a microprocessor must include each of the above registers, a judging
circuit and a control circuit. Accordingly, there is a problem that an extremely large
circuit is required for the wait control of the microprocessor. If the wait control
of the microprocessor is thus configured, the microprocessor must necessarily output
a chip-select signal, and there is a disadvantage that the microprocessor must contain
a very large number of circuits and terminals. This is because, unless the microprocessor
outputs a chip-select signal, in many cases an external circuit needs to create one
and the external circuit must be equipped with a chip-select signal-creating circuit
almost identical to the wait address judging circuit.
[0008] Therefore, not even microprocessors loaded with automatic wait control functions
can solve the above problems.
Summary of the Invention
[0009] This invention aims at providing a microcomputer and a bus cycle control method that
enables an automatic wait control of a microcomputer at a low cost, without significantly
increasing the size of either the microprocessor's internal circuit or its external
circuit necessary for a wait control.
[0010] To attain the above goals, the microcomputer and the bus cycle control method of
this invention is configured as follows.
[0011] In the invention according to claim 1, a microprocessor performs an ordinary operation
processing at a predetermined bus cycle. When a wait trigger condition of the wait
request signal inputted from the wait request signal creating unit arranged outside
the microprocessor is detected, regardless of the input level of the following wait
request signal, the bus cycle in the microprocessor is caused to wait for a period
corresponding to the predetermined state number, during which period the microprocessor
and the peripheral devices are accessed. After this period has elapsed, the wait is
cleared, the original bus cycle is reinstated, and detection of a wait trigger condition
of the wait request signal again becomes possible.
[0012] The invention according to claim 2 includes a microprocessor for a processing operation
at a predetermined bus cycle and a peripheral device accessible with the microprocessor.
When the microprocessor accesses a peripheral device in the microcomputer that causes
the bus cycle of the microprocessor to wait, the microprocessor is configured to include
a main control part for control processing an operation and for generating an access
signal to the peripheral device, a state number setting unit for programmably setting
the state number to be caused to wait, and a wait instruction signal generating unit
for generating a wait instruction signal in response to a wait request signal. A wait
request signal forming means is provided at the outside of the microprocessor. When
the microprocessor detects the wait trigger condition of the wait request signal creating
means, it causes the bus cycle in the main control part to wait for a period corresponding
to the state number set by the state number setting means by outputting the wait request
signal from the wait instruction signal generating means. During this wait period,
the microprocessor and the peripheral devices are accessed. After this period has
elapsed, a detection of the wait trigger condition of the wait request signal again
becomes possible.
[0013] The invention according to claim 3 includes pluralities of state number setting means,
wait instruction signal generating means and a wait request signal creating means.
The wait request signal creating means output the results to the corresponding wait
instruction signal generating unit, and output to the main control part the OR logical
product of the wait request signal outputted from each wait instruction signal generating
means.
[0014] In the invention according to claim 4, a microprocessor performs an ordinary operation
processing by a predetermined bus cycle. When a peripheral device arranged outside
of the microprocessor is accessed, a signal that chip-selects the peripheral device
by an address is commonly used as a wait signal. When the microprocessor outputs a
chip-select signal to its peripheral device, an address selector detects it as a wait
request signal. When the wait request signal is detected, the bus cycle in the microprocessor
is caused to wait for a period corresponding to the predetermined state number. During
this wait period, an access between the microprocessor and the peripheral device is
performed. After a certain period has elapsed, the wait is cleared and the original
bus cycle is reinstated.
[0015] The invention according to claim 5 includes a microprocessor for processing an operation
at a predetermined bus cycle and a peripheral device accessible by the microprocessor.
When the peripheral device is accessed, the microprocessor whose microcomputer causes
its bus cycle to wait, comprises a main control part for processing an operation and
for creating an access control signal of the peripheral device, a state number setting
means for programmably setting the state number caused to wait, and a wait instruction
signal generating means for generating a wait instruction signal in correspondence
with the wait request signal. When the peripheral device arranged outside the microprocessor
is accessed, a signal that chip-selects the peripheral device with the address is
commonly used as the wait request signal. When the main control part outputs the chip-select
signal to the peripheral device, the address selector provided outside the microprocessor
detects it as a wait request signal. When the wait request signal is detected, the
wait instruction signal generating means outputs a wait instruction signal to the
main control part, and causes the bus cycle in the main control part to wait for a
period corresponding to the state number set by the state number setting means. During
this period, the main control part and the peripheral device are accessed.
[0016] The invention according to claim 6 includes pluralities of peripheral devices, the
state number setting means, the wait instruction signal generating means and address
selectors. The address selectors individually detect chip-select signals outputted
from the main control part in correspondence with each of the plurality of peripheral
devices as wait request signals, output the result to the corresponding wait instruction
signal generating means, and output to the main control part a wait instruction signal
by obtaining the "OR" logical product of each wait instruction signal generating means.
[0017] In the invention according to claim 7, when a plurality of peripheral devices simultaneously
generate wait requests to the main control part, the wait request from the peripheral
device with the largest number of wait states in the related state number setting
means is prioritized.
[0018] In this invention, when the main control part requests an access to its peripheral
device, it is detected as a trigger condition of the wait request signal (e.g., a
chip-select signal of the peripheral device can be commonly used as the wait request
signal), and is sent to the wait instruction signal generating unit. Then, a wait
instruction signal generating unit outputs a wait instruction signal to the main control
part so that the bus cycle in the main control part is caused to wait for a period
corresponding to the state number set by the state number setting means. During this
period, the main control part and its peripheral device are accessed. After this period
has elapsed, the wait is cleared and the original bus cycle is reinstated.
[0019] Therefore, the mechanism for generating a wait request signal can be configured simply,
for example, by an address decoder and a timing for a wait request/clearing becomes
unnecessary. As a result, an automatic wait control of the microprocessor is realized,
in which both the external circuits and the microprocessor's internal circuits necessary
for the wait control are greatly simplified.
Brief Description of the Drawings
[0020]
Figures 1A, 1B and 1C are circuit diagrams for explaining the principle of this invention;
Figures 2 and 3 show the microcomputer and illustrate the bus cycle control method
according to the first embodiment of this invention. Figure 2 is a circuit diagram
and Figure 3 is a timing chart;
Figure 4 shows circuit diagram of the microcomputer and illustrates the bus cycle
control method according to the second embodiment of this invention;
Figures 5 and 6 show the microcomputer and illustrate the bus cycle control method
according to the third embodiment of this invention; Figure 5 is its circuit diagram
and Figure 6 is its timing chart;
Figure 7 shows a circuit diagram of the microcomputer and illustrates the bus cycle
control method according to the fourth embodiment of this invention.
Description of the Preferred Embodiments
[0021] Figures 1A, 1B and 1C are circuit diagrams for explaining the principle of this invention.
[0022] Figure 1A is for explaining the first principle of this invention. In Figure 1A,
101 is a microprocessor comprising a main control part 102, a number of wait states
setting unit 103 and a wait instruction signal generating unit 104. A wait request
signal creating unit 105 is set outside the microprocessor 101. This microprocessor
101 comprises one chip LSI, for example.
[0023] Here, a microprocessor is referred to as something whose internal parts comprise
LSI's. A microcomputer is composed of internal parts comprising LSI's, and peripheral
circuits, which together are generally referred to as a microcomputer system. Other
embodiments described later are similarly described later.
[0024] The main control part 102 is equivalent to the core part of the microprocessor 101
and comprises such things as a PLA, an ALU and a random logic. It processes a necessary
operation and outputs a bus control signal, input/output data, an output address,
and an address strobe signal, e.g., to a peripheral device. The bus control signal
includes a R/W signal, etc., whose line numbers are x, y and z, for instance.
[0025] The wait instruction signal generating unit 104 inputs a wait instruction signal
to the main control part 102 at a predetermined timing. While the wait instruction
signal indicates a wait instruction, the main control part 102 has a bus control function
for inserting a wait state in the current bus cycle and for extending the output state
such as the bus control signal, the input/output data and the output address.
[0026] The number of wait states setting unit 103 and the wait instruction signal generating
unit 104 operates in synchronization with an operating clock of the main control part
102. The number of wait states setting unit 103 (such as a register) can programmably
set the wait number to which the wait number is written according to a register write
order from the main control part 102.
[0027] The wait instruction signal generating unit 104 is a circuit for receiving a wait
request signal inputted from the outside of the microprocessor 101 and for detecting
a wait request trigger of the wait request signal. It samples a wait request signal
at a predetermined timing. If the sampling result shows a signal indicating a wait
request, the wait instruction signal generating unit 104 generates a wait instruction
signal that causes the bus cycle of the main control part 102 to wait for a period
according to the number of wait states and sends the wait instruction signal to the
main control part 102.
[0028] The wait instruction signal generating unit 104 can be a circuit for detecting a
special signal (such as a rising edge or a falling edge) indicating the wait beginning
of the wait request signal and for generating a wait instruction signal that causes
the bus cycle of the main control part 102 to wait by the number of wait states, if
the signal indicates a wait request.
[0029] The wait request signal creating unit 105 outputs the wait request signal. When the
main control part 102 makes an access request to its peripheral device, the wait request
signal creating unit 105 detects it as a trigger condition of the wait request signal,
creates a wait request signal and sends it to the wait instruction signal generating
unit 104.
[0030] In the above configuration, the microprocessor 101 processes operations at a predetermined
bus cycle. After a predetermined time has elapsed since the microprocessor 101 outputs
an access request for accessing its peripheral device, the wait instruction signal
generating unit 104 samples the wait request signal or detects a wait request beginning
(such as an edge) of the wait request signal. If the detected signal indicates a wait
request, the wait instruction signal generating unit 104 counts up the counter in
the wait instruction signal generating unit 104 one by one to a certain wait state
contemporaneously with making a wait instruction by causing the main control part
102 to activate the wait instruction signal (a signal triggering a wait) at a predetermined
timing. During this period, the bus cycle is caused to wait and the microprocessor
101 accesses its low-speed peripheral device.
[0031] The predetermined time is allowed to elapse as above because the operating clock
of the microprocessor 101 determines the predetermined time after an address output,
so that an output address from the microprocessor 101 is finalized and the wait request
signal creating unit 105 can stably output a wait request signal during the predetermined
period.
[0032] When the counter reaches the number of wait states, the wait instruction signal generating
unit 104 deactivates the wait instruction signal (a signal clearing a wait) and clears
the wait in the main control part 102. The wait instruction signal generating unit
104 does not need to sample the wait request signal while the main control part 102
is waiting.
[0033] Meanwhile, the wait request signal creating unit 105 outputs a wait request signal
to a wait request input terminal (not shown in the drawing) of the microprocessor
101 . It creates this signal by selecting the address to be caused to wait from the
output addresses of the microprocessor 101, for example. In this case, the wait request
signal creating unit 105 does not need to select an address at a particular timing.
It can receive a control signal from another source to be used as processing information
for creating a wait request signal.
[0034] Consequently, as described above, after the main control part 102 receives a wait
request, since the microprocessor 101 automatically causes the bus cycle to wait for
a period corresponding to the number of wait states set in the number of wait states
setting unit 103, an external circuit for creating the wait request signal can be
formed of a generic address decoding circuit for selecting the address to be caused
to wait from the addresses outputted from the microprocessor 101. Accordingly, a timing
for wait requesting or clearing is no longer necessary, and the circuits of both the
external circuit for the wait control of the microprocessor 101 and the internal circuit
of the microprocessor 101 can be simplified, thereby realizing a microprocessor with
a low-cost automatic wait control.
[0035] Figure 1B explains a second principle of this invention. It is different from Figure
1A in that many peripheral devices 6 are provided and the wait request signal creating
unit 105 receives a chip-select signal from one of the peripheral devices 6 as the
wait request signal and detects a wait request trigger of the wait request signal.
[0036] The peripheral devices 6, such as a RAM, a ROM, a communication LSI or an image control
LSI, have a slower operating speed than the microprocessor 101, and a chip-select
signal CS selects one chip. The wait request signal creating unit 105 outputs a chip-select
signal to one of the peripheral devices 6 by selecting a signal (such as an output
address) from the main control part 102. In this embodiment, a chip-select signal
is commonly used as a wait request signal. The wait request signal creating unit 105
outputs the chip-select signal to the number of wait states setting unit 103 as the
wait request signal.
[0037] Accordingly, when the microprocessor 101 outputs a signal for accessing the peripheral
device 6, the wait request signal creating unit 105 selects one of the peripheral
devices 6 to be caused to wait and outputs the select result signal to the wait request
input terminal (not shown in the drawing) of the microprocessor 101 as the wait request
signal. Thus, the chip-select signal selects the appropriate peripheral device 6.
In this way, a chip-select signal is commonly used to eliminate the need for a timing
for wait request or a clearing, thereby simplifying both the external circuit for
a wait control and the internal circuit and realizing a microprocessor with a low-cost
automatic wait control.
[0038] Figure 1C explains a second principle of this invention. It is different from Figure
1B in that an address selector 5 is provided in lieu of the wait request signal creating
unit 105.
[0039] In this embodiment, the address selector 5 outputs a chip-select signal to one of
the peripheral devices 6 and selects an output address from the main control part
102. The address selector 5 also outputs the chip-select signal to the number of wait
states setting unit 103 as a wait request signal.
[0040] Accordingly, the address selector 5 judges whether the microprocessor 101 outputs
an output address for accessing the peripheral device 6, selects an address to be
caused to wait, and outputs the select result signal to the wait request input terminal
(not shown in the drawing) of the microprocessor 101 as the wait request signal. Thus,
an external circuit for creating a wait request signal can be formed of a generic
address decode circuit for selecting an address to be caused to wait from the addresses
outputted from the microprocessor 101. As a result, a wait request or a clearing is
no longer necessary, thereby simplifying both the external circuit for a wait control
of the microprocessor 101 and the internal circuit of the microprocessor 101 and realizing
a microprocessor with a los-cost automatic wait control .
[0041] More concrete descriptions of the preferred embodiments are illustrated by the drawings,
as follows.
First embodiment
[0042] Figures 2 and 3 show the first embodiment of the microcomputer and its bus cycle
control method according to this invention.
[0043] Figure 2 is a circuit diagram in which 11 is a microprocessor, 12 is a main control
part, 13 is a number of wait states setting register (equivalent to the number of
wait states setting unit), 14 is a wait instruction signal generating part (equivalent
to the wait instruction signal generating unit), 15 is an address selector circuit,
and 16 is a peripheral device.
[0044] The microprocessor 11 comprises the main control part 12, the number of wait states
setting register 13 and the wait instruction signal generating part 14.
[0045] The main control part 12 samples the wait instruction signal at a timing of a falling
edge of a clock TL, and has a bus control function for extending the bus cycle by
one wait state when a sampling result indicates "1". (This embodiment assumes that
one state is equal to one bus-cycle period.) The main control part 12 processes one
phase of a clock TFP as one bus cycle, and outputs addresses A0, A1 and A2; data D0,
D1 and D2; and a bus control signal such as a data reading signal RD, a data writing
signal WR, and an address strobe signal ADS, at a timing of a rising edge of the clock
TFP. The main control part 12 outputs that the reset sitnal RESET is "0" when the
microprocessor 11 is being reset and that the reset signal RESET is "1" after the
reset is cleared.
[0046] The number of wait states setting register 13 sets the number of wait states from
the main control part 12 or from the outside. It sets all initial values to "0" after
the reset is cleared. In this embodiment, nothing is caused to wait if all initial
values are "0".
[0047] The wait instruction signal generating part 14 comprises a wait request latching
circuit 21, a binary counter circuit 22, a number of wait states comparing circuit
23 and an "AND" gate 24.
[0048] When the input level of a reset (RX) is "1" and the input level of a latch enabling
signal (ENX) is "0", the wait request latching circuit 21 latches a wait request signal
supplied from a terminal D at a timing of a rising edge of the clock TL, and outputs
the latching result to the main control part 12 from an output (WAIT). When the input
level of the latch enabling signal (ENX) is "1", the wait request latching circuit
21 does not latch, but retains the previously latched value. When the input level
of the reset (RX) is "0", the wait request latching circuit 21 outputs "0" at an RX
input timing (plus the elapsed gate time).
[0049] When the input level of a reset (RX) is "1" and the input level of a count enabling
signal (EN) is "0", the counter circuit 22 outputs count-up outputs (Q1, Q0) at a
timing of a falling edge of the clock TL. When the input level of the reset (RX) is
"0", the counter circuit 22 outputs "0" at the RX input timing (plus the elapsed gate
time). When the input level of the count enabling signal (EN) is "0", the counter
circuit 22 does not count, but retains the previously latched value.
[0050] The number of wait states comparing circuit 23 compares signals WS0 with C0, and
WS1 with C1 from the number of wait states setting register 13 at a timing of a rising
or falling edge of the clock TFP. If the two pairs agree, the number of wait states
comparing circuit 23 sets the output QX to "0" and outputs it to the "AND" gate 24.
If the tow pairs do not agree, the number of wait states comparing circuit 23 sets
the output QX to "1" and outputs it to the "AND" gate 24. When the output QX is "0",
the "AND" gate 24 sends a signal RESET to the wait request latching circuit 21.
[0051] The address selector circuit 15 may select any of the addresses A0, A1 and A2 outputted
from the microprocessor 11. In the present embodiment, the address selector circuit
15 comprises an "AND" gate that outputs "1" when A0, A1 and A2 are all "1".
[0052] Actual operations according to this configuration are explained by referring to Figure
3 which is a timing chart.
[0053] Because initial values of the number of wait states comparing circuit 23 and the
number of wait states setting register 13 are all "0" after the microprocessor 11
is reset, the output QX from the number of wait states comparing circuit 23 becomes
"0", and both the wait request latching circuit 21 and the counter circuit 22 are
reset. Hence, until any value other-than "00
B" is set in the number of wait states setting register 13 after the microprocessor
11 is reset, the output QX of the number of wait states comparing circuit 23 remains
"0" and each circuit is kept reset. Thus, the wait instruction signal for the microprocessor
11 becomes a deactivating (wait clearing) signal.
[0054] If "11
B" is set to the number of wait states register 13 after reset clearing of the microprocessor
11, the input value "00
B" (C1, C0) from the counter circuit 22 does not agree with the input value "11
B" (WS1, WS0) from the number of wait states setting register 13 at the number of wait
states comparing circuit 23. Thus, the wait state number register 13 outputs "1" as
a result of comparing the timing of the rising or falling edges of the clock TFP.
Consequently, the resetting of the wait request latching circuit 21 and the counter
circuit 22 are cleared (RX input is set to "1"), and the wait request latching circuit
21 becomes capable of latching the wait request at a predetermined timing and counter
circuit 22 becomes capable of performing a count-up operation.
[0055] If an address signal is concurrently outputted from the microprocessor 11 to the
peripheral device 16, it is detected as a wait request signal by the address selector
circuit 15. That is, only when the addresses A0, A1 and A2 outputted from the main
control part 12 are "111
B" does the address selector circuit 15 output "1" and a wait request for the microprocessor
11. Here, the output level of the wait request signal is assumed to be finalized at
a latching, since the wait request latching circuit 21 latches the wait request signal
at a timing of a rising edge of the clock TL. In other words, the addresses A0, A1
and A2 outputted from the main control part 12 are assumed to be finalized sufficiently
in advance of the rising of the clock TL (to allow time for signal propagation delays
due to, e.g., gate delay and wiring capacitance).
[0056] Thus, the wait request latching circuit 21 latches a wait request signal "1" at a
timing of a rising edge of the clock TL and outputs it to the main control part 12
as a wait instruction signal.
[0057] Since the latched signal is "1", the main control part 12 latches the wait instruction
signal at a falling of the clock TL and inserts one wait state into the next bus cycle.
The wait instruction signal is also inputted to the counter circuit 22 as its count
enabling signal (EN). The counter circuit 22 is counted up at a falling timing of
the clock TL when the wait instruction signal is "1", and the output changes from
"00
B" to "01
B".
[0058] The number of wait states comparing circuit 23 compares the input value "01
B" (C1, C0) from the counter circuit 22 with the input value "11
B" (WS1, WS0) at a rising or falling timing of the clock TFP. Due to the non-agreement,
however, the output QX remains "1", and the wait request latching circuit 21 continues
to output the wait instruction signal "1" (the wait request) to the main control part
12.
[0059] Then, the wait request latching circuit 21 outputs the wait instruction signal "1"
to the main control part 12, until the counter circuit 22 is counted up at a timing
of a falling edge of the clock TL, and their outputs Q1 and Q0 change from "00
B" through "01
B" and "10
B" to "11
B", and finally match the value of the number of wait states "11
B" and the number of wait states comparing circuit 23 outputs "0" (agreement) as a
comparing result. Thereafter, since the wait request latching circuit 21 and the counter
circuit 22 are reset (RX input is "0") when the number of wait states comparing circuit
23 outputs "0" (agreement), the wait instruction signal becomes "0" and the main control
part 12 ceases to insert a wait state from the next bus cycle.
[0060] To summarize, the chip-select signal selected in the address selector circuit 15
enables wait states of the numbers set by the number of wait states setting register
13 to be inserted into the bus cycle. Therefore, as stated earlier, both the external
circuit necessary for the wait control of the microprocessor 101 and the internal
circuit of the microprocessor 101 can be simplified, thus realizing a microprocessor
11 with a low-cost automatic wait control.
Second embodiment
[0061] Figure 4 is a circuit diagram showing of the second embodiment of this invention,
in which a plurality (n pieces) of peripheral devices 16a through 16n and their corresponding
address selector circuits 15a through 15n are provided. The address selector circuits
15a through 15n detect a chip-select signal outputted from a main control part 32
corresponding to peripheral devices 16a through 16n as wait request signals 1 through
n, and output the results to the corresponding wait instruction circuits 33a through
33n. That the address selector circuits 15a through 15n output chip-select signals
to the corresponding peripheral devices 16a through 16n.
[0062] The wait instruction circuits 33a through 33n (equivalent to the number of wait states
setting unit and wait instruction signal generating means each comprise a number of
wait states setting register, a wait request latching circuit, a counter circuit and
a number of wait states comparing circuit. An "OR" gate 34 sums, by "OR" logic, all
signals outputted from the wait instruction circuits 33a through 33n.
[0063] Thus, when a plurality of wait requests are simultaneously generated in a microprocessor
31, the one with the largest number of wait states among the corresponding number
of wait states setting register is prioritized. Clearly, this embodiment can achieve
an effect similar to that of the first embodiment.
Third embodiment
[0064] Figures 5 and 6 illustrate the third embodiment of this invention.
[0065] Figure 5 is its circuit diagram. This differs from the first embodiment in that a
wait request beginning signal detecting circuit 43 replaces the wait request latching
circuit and an address selector circuit 45 is changed to output a wait request signal
in synchronization with a timing of a falling edge of an ADS signal (address strobing
signal) outputted from a microprocessor 41. 42 is a main control part and 44 is a
wait instruction signal generating part.
[0066] Figure 6 is a timing chart. The wait request beginning signal detecting circuit 43
is a widely known rising edge detecting circuit for detecting a change of a wait request
from "0" to "1". (It can be a falling edge detecting circuit, if the wait request
signal changes from "1" to "0".) When the input level of the reset signal (RX) is
"1" and that of the edge detection enabling signal (ENX) is "0", a rising edge detection
of the wait request beginning signal begins. When a rising edge is actually detected,
the wait request beginning signal detecting circuit 43 outputs "1" (for waiting).
When the edge detection enabling signal is "1", a rising edge detection of the wait
request beginning signal does not begin and the last value of the edge detection is
retained. Meanwhile, when the input level of the reset signal (RX) is "0", the wait
request beginning signal detecting circuit 43 outputs "0" at an RX input timing.
[0067] Since the wait request beginning signal detecting circuit 43 is an edge detecting
circuit, an address selector circuit 45 needs to output a wait request beginning signal
to the microprocessor 41. As in the first embodiment, this signal does not have a
period in which the wait request signal is not finalized. Hence, the address selector
circuit 45 outputs a wait request signal in synchronization with an address strobing
signal (ADS) that indicates that the microprocessor 41 guarantees a finalized address
output.
[0068] Thus, this present embodiment realizes a microprocessor with an automatic wait control
with a similar effect to those of the earlier embodiments, even if a wait is requested
for the microprocessor at the edge of the signal.
Fourth embodiment
[0069] Figure 7 is a circuit diagram of the fourth embodiment of this invention, in which
a plurality (n pieces) of peripheral devices 16a through 16n and their corresponding
address selector circuits 55a through 55n are provided, as in the second embodiment.
The address selector circuits 55a through 55n differ from the address selector circuits
15a through 15n shown in the second embodiment in that they are changed to output
chip-select signals in synchronization with a timing of a falling edge of an address
strobing signal (ADS) outputted from a microprocessor 51 to the peripheral devices
16a through 16n. 52 is a main control part.
[0070] This present embodiment realizes effects similar to those of the earlier embodiments,
even when the signal requesting a wait to the microprocessor 51 is an edge and there
are a plurality of peripheral devices 16a through 16n.
[0071] The present invention produces a wait instruction signal upon receiving a wait request
signal transmitted from an address selector provided outside the main control part.
When various circuits themselves provided in the main control part need to perform
the predetermined cycles of wait, a pseudo chip select signal may be caused to provide
to the peripheral circuit apparatus thereby enabling the peripheral circuit apparatus
to produce a wait signal. In this case, the peripheral circuit apparatus which receives
the pseudo chip select signal performs an ordinary operation but the main control
part does not utilize the data transmitted from the peripheral circuit apparatus.
Therefore, the pseudo wait signal can be produced by using a software program and
then the main control part can produce a wait signal without using its own soft counter.
[0072] A microprocessor starts a wait control only when a wait request signal from a wait
request input terminal is in a wait trigger condition. Therefore, in performing an
automatic wait control, this invention enables a greatly simplified circuit compared
with a microprocessor loaded with a conventional automatic wait control. Also, a chip-select
signal created by an external circuit can be used "as is" as a microprocessor wait
request signal, so a complicated timing for requesting or clearing a bus cycle wait
to the microprocessor is no longer necessary. Thus, the external circuit can be greatly
simplified. Thus, this embodiment realizes a microprocessor with a low-cost automatic
wait control.
1. A bus cycle control method for controlling a microcomputer wherein:
a microprocessor (101) processes ordinary operations in a predetermined bus cycle;
when a wait trigger condition of a wait request signal inputted from a wait request
signal creating means (105) provided outside of the microprocessor (101) is detected;
the bus cycles in the microprocessor (101) are caused to wait for a predetermined
wait period in the microprocessor (101) regardless of an input level of a wait request
signal thereafter;
the microprocessor (101) accesses its peripheral device during said predetermined
wait period;
after the predetermined wait period has elapsed, the wait is cleared to return the
microprocessor (101) to the original bus cycle,
enabling a wait trigger condition of a wait request signal to be detected again.
2. A microcomputer comprising:
a microprocessor (101; 11) for processing operations in a predetermined bus cycle;
and
peripheral devices (6; 16) accessible by said microprocessor, wherein
said microcomputer causes the bus cycle of said microprocessor (101; 11) to wait when
said microprocessor (101; 11) accesses one of said peripheral devices (6; 16),
said microprocessor comprises a main control part (102; 12) for processing operations
and generating access control signals to its peripheral devices, a state number setting
means (103; 13) for programmably setting the state number for a wait period, and a
wait instruction signal generating means (104; 14) for generating a wait instruction
signal in response to a wait request signal,
a wait request signal creating means (105); is provided outside of said microprocessor,
said microprocessor causes the bus cycles in said main control part (102; 12) to wait
for a period corresponding to the state number provided by said state number setting
means (103; 13) by outputting a wait request signal from said wait instruction signal
generating means (104; 14) upon a detection of a wait trigger condition of said wait
request signal creating means (105),
said microprocessor accesses said one of said peripheral devices (6; 16) during said
wait period, and after a period corresponding to a predetermined state number has
elapsed, said microcomputer becomes capable of detecting a wait trigger condition
of a wait request signal again.
3. The microcomputer according to claim 2, wherein said microcomputer outputs the logical
sum of the wait instruction signals outputted from said wait instruction signal generating
means (33a, 33b,... 33n) with "OR" logic (34),
said microcomputer comprises a plurality of said state number setting means (13),
wait instruction signal generating means (14) and wait request signal creating means;
said wait request creating means outputs the result to the corresponding wait instruction
signal generating means.
4. The microcomputer according to claim 2, wherein said microcomputer outputs the logical
sum of the wait instruction signals outputted from said wait instruction signal generating
means (33a, 33b, ... 33n) with "OR" logic (34),
said microcomputer comprises a plurality of said peripheral devices (16), state number
setting means (13), wait instruction signal generating means (14) and address selectors
(15a, 15b, ... 15n);
said address selectors detect each chip-select signal outputted from the main control
part (52) in correspondence with said plurality of the peripheral devices as wait
request signals and output the result to the corresponding wait instruction signal
generating means.
5. The microcomputer according to claim 4, wherein said microcomputer prioritizes the
wait request from the peripheral device (16a, 16b, ... 16n) having the largest number
of wait states provided in the state number setting means when a plurality of the
peripheral devices (15a, 15b,...15n) simultaneously generates wait requests to said
main control part (52).
6. A bus cycle control method for controlling a microcomputer wherein:
a microprocessor (101; 11) processes ordinary operations in a predetermined bus cycle;
when a peripheral device (6; 16) provided outside of said microcomputer is accessed,
a signal for chip-selecting said peripheral device by an address is commonly used
as a wait request signal;
an address selector (15) detects a chip-select signal outputted from said microprocessor
to said peripheral device as a wait request signal; bus cycles in said microprocessor
are caused to wait for a period corresponding to a predetermined number in the microprocessor
when said wait request signal is detected;
the microprocessor (101; 11) accesses said peripheral device during this wait period;
after said period corresponding to said predetermined state number has elapsed, the
wait is cleared to return the microprocessor to the original bus cycle.
7. A microcomputer comprising:
a microprocessor (31) for processing operations in a predetermined bus cycle; and
peripheral devices (16a, 16b,...16n) accessible by the microprocessor wherein,
said microcomputer (31) for causing the bus cycle of the microprocessor to wait when
said microprocessor accesses a peripheral device,
said microprocessor comprises a main control part (32) for processing operations and
generating access control signals to its peripheral devices, and a state number setting
means for programmably setting the state number for a wait period, and a wait instruction
signal in response to a wait request signal,
an address selector (15) for detecting a chip-select signal outputted from said main
control part to the peripheral devices as a wait request signal is provided outside
of said microprocessor,
said microprocessor causes the bus cycles in said main control part to wait for a
period corresponding to the state number provided by said state number setting means
by outputting a wait instruction signal from said wait instruction signal generating
means upon a detection of said wait request signal, and
said main control part accesses its peripheral devices during this wait period.
8. A microcomputer comprising:
a main control part (52) for reading a program through a bus and for executing an
operation;
a wait instruction signal generating means (33a, 33b,... 33n) for maintaining an occupation
of the bus of the main control in accordance with the number of states when the wait
instruction signal generating means receives respective wait request signals formed
corresponding to respective peripheral apparatus; and
state number setting means for storing the number of waits which is predetermined
by an access of the main control part and for providing the number of waits to said
wait instruction signal generating means.
9. The microprocessor according to claim 8, wherein said main control part, said wait
instruction signal generating means and said state number setting means are provided
in an LSI chip.