Global Sources
EE Times-India
Stay in touch with EE Times India
 
EE Times-India > Memory/Storage
 
 
Memory/Storage  

M16C Family, M16C/62A, /62N, and /62P Boot Program Comparison for flash memory version

Posted: 03 Oct 2003     Print Version  Bookmark and Share

Keywords:Embedded 

PDF document

APPLICATION NOTE

M16C Family

M16C/62A, /62N, and /62P Boot Program Comparison for flash memory version

REJ05B0148-0110Z

Rev.1.10

Jul 25, 2003

Rev.1.10 Jul 25, 2003 page 1 of 5

1. Abstract

This issue is the reference matelials ot make the boot program of M16C/62N or M16C/62P from the

boot program of M16C/62A.

2. Introduction

The explanation of this issue is applied to the following condition:

Applicable MCU: M16C/62N Group, M16C/62P Group

3. Contents

3.1 Software Commands Comparison

The list of the software commnad of M16C/62A is shown in the table 3.1.3 form the table 3.1.1.

Table 3.1.1. List of M16C/62A Group software commands(Note1)

Command

Page program

Clear status register

Read array

Read status register

X

X

X

X(Note 3)

First bus cycle Second bus cycle Third bus cycle

FF16

7016

5016

4116

Write

Write

Write

Write

X SRDRead

Write

Lock bit program X 7716Write BA D016Write

Erase all unlock block X A716Write X D016Write

WA1 WD1Write

(Note 2)

WA0(Note 3) WD0 (Note 3)

Block erase X 2016Write D016Write BA (Note 4)

Read lock bit status X 7116Write BA D6Read (Note 5)

Mode Address Mode Address Mode Address

Data

(D0 to D7)

Data

(D0 to D7)

Data

(D0 to D7)

(Note 6)

Note 1: When a software command is input, the high-order byte of data (D8 to D15) is ignored.

Note 2: SRD = Status Register Data

Note 3: WA = Write Address, WD = Write Data

WA and WD must be set sequentially from 0016 to FE16 (byte address; however, an even address). The page size is

256 bytes.

Note 4: BA = Block Address (Enter the maximum address of each block that is an even address.)

Note 5: D6 corresponds to the block lock status. Block not locked when D6 = 1, block locked when D6 = 0.

Note 6: X denotes a given address in the user ROM area (that is an even address).

M16C Family

M16C/62A, /62N, and /62P Boot Program Comparison for flash memory version

Rev.1.10 Jul 25, 2003 page 2 of 5

Table 3.1.2. List of M16C/62N Group software commands(Note1)

Table 3.1.3. List of M16C/62P Group software commands(Note1)

Command

Program

Clear status register

Read array

Read status register

(Note 3)

First bus cycle Second bus cycle

Lock bit program

Erase all unlock block

Block erase

Read lock bit status

Write

Write

Write

Write

Write

Write

Write

Write

Mode

Read

Write

Write

Write

Write

Read

Mode

X

BA

X

WA (Note 3)

BA (Note 4)

BA

Address

SRD

D016

D016

(Note 2)

WD (Note 3)

D016

D6 (Note 5)

Data

(D0 to D7)

FF16

7016

5016

4016

7716

A716

2016

7116

Data

(D0 to D7)

X

X

X

WA

BA

X

X

X

Address

Note 1: When a software command is input, the high-order byte of data (D8 to D15) is ignored.

Note 2: SRD = Status Register Data (Set an address to even address in the user ROM area)

Note 3: WA = Write Address (even address), WD = Write Data (16-bit data)

Note 4: BA = Block Address (Enter the maximum address of each block that is an even address.)

Note 5: D6 corresponds to the block lock status. Block not locked when D6 = 1, block locked when D6 = 0.

Note 6: X denotes a given address in the user ROM area (that is an even address)

: That command sequence is different form M16C/62A.

Command

Program

Clear status register

Read array

Read status register

(Note 3)

First bus cycle Second bus cycle

Lock bit program

Erase all unlock block

Block erase

Read lock bit status

Write

Write

Write

Write

Write

Write

Write

Write

Mode

Read

