AN2866 Freescale Semiconductor / Motorola, AN2866 Datasheet - Page 25

no-image

AN2866

Manufacturer Part Number
AN2866
Description
Migrating from the MC68332 to the ColdFire MCF523x
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
2.6.2
If the original MC68332 code uses the Test And Set (TAS) instruction for implementing the locked or
read-modify-write transfer sequence in hardware, the instruction must be emulated in software on the
MCF523x. In order to do this, the interrupt mask should be raised to level 7, the read, modify, and write
instructions should be executed, and then the mask should be lowered to the appropriate level. Performing
this sequence of instructions will guarantee that they will execute uninterrupted with the exception of a
level 7 interrupt, which is nonmaskable.
2.6.3
One of the primary advantages of migrating an existing MC680X0 or MC683XX design to ColdFire is the
ease of software migration. Retargeting C or other high level programming language code to ColdFire is
relatively easy, and the risk of introducing errors into the code during the process is low. In addition, the
majority of ColdFire assembly instructions are derived directly from the 68K assembly language. This
makes porting assembly code from 68K to ColdFire much easier than porting to a completely new
architecture.
There are a number of tools available to address the handling of 68K assembly code. MicroAPL has two
free tools available—PortASM-68K and CF68KLib. The PortASM-68K tool is an assembly translation
tool that takes 68K assembly, flags instructions or instructions that use addressing modes that are not
supported by ColdFire, and replaces them with a ColdFire compatible emulation sequence. CF68KLib is
an emulation library that allows for 68K targeted assembly to be run directly on a ColdFire target without
translation. The library makes use of the ColdFire’s illegal instruction exception (vector 4) to trap on 68K
instructions that are unsupported by ColdFire. When the processor encounters one of these instructions, an
exception is generated and the library’s exception handler will decode the instruction and run a ColdFire
code sequence to emulate the instruction.
One of the other advantages is that in most cases the ColdFire targeted code can be run on the existing
M68K hardware. This allows for testing the software conversion on known good hardware. In addition,
software development can start in parallel with development of the ColdFire based hardware.
It is assumed that target software consists of C (or another high level programming language) and
assembly source code. The first step to create an executable that will run on existing M68K hardware to
test the conversion from M68K to the proper ColdFire subset. This step verifies that the process of code
conversion.
For more information on porting from M68000, please refer to Appendix B of the MCF5206e User’s
Manual.
3
There is little or no lost functionality, memory, or performance when migrating from the MC68332 to the
MCF523x. With the capability of triplingthe operating frequency, there should not be any additional
performance issues. Furthermore, most module functionality available on the MC68332 is either
duplicated or improved upon on the MCF523x, and the additional set of MCF523x on-chip peripheral
modules should enable many off-chip functions to be incorporated on chip, reducing hardware costs.
Freescale Semiconductor
Summary
Read-Modify-Write (RMW) Cycles
Software Porting from M68000 Family Devices
Migrating from the MC68332 to the ColdFire
®
MCF523x, Rev. 1.0
Summary
25

Related parts for AN2866