AN2157 Freescale Semiconductor / Motorola, AN2157 Datasheet - Page 4

no-image

AN2157

Manufacturer Part Number
AN2157
Description
MSC8101 Programming the MSC8101ADS Flash Memory
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Loading the S-record File
4
3.
Note:
4.
Note:
Connect a serial cable between the COM port on the PC and the top RS-232 connector on the
MSC8101ADS. This is the physical connection that allows the HyperTerminal application on the PC
to communicate with the Flash loader application on the MSC8101ADS.
Start up the flash programmer.
Open the Flash memory programmer project provided with CodeWarrior. The project file is
cflash.mcp
\Metrowerks\CodeWarrior\StarCore Support\flash_programmer_support
This application calculates the appropriate baud-rate generator (BRG) clock for the MSC8101 CPM
UART interface based on the crystal oscillator frequency on the MSC8101ADS, the desired baud
rate, and the multiplication factors in the System Mode Clock Register (SCMR). Thus, the mode
number (MODCK_H, MODCK) on the MSC8101ADS does not need to be modified. However, the
Flash memory loader application needs the crystal frequency used on the MSC8101ADS and the
desired baud rate. This baud rate is the same as that used to set up the HyperTerminal application.
The crystal frequency and baud rate are indicated in the calc.h header file included with the Flash
memory loader application. This header file contains several define statements, two of which must
be set according to the existing crystal frequency and supported baud rate by the serial
communication interface. The define statements are as follows, and if any of these defines are
changed the project must be rebuilt:
— #define XTAL 20000000 /* External system clock. Currently the MSC8101ADS
— #define console_baudrate 115200 /* PC com port baud rate. This may need to be
Once the project is built, start and run the application on the MSC8101ADS. The HyperTerminal
window on the PC shows the following command interface if everything is set up correctly.
Program the Flash memory.
Program the HRCW, the address table, and the S-record file into the MSC8101ADS Flash memory,
as follows:
a.
b.
boards are being shipped with 20 MHz clocks. Some of the older boards have 16.384
(16384000) or 25 MHz (25000000) clocks. */
changed depending on what your PC supports. One possibility is 57.6 Kbaud (57600) */
Ensure that the debug switch is turned on in the MSC8101ADS board (SW10-1: ON) so that the
MSC8101 can go into Debug mode after power-on reset.
MSC8101ADS Flash Loader
print
-->
Erase the sectors where the HRCW, address table and application are to reside. The application
described in this application note uses sector 0 for the HRCW and address table and sector 1 for
the application. Each sector contains 256 KB.
The application was placed in a different sector than the HRCW and address table. If the
application needs to be modified, sector 0 may not need to be reprogrammed.
The following commands erases sectors 0 and 1.
-->0 sec_erase
-->1 sec_erase
Program the HRCW. This step is not required if the system is booting from the Altera gate array
on the MSC8101ADS (SW9:7 OFF). Since the 32-bit HRCW is programmed into four separate
locations, the following four commands are required to program an HRCW of 0x2C00020A into
locations 0x0, 0x8, 0x10 and 0x18 offset from the beginning of the Flash memory:
-->h2c000000 hff800000 program_word
Freescale Semiconductor, Inc.
For More Information On This Product,
and can be found at C:\Program Files
dump
Go to: www.freescale.com
load_flash sec_erase program_word help sec_addr
.

Related parts for AN2157