Write

Write

Write

Write

Mode

X

BA

X

WA (Note 3)

BA (Note 4)

BA

Address

SRD

D016

D016

(Note 2)

WD (Note 3)

D016

D16 (Note 5)

Data

(D0 to D7)

FF16

7016

5016

4016

7716

A716

2016

7116

Data

(D0 to D7)

X

X

X

WA

BA

X

X

X

Address

Note 1: When a software command is input, the high-order byte of data (D8 to D15) is ignored.

Note 2: SRD = Status Register Data (Set an address to even address in the user ROM area)

Note 3: WA = Write Address (even address), WD = Write Data (16-bit data)

Note 4: BA = Block Address (Enter the maximum address of each block that is an even address.)

Note 5: Please note that the second bus cycle is deferent from that of conventional M16C/62 group

microcomputers. Read the bit6 of the flash memory control register 1 (FMR16) for lock bit status.

"0" : lock, "1" : unlock .

Note 6: X denotes a given address in the user ROM area (that is an even address).

: That command sequence is different form M16C/62A.

Write

M16C Family

M16C/62A, /62N, and /62P Boot Program Comparison for flash memory version

Rev.1.10 Jul 25, 2003 page 3 of 5

3.2 Program Comparison

A difference in the program is shown about the command which is different from M16C/62A in the list

of the software command in the table 3.2.3 from the table 3.2.1.

Table 3.2.1. Program Command

Program:

mov.w #0,r3 ; receive number

mov.b #0,addr_l ; addr_l = 0

mov.w sum,crcd ; for Read check command

Program_loop_1:

add.w #1,r3 ; r3 +1 increment

mov.w r3,a0 ; r3 --> a0

mov.b data[a0],r0l

mov.b r0l,addr_l[a0] ; Store address

cmp.w #259,r3 ; r3 = 259 ?

jltu Program_loop_1 ; jump Program_loop_1 at r3<258

;

mov.w #00ffh,r2 ; Read array command

jsr Command_write ; command_write

mov.w #0070h,r2 ; Read SRD command

jsr Command_write ; Command write

lde.w [a1a0],r1 ; SRD read

mov.w #00ffh,r2 ; Read array command

jsr Command_write ; command_write

cmp.b #80h,r1l ; error check

jne Program_end

;

mov.w #0,r3 ; writing number (r3=0)

mov.b addr_h,a1 ; addr_h --> a1

Program_loop_2:

mov.w #0040h,r2 ; Page program command

jsr Command_write ; command_write

mov.w r3,a0 ; r3 --> a0

mov.w data[a0],r1 ; data --> r1

mov.w addr_l,a0 ; addr_l,m --> a0

ste.w r1,[a1a0] ; data write

;

mov.b r1l,crcin ; for Read check command

mov.b r1h,crcin

;

add.w #2,addr_l ; address +2 increment

add.w #2,r3 ; writing number +2 increment

cmp.w #255,r3 ; r3 = 255 ?

jltu Program_loop_2 ; jump Program_loop_2 at r3<255

Program_end:

mov.w crcd,sum ; for Read check command

bclr send_flg

mov.w #0,send_cnt

mov.w #0,start_cnt

jmp Flash_func_end ; jump Flash_func_end

Program:

mov.w #0,r3 ; receive number

mov.b #0,addr_l ; addr_l = 0

mov.w sum,crcd ; for Read check command

Program_loop_1:

add.w #1,r3 ; r3 +1 increment

mov.w r3,a0 ; r3 --> a0

mov.b data[a0],r0l

mov.b r0l,addr_l[a0] ; Store address

cmp.w #259,r3 ; r3 = 259 ?

jltu Program_loop_1 ; jump Program_loop_1 at r3<258

;

mov.w #00ffh,r2 ; Read array command

jsr Command_write ; command_write

mov.w #0070h,r2 ; Read SRD command

jsr Command_write ; Command write

lde.w [a1a0],r1 ; SRD read

mov.w #00ffh,r2 ; Read array command

jsr Command_write ; command_write

cmp.b #80h,r1l ; error check

jne Program_end

;

