30
FUJITSU MICROELECTRONICS (SHANGHAI) CO., LTD. Room 3102, Bund Center, 222 Yan An Road (E), Huang Pu Area, Shanghai, P.R. China Tel: 6146 3688 Fax: 6335 1605 1 8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 Revision History Date Author Change of Records 2009-12-01 Jacky Zhou V1.0, First Draft 2009-12-07 Jacky Zhou V1.1, update flowchart to timing in 4.1, 4.2 2009-12-16 Jacky Zhou V1.2, update in 4.1, 4.2 Add chapter 3 Add UART PGM 2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D bus description; Add performance comparison between serial and parallel programming solution 2010-01-05 Jacky Zhou V1.5, Add flowchart in chapter 2 Update description in chapter 5 2010-01-07 Levi Zhang V1.6 Modify Performance Comparison Modify Program Address Modify Command Table 2010-01-08 Levi Zhang Jacky Zhou V1.7 Update format V1.8 Add MB95F370 series in the spec Update HW block Update Bin code

8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

  • Upload
    others

  • View
    5

  • Download
    2

Embed Size (px)

Citation preview

Page 1: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

FUJITSU MICROELECTRONICS (SHANGHAI) CO., LTD. Room 3102, Bund Center, 222 Yan An Road (E), Huang Pu Area, Shanghai, P.R. China

Tel: 6146 3688 Fax: 6335 1605

1

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer

Specification V1.8

Revision History

Date Author Change of Records 2009-12-01 Jacky Zhou V1.0, First Draft 2009-12-07 Jacky Zhou V1.1, update flowchart to timing in 4.1, 4.2 2009-12-16 Jacky Zhou V1.2, update in 4.1, 4.2

Add chapter 3 Add UART PGM

2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8

2009-12-24 Levi Zhang V1.4 Update A/D bus description; Add performance comparison between serial and parallel programming solution

2010-01-05 Jacky Zhou V1.5, Add flowchart in chapter 2 Update description in chapter 5

2010-01-07 Levi Zhang V1.6 Modify Performance Comparison Modify Program Address Modify Command Table

2010-01-08 Levi Zhang Jacky Zhou

V1.7 Update format V1.8 Add MB95F370 series in the spec Update HW block Update Bin code

Page 2: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 2 of 30

Contents

REVISION HISTORY ............................................................................................................ 1�

1� INTRODUCTION .............................................................................................................. 3�

2� PARALLEL PROGRAMMING.......................................................................................... 4�

2.1� Overview ................................................................................................................. 4�

2.2� Features of Parallel Programming ........................................................................... 4�

3� MB95F310/370 SERIES HARDWARE ............................................................................. 5�

3.1� MCU Package and Pin Assignment ......................................................................... 5�

3.2� MB95F310/370 Series Memory Map and Sector Configuration ............................... 9�

3.3� Hardware Connection ............................................................................................ 10�

4� DOWNLOAD CODE TO TARGET MCU ........................................................................ 11�

4.1� PGM Mode Entry Timing Chart .............................................................................. 11�

4.2� 1-line UART Communication Specification ............................................................ 12�

4.3� The Communication Sequences Overview ............................................................ 13�

4.4� Hand-shake Command .......................................................................................... 13�

4.5� Command Format Overview .................................................................................. 14�

4.6� Erase Command Sequences ................................................................................. 14�

4.7� Download Code to RAM ........................................................................................ 15�

5� BASIC OPERATION OF TARGET MCU ........................................................................ 18�

5.1� Command Sending Sequence ............................................................................... 18�

5.2� Data Send or Receive Sequence .......................................................................... 20�

5.3� Erase Flash ........................................................................................................... 21�

5.4� Write Flash ............................................................................................................ 22�

5.5� Read Flash ............................................................................................................ 23�

6� FLASH SECURITY OPERATION .................................................................................. 24�

1.1.� Flash Security introduction .................................................................................... 24�

1.2.� Flash Security Setting Suggestion ......................................................................... 24�

1.3.� Programming Flash Security Enabled MCU .......................................................... 24�

7� DC CHARACTERISTICS ............................................................................................... 25�

8� FLASH MEMORY OPERATION CHARACTERISTICS .................................................. 28�

