6 data memory timing, Byte block move without dual data pointer – Maxim Integrated High-Speed Microcontroller User Manual
Page 84

High-Speed Microcontroller User’s Guide
Rev: 062210
84 of 176
6.6 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
, 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. 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
. Note that this is not the reset default case. A three-cycle
MOVX is shown in
. This is the reset default condition. To modify the MOVX timing, the
Stretch value in the Clock Control register described below must be changed.
shows the timing
for a four cycle MOVX (Stretch = 2).
shows the resulting strobe widths for each Stretch value. The memory stretch is implemented
using the clock control SFR at SFR location 8Eh. The stretch value is selected using bits
.2-0. In
the table, these bits are referred to as M2 through M0. Note that the Stretch time can be dynamically