AN2157 Freescale Semiconductor / Motorola, AN2157 Datasheet - Page 6

no-image

AN2157

Manufacturer Part Number
AN2157
Description
MSC8101 Programming the MSC8101ADS Flash Memory
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Application Example
7
6
Application Example
Table 3 shows all the MSC8101ADS switch settings to run the application discussed in Appendix B
from Flash memory
To run an application from the MSC8101ADS Flash memory, perform the following steps:
1.
2.
In the example application discussed here, the green and red LEDs (LD10 and LD9, respectively) flash
continuously. This application note was tested with the following two files:
• LEDBlinker.c (see Appendix B)
• find_IMM.asm (see Appendix C)
main() within LEDBlinker.c calls Sinit(), which is located in find_IMM.asm. The purpose
of Sinit() is to initialize the MSC8101 internal memory map to 0x14710000. Determine what the ISB
(Internal Space Base) bits are after reset, and then set the memory map to 0x14710000 in the Internal
Memory Map Register (IMMR).
Execute this application out of Flash memory as follows:
1.
2.
3.
4.
(Optional) Remove the command converter connector from the MSC8101ADS.
This connection is for the debugger and is not used when an application runs from Flash memory.
Set up the MSC8101ADS. Run the application in Flash memory.
Either press PRESET (SW8) or re-apply power to the board.
Generate an S-record file for the application.
Create a C project for the MSC8101within the CodeWarrior folder and include the two files
LEDblinker.c and find_IMM.asm. This is done using the Project->Add Files menu
option.
Referring to Section 4, Generating an S-record File, step 2, enter the CodeWarrior settings to select
the proper environment and code generation settings, the correct linker command and C start-up file,
and to generate an S-record file.
Set up the
Building the application generates an S-record file called LEDblinker.s.
Program the MSC8101ADS Flash memory.
Set up the HyperTerminal application (refer to Section 5, step 1) on the PC with the desired
parameters (baud rate, data bits, stop bits, parity, handshaking, and ASCII line delay). Also set up a
serial cable connection between the RS-232 serial COM port on the PC and the upper RS-232
connector on the MSC8101ADS.
Open the Flash programmer project provided with the CodeWarrior software.
Switch
SW10
SW11
SW1
SW2
SW9
Freescale Semiconductor, Inc.
Post-Linker -> SC100 EFL to S-Record: Output File Name
For More Information On This Product,
Table 3. MSC8101ADS Switch Settings
on
on
on
off
off
1
off
on
on
on
off
2
Go to: www.freescale.com
on
on
on
on
off
3
on
on
off
on
on
4
on
on
5
on
off
6
on
off
7
on
off
8
to LEDblinker.s.

Related parts for AN2157