9� ADDITIONAL INFORMATION ....................................................................................... 29�

10�APPENDIX ..................................................................................................................... 30�

10.1� List of Figures and Tables ..................................................................................... 30�

Page 3: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 3 of 30

1 Introduction

This application note describes how to realize parallel programming in MB95310/370 Series.

This application note describes preparative and basic operation for parallel programming.

Page 4: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 4 of 30

2 Parallel Programming

2.1 Overview To improve the program performance, adopt 8-bit parallel interface instead of 1-line UART interface.

Figure 2-1 shows how to program Target MCU.

Figure 2-1: Flow Chart of Program Target MCU

2.2 Features of Parallel Programming • Parallel interface

• Faster program speed, performance as below

Table 2-1: Performance of Parallel Programming

1* Serial programming (Baud rate: 31250 bps)

2* Parallel programming (Typical)

3* Refer to "8FX-LPC MCU Flash Serial Programming Specification V1.5"

Action Time Consumption

Remark

Erase flash 1* 1S (16K) Erase 60K may need 3.75S, 3*

2* 1.94S (60K) Erase 60K and write 4 bytes NVR (1000H - FFFFH)

Write 1 byte 1* 317uS 3*

2* 85uS Write 1 byte

Write flash 1* 5.2S (16K) Write 60K may need 19.5S, 3*

2* 5.24S (60K) 1000H - FFFFH, without 4 bytes NVR

Read 1 byte 1* 317uS 3*

2* 35uS Read 1 byte

Read flash 1* 5.2S (16K) Read 60K may need 19.5S, 3*

2* 2.16S (60K) 1000H - FFFFH

Read Target MCU Write Target MCU

Start

Initial Target MCU

Command

Erase Target MCU

1-line UART

Parallel IF

Page 5: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 5 of 30

3 MB95F310/370 Series Hardware

3.1 MCU Package and Pin Assignment There are 2 kinds of package available for MB95F310/370 Series MCU at present:

FPT-80P-M21 (80-pin plastic LQFP) and FPT-64P-M23 (64-pin plastic LQFP).

FPT-80P-M21 (80-pin plastic LQFP):

Page 6: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 6 of 30

FPT-64P-M23 (64-pin plastic LQFP):

FPT-64P-M24 (64-pin plastic LQFP):

Page 7: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 7 of 30

The pin assignment of the 80 pin 8FX-LPC MCU follows

Page 8: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 8 of 30

The pin assignment of the 64 pin 8FX-LPC MCU follows

Page 9: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 9 of 30

3.2 MB95F310/370 Series Memory Map and Sector Configuration Memory map

Flash memory sector configuration.

Part number Flash Memory MCU Address Programmer Address MB95F314E/MB95F314L MB95F374E/MB95F374L 20KB B000H~FFFFH B000H~FFFFH

MB95F316E/MB95F316L MB95F376E/MB95F376L 36KB 7000H~FFFFH 7000H~FFFFH

MB95F318E/MB95F318L MB95F378E/MB95F378L 60KB 1000H~FFFFH 1000H~FFFFH

Page 10: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 10 of 30

3.3 Hardware Connection To realize parallel programming, part of connection between Programmer and Target MCU is fixed, which shows as Figure 3-1.

Figure 3-1: Connection between Programmer and Target MCU The Pin assignment of Target MCU is as below:

Table 3-1: Pin assignment of Target MCU Pin Direction Function

VCC Power supply

GND Power supply (GND)

RSTX Input Reset

DBG Input/Output Mode control and 1-line UART

PC0 Input Programmer set OEX ‘L’ to Target MCU before read data

PC1 Input Programmer set SLEX ‘L’ to Target MCU before send command

PC2 Input Programmer set WEX ‘L’ to Target MCU before send Write Data

PC3 Output Set RDY ‘L’ to Programmer after Receive command/Data or Send data

P0 Input/Output A/D bus, receive/Send Data from/to Programmer; [P07..P00] � [Bit7..Bit0]

For communicating with Target MCU, some pins of Programmer must be assigned to match pins of Target MCU.

In this way, the HW connection is prepared, and then Programmer can control Target MCU to realize parallel programming.

Target MCU

MB95F310/370 Series

Programmer

P0 A/D Bus

