English
Language : 

DS80C320-MCG Datasheet, PDF (87/175 Pages) Dallas Semiconductor – High-Speed Microcontroller User Guide
High-Speed Microcontroller User’s Guide
DATA MEMORY TIMING
Data memory timing refers to the execution of the MOVX instruction. This instruction includes a
program fetch memory access, then a read or write memory access. The program fetch for a MOVX
instruction is no different from any other instruction. The unique timing occurs for the second memory
operation when data is accessed.
As described in Section 5, the High-Speed Microcontroller uses four oscillator clocks for each machine
cycle. A machine cycle involves one memory access. Generally, an instruction using two memory
accesses would be a two machine cycle instruction (except for branches, MUL, DIV, INC DPTR, MOVC,
and MOVX). The MOVX instruction is unique in that the user determines the time allowed for a data
memory access. This feature is called the Stretch MOVX instruction.
The High-Speed Microcontroller allows the application software to adjust the speed of data memory
access. The microcontroller is capable of performing the MOVX in as little as two machine cycles.
Since one machine cycle is used for the program fetch, this leaves one machine cycle to perform the
actual data memory access. However, this value can be adjusted as needed so that both fast memory and
slow memory or peripherals can be accessed with no glue logic. Even in high-speed systems, it may not
be necessary to perform data memory access at full speed. In addition, there are a variety of slower
memory mapped peripherals such as LCD displays or UARTs.
When using a MOVX instruction, the user controls the time for which a read or write strobe is kept
active. Setup and hold times are also adjusted. Thus the Stretch value will be selected to provide a long
enough memory strobe to satisfy the access time of the target device.
The Stretch MOVX is controlled by a value in a special function register described below. This allows
the user to select a stretch value between zero and seven. A Stretch of zero will result in a two machine
cycle MOVX. This leaves one machine cycle to actually read or write data. A Stretch of seven will
result in a MOVX of nine cycles. The time is added to the middle of the memory strobe, creating a very
long read or write cycle. The Stretch value can be changed dynamically under software control
depending on the type of memory or peripheral to be accessed.
On reset, the Stretch value will default to a one, resulting in a three cycle MOVX. Therefore, data
memory access will not be performed at full speed. This is a convenience to existing designs that may
not have fast RAM in place. When maximum speed is desired, the software should select a Stretch value
of zero. Note that faster RAMs will be needed. When using very slow RAM or peripherals, a larger
stretch value can be selected. Note that this affects data memory only and the only way to slow program
memory (ROM) access is to use a slower crystal.
Using a Stretch value between one and seven results in a wider read/write strobe allowing more time for
memory/peripherals to respond. The microcontroller stretches the read/write strobe and all related
timing. The full speed access is shown in Figure 6-4. Note that this is not the reset default case. A three
cycle MOVX is shown in Figure 6-5A. This is the reset default condition. To modify the MOVX timing,
the Stretch value in the Clock Control register described below must be changed. Figure 6-5B shows the
timing for a four cycle MOVX (Stretch=2).
Table 6-1 below shows the resulting strobe widths for each Stretch value. The memory stretch is
implemented using the Clock Control Special Function Register at SFR location 8Eh. The stretch value is
selected using bits CKCON.2-0. In the table, these bits are referred to as M2 through M0. Note that the
Stretch time can be dynamically varied, allowing fast RAM’s but slow peripherals. The first stretch
allows the use of common 120 ns or 150 ns RAM’s without dramatically lengthening the memory access.
87 of 175