mov.w #0041h,r2 ; Page program command

jsr Command_write ; command_write

mov.w #0,r3 ; writing number (r3=0)

mov.b addr_h,a1 ; addr_h --> a1

Program_loop_2:

mov.w r3,a0 ; r3 --> a0

mov.w data[a0],r1 ; data --> r1

mov.w addr_l,a0 ; addr_l,m --> a0

ste.w r1,[a1a0] ; data write

;

mov.b r1l,crcin ; for Read check command

mov.b r1h,crcin

;

add.w #2,addr_l ; address +2 increment

add.w #2,r3 ; writing number +2 increment

cmp.w #255,r3 ; r3 = 255 ?

jltu Program_loop_2 ; jump Program_loop_2 at r3<255

Program_end:

mov.w crcd,sum ; for Read check command

bclr send_flg

mov.w #0,send_cnt

mov.w #0,start_cnt

jmp Flash_func_end ; jump Flash_func_end

M16C/62A Page Program M16C/62N,/62P Program

M16C Family

M16C/62A, /62N, and /62P Boot Program Comparison for flash memory version

Rev.1.10 Jul 25, 2003 page 4 of 5

Table 3.2.2. Lock Bit Program Command

Table 3.2.3. Lead Lock Bit Status Command

M16C/62A,/62N Read LB Status M16C/62P Read LB Status

Read_LB:

mov.w #1,r3 ; receive number (r3=1)

mov.b #0feh,addr_l ; addr_l = ffh

Read_LB_loop:

mov.w r3,a0 ; r3 --> a0

mov.b data[a0],r0l

mov.b r0l,addr_l[a0] ; Store address

add.w #1,r3 ; r3 +1 increment

cmp.w #3,r3 ; r3=3 ?

jltu Read_LB_loop ; jump Read_LB_loop at r3<3

mov.w #0071h,r2 ; Read LB command

jsr Command_write ; command write

lde.w [a1a0],r1 ; read LB

mov.w #00ffh,r2 ; Read array command

jsr Command_write ; command write

Read_LB_end:

mov.w #1,start_cnt

mov.w #1,send_cnt

bset send_flg

jmp Flash_func_end ; jump Flash_func_end

Read_LB:

mov.w #1,r3 ; receive number (r3=1)

mov.b #0feh,addr_l ; addr_l = ffh

Read_LB_loop:

mov.w r3,a0 ; r3 --> a0

mov.b data[a0],r0l

mov.b r0l,addr_l[a0] ; Store address

add.w #1,r3 ; r3 +1 increment

cmp.w #3,r3 ; r3=3 ?

jltu Read_LB_loop ; jump Read_LB_loop at r3<3

mov.w #0071h,r2 ; Read LB command

jsr Command_write ; command write

mov.w #00d0h,r2 ;

ste.w r2,[a1a0] ;

mov.b 1B5h,r1l ; FMR1(LB read)

and.b #01000000b,r1l ;

mov.w #00ffh,r2 ; Read array command

jsr Command_write ; command write

Read_LB_end:

mov.w #1,start_cnt

mov.w #1,send_cnt

bset send_flg

jmp Flash_func_end ; jump Flash_func_end

(A program is a common program, bacause an address in the first bus cycle is same as

an address to program by the second bus cycle.)

M16C/62A, /62N, /62P LB Program

Program_LB:

mov.w #1,r3 ; receive number (r3=1)

mov.b #0feh,addr_l ; addr_l = ffh

Program_LB_loop:

mov.w r3,a0 ; r3 --> a0

mov.b data[a0],r0l

mov.b r0l,addr_l[a0] ; Store address

add.w #1,r3 ; r3 +1 increment

cmp.w #4,r3 ; r3=4 ?

jltu Program_LB_loop ; jump Program_LB_loop at r3<4

cmp.b #0d0h,data ; Confirm command check

jne Program_LB_end ; jump Program_LB_end at Confirm

command error

mov.w #0077h,r2 ; Program LB command

jsr Command_write ; command write

mov.w #00d0h,r2 ; Confirm command

ste.w r2,[a1a0] ; command write