PC0 OEX

GND GND

RSTX RSTX

DBG DBG

VCC VCC

PC1 SLEX

PC2 WEX

PC3 RDY

Page 11: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 11 of 30

4 Download Code to Target MCU

For parallel programming, a code must run in RAM of Target MCU, which accepts command and data from Programmer, and then erase flash, write data to flash of Target MCU, or read out data and send back to Programmer. So before Programmer can erase/write/read flash of Target MCU, must download the code to RAM of Target MCU.

4.1 PGM Mode Entry Timing Chart

The following timing will enable 8FX-LPC MCU enter PGM mode.

Page 12: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 12 of 30

4.2 1-line UART Communication Specification 1-line UART features: Baud rate = 62500bps 8 bit data length 1 bit stop bit No parity LSB first All the communications are initialized by Programmer. That is, Programmer is Master and MCU is Slave during PGM mode. The 1-line UART between programmer and MB95F310/370 Series MCU is half-duplex, so data transfer is unidirectional.

Command frame is transferred from Programmer to MCU. Programmer is in sending status, while MCU is in receiving status;

Return frame is transferred from MCU to Programmer. Programmer is in receiving status, while MCU is in sending status;

Both command frame and return frame transfer at the same time is forbidden based on the 1-line UART communication.

Page 13: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 13 of 30

4.3 The Communication Sequences Overview

4.4 Hand-shake Command After first power on entry, hand-shake with 8FX-LPC MCU is necessary before executing PGM command. The following is the hand-shank command: After first reset, PGM sends two bytes (0x55AA) to MCU repeatedly. There is an interval (�3ms) between 0x55 and 0xAA. Then PGM waits some time (�6.6ms) for the ACK from MCU. Repeating 20 times until ACK (0x51) is received.

If PGM receives 0x51 after sending 0x55AA commands, CR Trimming completes successfully.

If PGM receives no ACK (or ACK is not 0x51) in 20 times, hand-shake fails. Please power on 8FX-LPC MCU again and re-do the hand-shake operation.

0x55 <<interval>> 0xAA <<wait for ACK>> 0x55 <<interval>> 0xAA

0x55AA No ACK 0x55AA ---------- 0x55AA ACK(0X51) success

Serial Programmer

(Host)

LPC MCU (Slave)

Command

Reply

Command

Reply Time

Page 14: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 14 of 30

4.5 Command Format Overview

PGM can send commands to MCU only after hand-shake succeeds. They are fixed to 5 bytes for 1 unit, as shown below: Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Function Code Data H Data L Checksum ACK

Checksum is the sum of Function Code, Data H and Data L. Normal ACK value is 0x00; flash security ACK is 0xFD. Other ACK means operation error.

4.6 Erase Command Sequences

The Erase command is shown below: Communication byte number

Transmit/Receive Data

Description Communication direction

1st byte 0x00 Fixed Data

Parameter set (62500bps)

PGM to MCU 2nd byte 0x00 Fixed Data PGM to MCU 3rd byte 0x0C Fixed Data PGM to MCU 4th byte 0x0C Checksum PGM to MCU 5th byte 0x00 ACK MCU to PGM 1st byte 0x05 Fixed Data

Parameter set (62500bps)

PGM to MCU 2nd byte 0x00 Fixed Data PGM to MCU 3rd byte 0x60 Fixed Data PGM to MCU 4th byte 0x65 Checksum PGM to MCU 5th byte 0x00 ACK MCU to PGM 1st byte 0x06 Fixed Data

Flash Erase (62500bps)

PGM to MCU 2nd byte 0x00 Fixed Data PGM to MCU 3rd byte 0x00 Fixed Data PGM to MCU 4th byte 0x06 Fixed Data PGM to MCU … Erasing… *1 … 5th byte 0x00 ACK MCU to PGM *1. Refer to chapter 7 for erase operation time. Notes:

� Leave enough delay to make sure that sending1byte UART data per1000us. Please refer the following sequence.

� The commands are used to disable MCU reset output.

0x00 160us

<<wait time>> 840us

0x00 160us

<<wait time>> 840us

0x0C 160us

<<wait time>> 840us

0x0C 160us

Page 15: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 15 of 30

4.7 Download Code to RAM

