AN2398 Freescale Semiconductor / Motorola, AN2398 Datasheet - Page 5

no-image

AN2398

Manufacturer Part Number
AN2398
Description
In-Circuit Programming of FLASH Memory via the Universal Serial Bus for the MC68HC908JB8
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
THE ICP PROCEDURE
USING THE ICP CODE
MOTOROLA
In-Circuit Programming of FLASH Memory via the USB for the MC68HC908JB8
Using the ICP scheme, assuming the HID is a keyboard, the following would be
the procedure for reprogramming the JB8 user code:
This section describes the ICP code listing in the
After a reset, the value in the reset vector $FFFE:$FFFF points to $F800, the
start of the ICP program. Once initialization has completed, the ICP code
checks for conditions for entry into normal mode (the user code) or ICP mode
(the ICP code).
JB8 will enter ICP mode when:
If neither of the two conditions is true, then JB8 enters normal operating mode.
1. With the keyboard plugged to a PC, the user initiates an ICP event by
2. User unplugs and replugs the USB connector.
3. After replugging, the JB8 detects that ICP_FLAG word is not a
4. User launches a firmware upgrade program on the PC. (A separate
5. To prevent unauthorized access, the PC program asks for the 8-byte
6. Once pass security, the user is allowed to erase and program the user
7. After user code upgrade, the final step is to program the ICP_FLAG
8. User unplugs and replugs the USB connector.
9. After replugging, the JB8 detects that ICP_FLAG word is a checksum,
Freescale Semiconductor, Inc.
For More Information On This Product,
launching a program on the PC. This program clears the ICP_FLAG
word to zero in the JB8.
checksum and continues to run the ICP code. The PC detects the
keyboard is in ICP mode, ready for firmware upgrade.
keyboard must be used for this, since the keyboard in question is in ICP
mode.)
security passcode.
code in the JB8.
word checksum.
and continues to run the user code — the normal operating mode.
The high byte of the pseudo reset vector ($FF7C) is invalid; i.e. it is not
in range of the user FLASH area ($DC to $F7); or
The ICP_FLAG word is not a checksum.
Go to: www.freescale.com
APPENDIX: Code
THE ICP PROCEDURE
Listing.
AN2398/D
5

Related parts for AN2398