AN2408 Freescale Semiconductor / Motorola, AN2408 Datasheet - Page 20

no-image

AN2408

Manufacturer Part Number
AN2408
Description
Examples of HCS12 External Bus Design A Companion Note to AN2287/D
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Example #8 — Software External Interface
//
//
//
//
//
//
//
//
//
The MISC register is used to control some of the miscellaneous functions needed for bus control. The
EXSTR1 and EXSTR0 bits control the amount of clock stretching used during external bus accesses. If
the ESTR bit of the EBICTL register is set, these bits have no effect. These bits can be used to enable as
many as three addition clock cycles for each external access. The ROMHM (ROM high memory) bit can
be used to disable a device’s internal FLASH in the $4000–$7FFF address space. This is a good way to
interface devices with small memory maps. The ROMON bit controls whether the on-chip FLASH is
available. If the ROMON bit is cleared, the entire on-chip FLASH memory is disabled and the entire
FLASH memory space is available for external use or emulation.
The ROMON bit may be affected by the ROMCTL pin of the device. Refer to the device user guide for
details on active level.
Example #8 — Software External Interface
The final example is presented for two basic reasons:
The simplest external interface can be accomplished with just the external device and the general-
purpose I/O capabilities of the MCU. The following software example and simple schematic demonstrate
how efficient the interface could be. While the example shows a simple FLASH interface, the design can
be modified for any external device.
The following routine executes in 33 HCS12 cycles (1.3 µs at 25 mHz, approximately 1.5 MB per second):
20
To present the simplest available interface which requires only the external device and simple
software to control it.
To inspire thought as to the real system goal. What are the real throughput requirements? Is the
external memory required for data storage such as data-logging or system calibrations that will only
be used once or twice during boot up?
Regs.misc.byte = 0x07; // %00000111
Examples of HCS12 External Bus Design, Rev. 2
||||||||
|||||||+-ROMON------- Turn on internal flash
||||||+--ROMHM------- Make $4000-$7FFF external
|||||+---EXSTR0----\_ Set Stretch to one cycle
||||+----EXSTR1----/
|||+-----Reserved
||+------Reserved
|+-------Reserved
+--------Reserved
Freescale Semiconductor

Related parts for AN2408