The following is command sequences to download the code in Table 4-1 to RAM of MCU: Communication byte number

Transmit/Receive Data

Description Communication direction

1st byte 0x00 Fixed Data

Parameter set (62500bps)

PGM to MCU 2nd byte 0x00 Fixed Data PGM to MCU 3rd byte 0x0C Fixed Data PGM to MCU 4th byte 0x0C Checksum PGM to MCU 5th byte 0x00 ACK MCU to PGM 1st byte 0x05 Fixed Data

Parameter set (62500bps)

PGM to MCU 2nd byte 0x00 Fixed Data PGM to MCU 3rd byte 0x60 Fixed Data PGM to MCU 4th byte 0x65 Checksum PGM to MCU 5th byte 0x00 ACK MCU to PGM 1st byte 0x00 Fixed Data

Parameter set (62500bps)

PGM to MCU 2nd byte 0x00 Fixed Data PGM to MCU 3rd byte 0x90 Fixed Data PGM to MCU 4th byte 0x90 Checksum PGM to MCU 5th byte 0x00 ACK MCU to PGM 6th byte 0x03 Fixed Data

Write memory (62500bps)

PGM to MCU 7th byte 0x00 Fixed Data PGM to MCU 8th byte 1st data in Table 1 Data PGM to MCU 9th byte 6th+7th+8th Checksum PGM to MCU 10th byte 0x00 ACK MCU to PGM 11th byte 0x03 Fixed Data

Write memory (62500bps)

PGM to MCU 12th byte 0x00 Fixed Data PGM to MCU 13th byte 2nd data in Table 1 Data PGM to MCU 14th byte 11th+12th+13th Checksum PGM to MCU 15th byte 0x00 ACK MCU to PGM Repeat 11th~15th

… Send all data in Table 1…

… Write memory (62500bps)

N-19 byte 0x00 Fixed Data

Parameter set (62500bps)

PGM to MCU N-18 byte 0x00 Fixed Data PGM to MCU N-17 byte 0x00 Fixed Data PGM to MCU N-16 byte 0x00 Checksum PGM to MCU N-15 byte 0x00 ACK MCU to PGM N-14 byte 0x05 Fixed Data

Parameter set (62500bps)

PGM to MCU N-13 byte 0x00 Fixed Data PGM to MCU N-12 byte 0x00 Fixed Data PGM to MCU N-11 byte 0x05 Checksum PGM to MCU N-10 byte 0x00 ACK MCU to PGM N-9 byte 0x05 Fixed Data

Parameter set (62500bps)

PGM to MCU N-8 byte 0x00 Fixed Data PGM to MCU N-7 byte 0x90 Fixed Data PGM to MCU N-6 byte 0x95 Checksum PGM to MCU N-5 byte 0x00 ACK MCU to PGM

Page 16: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 16 of 30

N-4 byte 0x09 Fixed Data GO (62500bps)

PGM to MCU N-3 byte 0x00 Fixed Data PGM to MCU N-2 byte 0x00 Fixed Data PGM to MCU N-1 byte 0x09 Checksum PGM to MCU N byte 0x00 ACK MCU to PGM

Page 17: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 17 of 30

Table 4-1: Data of Code downloaded to RAM of Target MCU

XX: could be 0x00 to 0x03 The less the XX, the more the power consumption, the faster the execute speed.

