SyncMOS Technologies International MSM9066 User manual

SyncMOS MSM9066
User’s Manual
Specifications subject to change without notice, contact your sales representatives for the most recent information.
1
SyncMOS MSM9066 User’s Manual
Supported devices: SM59XX series, SM59RXX series, SM39RXX series
Table of contents
1 Introduction...................................................................................................................................2
2 Top View of MSM9066..................................................................................................................2
3 ISP Introduction ............................................................................................................................3
4 Configuration for ISP.....................................................................................................................4
5 ISP Entry Mechanism ...................................................................................................................6
6 ICP Introduction............................................................................................................................9
7 Comparison of ISP and ICP........................................................................................................10
8 Settings of SMAP........................................................................................................................ 11
9 User Interface of SMAP..............................................................................................................15
10 ISP Tutorial .................................................................................................................................18
11 ICP Tutorial.................................................................................................................................28
12 Off-line Mode Tutorial..................................................................................................................29

SyncMOS MSM9066
User’s Manual
Specifications subject to change without notice, contact your sales representatives for the most recent information.
2
1 Introduction
1.1 MSM9066 supports ICP and allows users to easily program a code into SM39RXX Series and
SM59RXX Series without having to program the ISP Service CODE into Target IC. The product
also supports SM59XX Series, SM39RXX Series and SM59RXX Series ISP.
1.2 Supportable interfaces: USB.
2 Top View of MSM9066
[ISP]
VCC
GND
N/A
RxD
TxD
Button
[ICP]
VCC
GND
N/A
CLK
DATA
Power
(Red LED)
Busy
(Yellow LED)
Good
(Green LED)
Fail
(Red LED)
Supply Power
(Blue LED)

SyncMOS MSM9066
User’s Manual
Specifications subject to change without notice, contact your sales representatives for the most recent information.
3
3 ISP Introduction
ISP (In-system programming) is a function that allows user to directly update MCU code on system
board. For example, With ISP firmware code residing in MCU, user can select RS-232 or USB to
execute functions of erase and program for MCU. Before user uses ISP, it is essential to program an
appropriate ISP firmware code to MCU with writer first.
ISP system diagram
SyncMOS provides application program and ISP source code for customer. ICs have included ISP
code before shipping, exclusive of SM39R02/04G1. For SM39R02/04G1 ISP requirement, please
contact SycMOS or agent.
Windows
application
program
User’s code
{……
If(…)
ISP();
…..}
ISP code
USB Port
UART
MSM9066

SyncMOS MSM9066
User’s Manual
Specifications subject to change without notice, contact your sales representatives for the most recent information.
4
4 Configuration for ISP
If IC has been erased by universal programmer, please re-programming ISP code with universal
programmer. The user should configure the MCU by the below steps:
4.1 SM59XX series: Set N=1 with universal programmer.
4.2 SM59RXX and SM39RXX: Set N=2 with universal programmer.

SyncMOS MSM9066
User’s Manual
Specifications subject to change without notice, contact your sales representatives for the most recent information.
5
4.3 Load ISP bin file according to your IC model, then execute programming action. ISP codes
attach in SMAP setup directory “C:\Program Files\SyncMOS\ SMAP\ISP”.