mov.w #00ffh,r2 ; Read array command

jsr Command_write ; command write

Program_LB_end:

mov.w #0,start_cnt

mov.w #0,send_cnt

bclr send_flg

jmp Flash_func_end ; jump Flash_func_end

M16C Family

M16C/62A, /62N, and /62P Boot Program Comparison for flash memory version

Rev.1.10 Jul 25, 2003 page 5 of 5

4. Reference

Renesas Technology Corporation Semiconductor Home page

http://www.renesas.com/

E-mail Support

E-mail: support_apl@renesas.com

M16C/62A group data sheet Rev.B1

M16C/62N group data sheet Rev.1.1

M16C/62P group hardware manual Rev.1.11

(Use the latest version on the Home page: http://www.renesas.com/)

M16C/62A, /62N, and /62P Boot Program Comparison

for flash memory version Application Note

Rev. Date Description

Page Summary

REVISION HISTORY

1.10 Jul 25, 2003 - First edition issued

Keep safety first in your circuit designs!

Notes regarding these materials

q Renesas Technology Corporation puts the maximum effort into making semiconduc-

tor products better and more reliable, but there is always the possibility that trouble

may occur with them. Trouble with semiconductors may lead to personal injury, fire

or property damage. Remember to give due consideration to safety when making

your circuit designs, with appropriate measures such as (i) placement of substitutive,

auxiliary circuits, (ii) use of nonflammable material or (iii) prevention against any

malfunction or mishap.

q These materials are intended as a reference to assist our customers in the selection

of the Renesas Technology Corporation product best suited to the customer's appli-

cation; they do not convey any license under any intellectual property rights, or any

other rights, belonging to Renesas Technology Corporation or a third party.

q Renesas Technology Corporation assumes no responsibility for any damage,

or infringement of any third-party's rights, originating in the use of any product

data, diagrams, charts, programs, algorithms, or circuit application examples

contained in these materials.

q All information contained in these materials, including product data, diagrams,

charts, programs and algorithms represents information on products at the

time of publication of these materials, and are subject to change by Renesas

Technology Corporation without notice due to product improvements or other

reasons. It is therefore recommended that customers contact Renesas Technology

Corporation or an authorized Renesas Technology Corporation product distributor

for the latest product information before purchasing a product listed herein.

The information described here may contain technical inaccuracies or

typographical errors.

Renesas Technology Corporation assumes no responsibility for any damage,

liability, or other loss rising from these inaccuracies or errors.

Please also pay attention to information published by Renesas Technology

Corporation by various means, including the Renesas Technology Corporation

Semiconductor home page (http://www.renesas.com).

q When using any or all of the information contained in these materials, including

product data, diagrams, charts, programs, and algorithms, please be sure to

evaluate all information as a total system before making a final decision on the

applicability of the information and products. Renesas Technology Corporation

assumes no responsibility for any damage, liability or other loss resulting from

the information contained herein.

q Renesas Technology Corporation semiconductors are not designed or

manufactured for use in a device or system that is used under circumstances

in which human life is potentially at stake. Please contact Renesas Technology

Corporation or an authorized Renesas Technology Corporation product distributor

when considering the use of a product contained herein for any specific purposes,

such as apparatus or systems for transportation, vehicular, medical, aerospace,

nuclear, or undersea repeater use.

q The prior written approval of Renesas Technology Corporation is necessary to

reprint or reproduce in whole or in part these materials.

q If these products or technologies are subject to the Japanese export control

restrictions, they must be exported under a license from the Japanese government

and cannot be imported into a country other than the approved destination.

Any diversion or reexport contrary to the export control laws and regulations

of Japan and/or the country of destination is prohibited.

q Please contact Renesas Technology Corporation for further details on these

materials or the products contained therein.





Comment on "M16C Family, M16C/62A, /62N, and /62..."
Comments:  
*  You can enter [0] more charecters.
*Verify code:
 
 
Webinars

Seminars

Visit Asia Webinars to learn about the latest in technology and get practical design tips.

 

Go to top             Connect on Facebook      Follow us on Twitter      Follow us on Orkut

 
Back to Top