00 00 00 00 E4 05 00 E1 85 07 XX 85 00 FF AB 22 85 23 08 04 FF 61 0F C3 60 0F C5 74 80 61 0F C5 85 73 3F 85 01 00 E4 01 2C D0 FC FD 31 02 89 31 01 88 A3 22 60 00 00 45 93 AB 22 31 01 BA F3 10 04 00 10 81 22 81 25 93 05 90 81 22 05 91 81 22 85 01 FF 31 01 A6 A3 22 61 00 00 AB 22 95 93 55 FD 67 95 93 18 FD 74 95 93 81 FD 06 21 00 B3 21 00 FF 31 02 4B 85 01 00 F3 40 31 01 97 A3 22 60 00 00 45 92 E6 00 92 C5 90 E3 C0 D5 90 E4 FF BD 13 FC 03 21 01 19 43 E4 FF BE 13 FC 03 21 01 19 43 E4 FF BF 13 FC 03 21 01 19 43 E4 FF C0 13 FD D8 31 02 67 FC B9 AB 22 00 00 00 00 00 00 50 D0 FC 03 21 00 B3 E3 21 01 08 31 01 97 A3 22 31 01 E8 FC FB AB 22 31 02 20 21 00 B3 31 01 A6 A3 22 C5 90 92 61 00 00 C5 90 C0 D5 90 AB 22 D3 F3 E4 00 00 13 FC E6 21 00 B3 B9 22 FD 40 E4 00 0A 31 01 B5 50 B9 22 F2 20 BA 22 FD 40 E4 00 0A 31 01 B5 50 BA 22 F2 20 B8 22 FD 40 E4 00 0A 31 01 B5 50 B8 22 F2 20 D0 00 FC FC 20 31 01 88 A3 22 60 00 00 10 AB 22 31 01 88 A3 22 60 00 00 D5 90 AB 22 31 01 88 A3 22 60 00 00 10 AB 22 31 01 88 A3 22 60 00 00 E3 AB 22 20 E4 CA AA E3 E4 C5 54 E2 A9 72 87 AA 86 00 55 87 80 87 AA 86 00 55 87 10 00 00 BC 72 16 07 64 20 FD F8 BC 72 0E 00 BC 72 0A 04 F0 61 FF 00 04 01 A1 72 20 04 00 A1 72 20 31 02 4B E7 FF BC E6 0F E4 31 02 67 E7 FF BD E6 0F E5 31 02 67 E7 FF BE E6 0F EB 31 02 67 E7 FF BF E6 0F EC 31 02 67 31 02 89 20 40 F3 40 41 A9 72 E4 BA AA E2 E7 B5 54 86 00 AA 87 55 86 00 20 A1 72 51 50 E3 50 20 A9 72 87 A0 06 00 47 00 00 BC 72 11 07 64 20 FD F8 BC 72 09 00 BC 72 05 04 01 A1 72 20 04 00 A1 72 20 40 41 A9 72 E4 10 00 E2 86 00 90 86 00 00 A1 72 51 50 20

And then, Programmer can erase/write/read flash of Target MCU by sending command.

It means when the code runs in RAM of Target MCU, the preparative for the parallel programming is finished.

Page 18: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 18 of 30

5 Basic Operation of Target MCU

For realize function of parallel programming, 3 basic operations are must: erase/write/read flash of Target MCU. When the code runs in RAM of Target MCU, these 3 basic operations can be implement by receiving and implementing command from Programmer.

To control Target MCU to erase/write/read, the following command must be sent by parallel port, and no 1-line UART command can be sent again.

5.1 Command Sending Sequence To send command to Target MCU, special format of command must be adopted by Programmer, the special format is shown in figure 5-1.

D1(Byte) D2(Byte) D3(Byte) D4(Byte) D5(Byte)

Command AddressH AddressL LengthH LengthL

Figure 5-1: Format of Command send

And Checksum = D1+D2+D3+D4+D5, which is used to check if command is received by Target MCU correctly, for how to use checksum, refer to 5.3 Erase Flash, 5.4 Write Flash, 5.5 Read Flash.

Dn: D1, D2, D3, D4 or D5

For Erase Command (0x55), D1 = 0x55

For Read Command (0x18), D1 = 0x18

For Write Command (0x81), D1 = 0x81.

To send one byte to Target MCU, must set PORT output, the timing of Erase Command send is shown in figure 5-2.

Figure 5-2: Timing of Erase Command send

Page 19: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 19 of 30

The timing of Read Command send is shown in figure 5-3.

Figure 5-3: Timing of Read Command send The timing of Write Command send is shown in figure 5-4.

Figure 5-4: Timing of Write Command send

Page 20: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 20 of 30

5.2 Data Send or Receive Sequence Here shows Programmer how to send/receive Data to/from Target MCU.

To send one byte data to Target MCU, Programmer must set PORT output, the timing is shown in figure 5-5.

Figure 5-5: Timing of send data To receive one byte data from Target MCU, Programmer must set PORT input, the timing is shown in figure 5-6.

Figure 5-6: Timing of receive data

Page 21: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 21 of 30