SyncMOS MSM9066
User’s Manual
Specifications subject to change without notice, contact your sales representatives for the most recent information.
6
5 ISP Entry Mechanism
5.1 Hardware ISP: Using IC’s internal hardware mechanism to enter the ISP code area.
IC model
First address
$0000=FFH
P2.6/P2.7 = 0
P4.3 = 0
Rx inputs 2 clocks
Standard package
SM5964
Yes
No
No
No
SM5964A
Yes
Yes
Yes
No
SM59R02/03/04A1
Yes
Yes
Yes
Yes
SM59R04A2
Yes
Yes
Yes
Yes
SM59R05/09/16A3
Yes
Yes
Yes
Yes
SM59R05/09/16A5
Yes
Yes
Yes
Yes
SM59R05/09/16G6
Yes
Yes
Yes
Yes
SM59R01/02G1
Yes
Yes
Yes
Yes
Low pin count package
SM39R20/4051
Yes
No
P1.5 = 0
Yes
SM39R02/04G1
Yes
No
P1.5 = 0
Yes
SM39R08/12/16A2
Yes
Yes
P1.6 = 0
Yes
5.1.1“First address $0000=FFH”: Reset with first flash address blank ($0000=#FFH) will load the
PC counter with start address of ISP code area.
5.1.2“P2.6/P2.7 = 0”: User can force IC enter ISP code area by setting P2.6, P2.7 “active low”
during reset period.
5.1.3“P4.3 = 0”: User can force IC enter ISP code area by setting P4.3 “active low” during reset
period. The DIP package has no port 4, so QFP package and PLCC package support this
function.
5.1.4“Rx inputs 2 clocks”: Rx will be detected the two clock signals during hardware reset period.
5.2 Software ISP: Execute jump instruction can load the start address of the ISP code area to PC
counter. For example, insert Gotoisp.a51 in the project of Keil C, as shown in picture:

SyncMOS MSM9066
User’s Manual
Specifications subject to change without notice, contact your sales representatives for the most recent information.
7
Gotoisp.a51:
; GOTOISP.A51
NAME GOTOISP
?PR?GotoIsp?GOTOISP SEGMENT CODE
PUBLIC GotoIsp
RSEG ?PR?GotoIsp?GOTOISP
USING 0
GotoIsp:
LJMP 03E00H ;isp start address
END
User’s program:
#include <….h>
…
extern void GoToIsp(void);
…
void main(void)
{
if(P4.3 = = 0)
{
GoToIsp();
}
…
…
}
Note:
※Please modify LJMP ISP start address according to IC model.

SyncMOS MSM9066
User’s Manual
Specifications subject to change without notice, contact your sales representatives for the most recent information.
8
※SM59XX Series Series using Timer1 as baud rate generator in ISP service code. If using Timer2
as baud rate generator, please write T2CON = 0x00 before jumping ISP to avoid occupying
UART port.

SyncMOS MSM9066
User’s Manual
Specifications subject to change without notice, contact your sales representatives for the most recent information.
9
6 ICP Introduction
ICP(In Circuit Programming) is a method of directly programming. ISP must have ISP boot code in
the IC, but ICP don’t need ISP boot code because built-in the hardware structure of IC.
ICP system diagram
Windows
application
program
SMAP
USB Port
MSM9066
ICP Interface

SyncMOS MSM9066
User’s Manual
Specifications subject to change without notice, contact your sales representatives for the most recent information.
10
7 Comparison of ISP and ICP
Items ISP ICP(2-Wires interface)
Supported IC
SM5964
SM5964A
SM59R02/03/04A1
SM59R04A2
SM59R05/09/16A3
SM59R05/09/16A5
SM59R05/09/16G6
SM59R01/02G1
SM39R20/4051
SM39R02/04G1
SM39R08/12/16A2
SM59R02/03/04A1
SM59R04A2
SM59R05/09/16A3
SM59R05/09/16A5
SM59R05/09/16G6
SM39R20/4051
SM39R02/04G1
SM39R08/12/16A2
Update IC
configuration
Only SM59RXX supported Yes
IC protect Yes Yes
Interface GND,RX,TX,VCC VCC,GND,OCI_SCL,OCI_SDA
Note 1. Needed 0.5k ISP code. N/A
Advantages User can use RS-232 or USB
to execute functions of erase
and program for MCU.
Not needed ISP code

SyncMOS MSM9066
User’s Manual
Specifications subject to change without notice, contact your sales representatives for the most recent information.
11
8 Settings of SMAP
8.1 To select writer:
8.1.1There is SMAP shortcut on desktop after installing SMAP.
8.1.2When first open SMAP, you can select MSM9059, MSM9066 or MSM9171. Please select
MSM9066 then click <OK>.
8.1.3SMAP will pop up main window. You can change writer, language or update firmware in the
setting window.

SyncMOS MSM9066
User’s Manual
Specifications subject to change without notice, contact your sales representatives for the most recent information.
12
8.2 Automatic update for firmware:
8.2.1 If your firmware of MSM9066 is not fit the version of SMAP, SMAP will pop up updating
firmware window. Please follow flow chart to update your firmware.
8.2.2 Select FW-9059VXXX.hex then click <Open>.

SyncMOS MSM9066
User’s Manual
Specifications subject to change without notice, contact your sales representatives for the most recent information.
13
8.2.3 SMAP shows “Clear offline data succeeded!” means finished firmware update.

SyncMOS MSM9066
User’s Manual
Specifications subject to change without notice, contact your sales representatives for the most recent information.
14
8.3 Manual update for firmware:
8.3.1 If automatic update failed, you must use manual update. You must push down the button
and plug MSM9066 into a USB port at the same time. Then click <Update> button.
8.3.2 Select FW-9059VXXX.hex then click <Open>.

SyncMOS MSM9066
User’s Manual
Specifications subject to change without notice, contact your sales representatives for the most recent information.
15
9 User Interface of SMAP
9.1 Operation modes:
9.1.1 On-line ISP: MSM9066 must connect to PC and program by UART. Please set frequency
according to the target frequency.
9.1.2 Off-line ISP:You can send code to MSM9066 before programming. MSM9066 doesn’t
connect to PC during ISP programming.
9.1.3 On-line ICP: MSM9066 must connect to PC and program by IIC.
9.1.4 Off-line ICP: You can send code to MSM9066 before programming. MSM9066 doesn’t
connect to PC during ICP programming.
9.2 Selecting program files:
9.2.1 Click <Select> then SMAP will pop up “Select Program File(s)” window. Click <Open> to
load your file. (XXX.HEX or XXX.BIN)

SyncMOS MSM9066
User’s Manual
Specifications subject to change without notice, contact your sales representatives for the most recent information.
16
9.2.2 When you need to load main code and ISP code together, you can load code and ISP
separately.
9.3 Configuration:
9.3.1 Configuration option: Please set needed option. MSM9066 will program configuration
during program process.

SyncMOS MSM9066
User’s Manual
Specifications subject to change without notice, contact your sales representatives for the most recent information.
17
9.3.2 Reading configuration: Click “Reading configuration” icon to read configuration.
9.4 Buffer:
9.4.1 File Content: Click to open file buffer.
9.4.2 MCU Content: Click to open MCU buffer.
9.4.3 Save: The code will be saved as bin file.
9.4.4 Refresh: The code of file will be displayed to file buffer.
9.4.5 Refresh: The code of MCU will be displayed to MCU buffer.
File buffer MCU buffer

SyncMOS MSM9066
User’s Manual
Specifications subject to change without notice, contact your sales representatives for the most recent information.
18
10 ISP Tutorial
10.1 Hardware connection modes:
10.1.1 Please set your frequency of the target board.
VCC
TX
GND
RX

SyncMOS MSM9066
User’s Manual
Specifications subject to change without notice, contact your sales representatives for the most recent information.
19
10.2 Manual recording:
10.2.1 Please let MCU enter ISP mode by hardware or software mechanism.
10.2.2 Set chip, frequency, comport, and select <Manual>.
10.2.3 Select hex file or bin file and tick wanted functions of the recording block, then click
<Autorun>. If you want single step operation, you merely click <Scan>, <Chip Erase>,
<Program>, <Protect>, <MCU Reset>.
10.3 Power-on recording:
(1) User can easily program IC through SMAP software, as long as power on user’s target
board. SM59RXX and SM39RXX series have the ISP entry mechanism of Rx inputting 2
clocks, exclusive of SM59R08/16A2. Other models need software method to detect Rx. If it
receive 5 commands of 0x69, PC counter will jump to address of ISP code area.
(2) Press “Autorun” then SMAP will display “Detecting… …(0%)”. Please reset MCU or power
on your target board, SMAP will start programming.

SyncMOS MSM9066
User’s Manual
Specifications subject to change without notice, contact your sales representatives for the most recent information.
20
(3) When finish programming, SMAP shows “MCU Reset Succeeded!”.
10.4 User-defined recording: User can define command as entry ISP password through SMAP
software to run programming.
10.4.1 Operating steps:
(1) Program sample code and ISP code into the IC.
(2) Power on your target board and connect to your MSM9066.
(3) Select “User-defined” and set baud rate speed according to customer’s transmission speed.
For example, we select 115200bps due to the sample code using 115200bps.
(4) Load sample code into SMAP. Key in your user-defined command into SMAP according to
your receive command of UART interrupt subroutine. User-defined command length range is
between 1~32 byte, and data type is hexadecimal.
Table of contents