5.3 Erase Flash Programmer sends Erase Flash command to Target MCU, and then Target MCU implement the command to Erase flash.

Figure 5-7 shows Programmer how to control Target MCU to Erase Flash.

Figure 5-7: Flow Chart of Erase Flash

Erase OK?

N

Erase Fail

N

Read Erase Status

N

End

Start

Send Erase Command

Check Sum OK?

Y

Time Out?

Y

Y

Page 22: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 22 of 30

5.4 Write Flash Programmer sends Write Flash command to Target MCU, and then Target MCU implement the command to Write flash.

Figure 5-8 shows Programmer how to control Target MCU to Write Flash.

Figure 5-8: Flow Chart of Write Flash

Write OK?

Write all Data?

N

End

Y

N

Send Write Data

N

N

Write Fail

Start

Send Write Command

Check Sum OK?

Y

Time Out?

Y

Y

Page 23: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 23 of 30

5.5 Read Flash Programmer sends Read Flash command to Target MCU, and then Target MCU implement the command to Read flash.

Figure 5-9 shows Programmer how to control Target MCU to Read Flash.

Figure 5-9: Flow Chart of Read Flash

Read OK?

Read all Data?

N

End

Y

N

Read Data

N

N

Read Fail

Start

Send Read Command

Check Sum OK?

Y

Time Out?

Y

Y

Page 24: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 24 of 30

6 Flash Security Operation

1.1. Flash Security introduction

Write protection code “01H” to flash memory address (FFFCH), the flash security goes into effect immediately. After write code “01H” to address “FFFCH”, the next write/read operation will be denied. For example:

If write “01H” to address “FFFCH”, then write data to address “FFFDH” will not be executed. And the following verification will fail.

1.2. Flash Security Setting Suggestion

To avoid flash security error during programming, the recommended flash security setting sequence is: Write program to flash and force the data in address “FFFCH” is “FFH”, then do verify operation, after verification accessed, write “01H” to “FFFCH”, end programming.

1.3. Programming Flash Security Enabled MCU

If the flash security has been enabled in MCU, after power on, only hand-shake command and erase command can be accessed. Send other commands will receive the wrong ACK “0xFD” (security error). So if received ACK “0xFD” during programming, it is recommended to inform user that flash security has been enabled or send the erase command.

Page 25: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 25 of 30

7 DC Characteristics

Page 26: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 26 of 30

Page 27: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 27 of 30

Page 28: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 28 of 30

8 Flash Memory Operation Characteristics

Page 29: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 29 of 30

9 Additional Information

For more Information on FUJITSU microelectronics products, visit the following web site:

http://www.fujitsu.com/cn/fmc/en/services/mcu

To download sample project about Programmer, visit the following web site:

http://www.fujitsu.com/cn/fmc/en/services/mcu

Page 30: 8FX-LPC MCU MB95F310/370 Series Flash Parallel ......2009-12-22 Jacky Zhou V1.3, Add erase command in UART PGM Add code table Add chapter6,7,8 2009-12-24 Levi Zhang V1.4 Update A/D

8FX-LPC MCU MB95F310/370 Series Flash Parallel Programmer Specification V1.8 30 of 30

10 Appendix

10.1 List of Figures and Tables Figure 2-1: Flow Chart of Program Target MCU ..................................................................... 4�

Figure 3-1: Connection between Programmer and Target MCU ........................................... 10�

Figure 5-1: Format of Command send ................................................................................. 18�

Figure 5-2: Timing of Erase Command send ........................................................................ 18�

Figure 5-3: Timing of Read Command send ......................................................................... 19�

Figure 5-4: Timing of Write Command send ......................................................................... 19�

Figure 5-5: Timing of send data ........................................................................................... 20�

Figure 5-6: Timing of receive data ........................................................................................ 20�

Figure 5-7: Flow Chart of Erase Flash .................................................................................. 21�

Figure 5-8: Flow Chart of Write Flash ................................................................................... 22�

Figure 5-9: Flow Chart of Read Flash .................................................................................. 23�

Table 2-1: Performance of Parallel Programming ................................................................... 4�

Table 3-1: Pin assignment of Target MCU ........................................................................... 10�

Table 4-1: Data of Code downloaded to RAM of Target MCU .............................................. 17