SyncMOS MSM9059 User`s Manual
SyncMOS MSM9059
User’s Manual
SyncMOS MSM9059 User’s Manual
Supported devices: SM59XX series, SM59DXX series, SM59RXX series, SM39RXX series
Table of contents
1. Introduction .................................................................................................................................... 3
2. Top view of MSM9059 .................................................................................................................... 3
3. ISP Introduction.............................................................................................................................. 4
4. Configuration for ISP ...................................................................................................................... 5
5. ISP entry mechanism ..................................................................................................................... 7
5.1 Hardware ISP........................................................................................................................ 7
5.2 Software ISP ......................................................................................................................... 8
6. ICP introduction............................................................................................................................ 10
7. Comparison between ISP and ICP ...........................................................................................................11
8. Setup USB driver.......................................................................................................................... 12
9. SMAP settings.............................................................................................................................. 13
9.1 To select writer .................................................................................................................... 13
9.2 Automatic update for firmware............................................................................................. 14
9.3 Manual update for firmware ................................................................................................ 16
10. User interface of SMAP.............................................................................................................. 17
10.1 Operation modes............................................................................................................... 17
10.2 Connecting COM Port .......................................................................................................17
10.3 Selecting program files...................................................................................................... 17
10.4 Configuration..................................................................................................................... 18
10.4.1 Configuration option.................................................................................................. 18
10.4.2 Reading configuration ............................................................................................... 18
10.5 Buffer................................................................................................................................. 19
11. ISP tutorials ................................................................................................................................ 20
11.1 Hardware connection modes............................................................................................. 20
11.2 Manual recording............................................................................................................... 20
11.3 Power-on recording ........................................................................................................... 21
11.4 User-defined recording ...................................................................................................... 22
12. ICP tutorials................................................................................................................................ 29
13. Off-line tutorials .......................................................................................................................... 30
13.1 Off-line ICP........................................................................................................................ 30
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
1
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
13.2 Off-line ISP........................................................................................................................ 30
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
2
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
1 Introduction:
1.1 MSM9059 supports ICP and allows users to easily program a code into SM59DXX Series,
SM39RXX Series and SM59RXX Series without having to program the ISP Service CODE into
Target IC. The product also supports SM59XX Series, SM59DXX Series, SM39RXX Series and
SM59RXX Series ISP.
1.2 Supportable interfaces: USB.
2 Top view of MSM9059:
ISP Interface
VCC
GND
N/A
RxD
TxD
Button
USB Plug
ICP(2-Wires) ICP(3-Wires)
VCC
VCC
GND
GND
N/A(or RST) TRIG
OCI_SCL
CLK
OCI_SDA
DATA
POWER(Red LED)
GOOD(Green LED)
BUSY(Yellow LED)
FAIL(Red LED)
Note: MSM9059 can’t provide Vcc power to target board, but must connect to the target board’s VCC.
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
3
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
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.
COM Port
UART
UART
converter board
or
USB Port
USB
UART
converter board
Windows
application
program
User’s code
{……
If(…)
ISP();
…..}
ISP code
ISP system diagram
SyncMOS provides application program and ISP source code for customer. ICs have included ISP
code before shipping, exclusive of SM59R08/16A2 and SM39R02/04G1. For SM59R08/16A2 and
SM39R02/04G1 ISP requirement, please contact SycMOS or agent.
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
4
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
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 and SM59DXX series: Set N=1 with universal programmer.
4.2 SM59RXX (exclusive of SM59R08/16A2) and SM39RXX: Set N=2 with universal programmer.
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
5
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
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\SyncMOS Writers\SMAP\ISP”.
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
6
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
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
No
No
No
No
No
No
Yes
Yes
Yes
Yes
Yes
Standard package
SM5964
SM5964A
SM59128
SM592654
SM59D03/04G2
SM59R08/16A2
SM59R02/03/04A1
SM59R04A2
SM59R05/09/16A3
SM59R05/09/16A5
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
SM59R05/09/16G6
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.
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
7
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
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:
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();
}
…
…
}
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
8
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
Note:
※ Please modify LJMP ISP start address according to IC model.
※ SM59XX Series and SM59DXX 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.
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
9
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
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 Interface
MSM9059
USB Port
Windows
application
program
SMAP
ICP diagram
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
10
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
7
Comparison between ISP and ICP:
Items
ISP
ICP(3-Wires interface)
ICP(2-Wires interface)
SM5964
SM5964A
SM59128
SM592654
SM59R02/03/04A1
SM59D03/04G2
SM59R04A2
SM59R08/16A2
SM59D03G2
SM59R05/09/16A3
SM59R02/03/04A1
SM59D04G2
SM59R05/09/16A5
Supported IC
SM59R04A2
SM59R08A2
SM59R05/09/16G6
SM59R05/09/16A3
SM59R16A2
SM39R20/4051
SM59R05/09/16A5
SM39R02/04G1
SM59R05/09/16G6
SM39R08/12/16A2
SM59R01/02G1
SM39R20/4051
SM39R02/04G1
SM39R08/12/16A2
Update IC
Only SM59RXX supported,
Yes
Yes
configuration exclusive of SM59R08/16A2.
Only SM59R08/16A2 not
IC protect
Yes
Yes
supported.
Interface
GND,RX,TX,VCC
VCC,GND,TRIG,CLK,DATA VCC,GND,OCI_SCL,OCI_SDA
1. Needed 0.5k ISP code.
2. ICs have included ISP
code before shipping,
Note
N/A
N/A
exclusive of SM59R08/
16A2 and SM39R02/
04G1.
User can use RS-232 or USB
Advantages to execute functions of erase
Not needed ISP code
Not needed ISP code
and program for MCU.
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
11
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
8 Setup USB driver:
You can find PL-2303 USB Driver in start menu. Please click “PL-2303 Driver Installer” to install.
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
12
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
9 SMAP settings:
9.1 To select writer:
9.1.1 There is SMAP shortcut on desktop after installing SMAP.
9.1.2 When first open SMAP, you can select MSM9059 or MSM9171. Please select MSM9059
then click <OK>.
9.1.3 SMAP will pop up main window. You can change writer, language or update firmware in the
setting window.
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
13
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
9.2 Automatic update for firmware:
9.2.1 Enter [Recording Mode] then click <Connect>. If your firmware of MSM9059 is not fit
the version of SMAP, SMAP will pop up updating firmware window. Please follow flow
chart to update your firmware.
9.2.2 Select FW-9059VXXX.hex then click <Open>.
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
14
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
9.2.3 SMAP shows “Clear offline data succeeded!” means finished firmware update.
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
15
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
9.3 Manual update for firmware:
9.3.1 If automatic update failed, you must use manual update. You must push down the button
and plug MSM9059 into a USB port at the same time. Then click <Update> button.
9.3.2 Select FW-9059VXXX.hex then click <Open>.
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
16
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
10 User interface of SMAP:
10.1 Operation modes:
10.1.1 On-line ISP: MSM9059 must connect to PC and program by UART. Please set frequency
according to the target frequency.
10.1.2 Off-line ISP: You can send code to MSM9059 before programming. MSM9059 doesn’t
connect to PC during ISP programming.
10.1.3 On-line ICP: MSM9059 must connect to PC and program by IIC.
10.1.4 Off-line ICP: You can send code to MSM9059 before programming. MSM9059 doesn’t
connect to PC during ICP programming.
10.2 Connecting COM Port: Click <Connect> to link PC and MSM9059.
10.3 Selecting program files:
10.3.1 Click <Select> then SMAP will pop up “Select Program File(s)” window. Click <Open> to
load your file. (XXX.HEX or XXX.BIN)
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
17
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
10.3.2 When you need to load main code and ISP code together, you can load code and ISP
separately.
10.4 Configuration:
10.4.1 Configuration option: Please set needed option. MSM9059 will program configuration
during program process.
10.4.2 Reading configuration: Click “Reading configuration” icon to read configuration.
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
18
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
10.5 Buffer:
10.5.1
File Content: Click to open file buffer.
10.5.2
MCU Content: Click to open MCU buffer.
10.5.3
Save: The code will be saved as bin file.
10.5.4
Refresh: The code of file will be displayed to file buffer.
10.5.5
Refresh: The code of MCU will be displayed to MCU buffer.
File buffer
MCU buffer
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
19
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
11 ISP tutorials:
11.1 Hardware connection modes:
VCC
GND
Rx
Tx
11.1.1 Please set your frequency of the target board.
11.2 Manual recording:
11.2.1 Please let MCU enter ISP mode by hardware or software mechanism.
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
20
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
11.2.2 Set chip, frequency, comport, and select <Manual>.
11.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>.
11.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.
(3) When finish programming, SMAP shows “MCU Reset Succeeded!”.
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
21
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
11.4 User-defined recording: User can define command as entry ISP password through SMAP
software to run programming.
11.4.1 Operating steps:
(1) Program sample code and ISP code into the IC.
(2) Power on your target board and connect to your MSM9059.
(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.
(5) Press “Autorun” then SMAP will start programming. When finish programming, SMAP shows
“MCU Reset Succeeded!”.
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
22
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
11.4.2 Flowchart:
PC
MCU
SMAP
Initial UART
Run customer's main
code
NO
Send user-defined
command
Receive data
YES
Enter UART interrupt
NO
Check data = userdefined data
YES
NO
Check data number
= nCommandLength
YES
NO
Receive ACK
Send 0x5A
YES
Fail
Start ISP erase,
program, protect,
reset
LJMP ISP address
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
23
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
11.4.3 Sample code:
(1) Keil C:
Description
main.c (Main
program)
//This sample code included
main.c、GoToISP_Low.A51
#include "SM59D04G2.h"
#define nCommandLength 32
#define nAckCommand
0x5A
unsigned char Uart CmdCount;
unsigned char code CommandArray[nCommandLength]=
{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
0x17, 0x18, 0x19, 0x20, 0x21, 0x22, 0x23, 0x24,
0x25, 0x26, 0x27, 0x28, 0x29, 0x30, 0x31, 0x32};
extern GoToISP_Low();
void delayms(unsigned int mscnt)
{
unsigned int i;
while(mscnt--)
{
for(i= 0;i<250;i++);
}
}
void init_UART_timer1(unsigned char BR)
{
SCON = 0x50;
//SCON: serail mode 1, 8-bit UART, enable receive
TMOD = 0x22;
//TMOD: timer 1, mode 2, 8-bit reload
PCON = 0x80;
//SMOD = 1;
TH1 = BR;
//Baud:57600 fosc= 22.1184MHz
TR1 = 1 ;
//timer 1 run
EA = 1;
//all interrupt enable
ES = 1;
//UART enable
}
void init_UART_timer2(unsigned int T2value)
{
}
RCAP2L = (char)T2value;
RCAP2H = (char)(T2value>>8);
T2CON = 0x34;
SCON = 0x50;
EA = 1;
//all interrupt enable
ES = 1;
//UART enable
void main(void)
{
init_UART_timer2(0xFFFA);//choise Timer 1 or Timer 2 as baud rate generator
//init_UART_timer1(0xFF);
//SyncMOS_GoToISP via UART
//TH1 = 0xFF;
//12T, 3.579MHz(19200), 11.0592MHz(57600)
// 6T, 3.579MHz(38400), 11.0592MHz(115200)
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
24
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
//TH1 = 0xFE;
//TH1 = 0xFD;
//TH1 = 0xFC;
//TH1 = 0xFB;
//TH1 = 0xF7;
//TH1 = 0xF5;
//TH1 = 0xF3;
//
//
}
GoToISP_Low.
A51
while(1)
{
P0 = 0xF0;
P0 = 0x0F;
P2 = 0xF0;
P2 = 0x0F;
}
//12T, 14.31818MHz(38400), 22.1184MHz(57600), 14.7456MHz(38400)
// 6T,
22.1184MHz(115200)
//12T, 4MHz(7200), 8MHz(14400), 8.192MHz(14400), 16MHz(28800)
// 6T, 4MHz(14400),8MHz(28800), 8.192MHz(28800), 16MHz(57600)
//
// 6T, 14.31818MHz(38400), 14.7456MHz(38400)
//12T, 18.432MHz(19200)
// 6T, 18.432MHz(38400)
//12T, 24.576MHz(14400), 25MHz(14400)
// 6T, 24.576MHz(28800), 25MHz(28800)
//12T, 20MHz(9600)
// 6T, 20MHz(19200)
//12T, 6MHz(2400), 12MHz(4800), 24MHz(9600)
// 6T, 6MHz(4800), 12MHz(9600), 24MHz(19200)
delayms(300);
delayms(300);
delayms(300);
delayms(300);
void serial(void) interrupt 4
{
if(RI)
{
if(SBUF == CommandArray[UartCmdCount])
UartCmdCount++;
else
UartCmdCount=0;
RI = 0 ;
if(UartCmdCount==nCommandLength)
{
IE = 0x00; //disabling interrupt
SBUF = nAckCommand;
while(!TI);
TI = 0;
T2CON = 0x00; //disabling T2 because using T1 baud rate generator in ISP code
GoToISP_Low(); //LJMP 3E00H ISP code address
}
}
else
TI=0;
}
; GoToISP_Low.A51
NAME
GoToISP_Low
?PR?GoToISP_Low?GOTOISP_LOW SEGMENT CODE
PUBLIC GoToISP_Low
RSEG ?PR?GoT oISP_Low?GOTOISP_LOW
USING
0
GoToISP_Low:
MOV DPTR,#3E00H ;LJMP 3E00H ISP code address
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
25
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
PUSH DPL
PUSH DPH
RETI
END
(2) Assembly:
Description
Main program
nCommandLength EQU 32 ;setting command length by user
UARTCmdCount EQU 20H
T2CON EQ U 0C8H
RCAP2L EQU 0CAH
RCAP2H EQU 0CBH
ORG 0000H
AJMP
ISP_Entry
ORG 0023H
AJMP
UART_INTERRUPT
ISP_Entry:
ACALL
SyncMOS_GoToISP ;initial setting
;;;
;;; main code start
;;;
/* LED display demo */
MOV DPTR,#TABLE_01 ;DPTR point to data area
START:
MOV R0,#0
;
MOV R1,#8
;8 datas
LOOP:
MOV A,R0
;put R0 contect to A
MOVC
A,@A+DPTR ;use indirect address get data, and put into A
MOV P0,A
;put ACC to Port 0
MOV P1,A
;put ACC to Port 1
ACALL
DELAY100MS ;delay 0.1 second
INC R0
;R0 point to next data
DJNZ
R1,LOOP
;if R1 != 0 then jump to LOOP
SJMP
START
;if R1=0 then jump to START
;;; dealy subroutine
DELAY100MS:
MOV R5,#10
;Dealy 10x10ms=100ms
DELAY10MS:
MOV R6,#50
;delay time 10ms @ 11.0592MHz
DELAY01:
MOV R7,#99
DJNZ
R7,$
; Inner loop delay
DJNZ
R6,DELAY01
;
DJNZ
R5,DELAY10MS
RET
;;;
TABLE_01:
DB 11100111B
DB 11000011B
DB 10000001B
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
26
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
DB
DB
DB
DB
DB
00000000B
10000001B
11000011B
11100111B
11111111B
;;;
;;; main code End
;;;
;;;
;;; SyncMOS_GoToISP Subroutine
;;;
SyncMOS_GoToISP:
;;;======UART Timer1 setting=============
;MOV
TMOD,#00100001B
;Timer 1 is mode1 is mode 2, Timer 0 is mode 1
;;;
;MOV
TH1,#0FFH
;baud rate, 12T, 3.579MHz(19200), 11.0592MHz(57600)
;
6T , 3.579MHz(38400), 11.0592MHz(115200)
;MOV
TH1,#0FEH
;baud rate, 12T, 14.31818MHz(38400), 22.1184MHz(57600),
14.7456MHz(38400)
;
6T,
22.1184MHz(115200)
;MOV
TH1,#0FDH
;baud rate, 12T, 4MHz(7200), 8MHz(14400), 8.192MHz(14400),
16MHz(28800)
;
6T , 4MHz(14400),8MHz(28800), 8.192MHz(28800),
16MHz(57600)
;MOV
TH1,#0FCH
;baud rate,
;
6T , 14.31818MHz(38400), 14.7456MHz(38400)
;MOV
TH1,#0FBH
;baud rate, 12T, 18.432MHz(19200)
;
6T, 18.432MHz(38400)
;MOV
TH1,#0F7H
;baud rate, 12T, 24.576MHz(14400), 25MHz(14400)
;
6T , 24.576MHz(28800), 25MHz(28800)
;MOV
TH1,#0F5H
;baud rate, 12T, 20MHz(9600)
;
6T, 20MHz(19200)
;MOV
TH1,#0F3H
;baud rate, 12T, 6MHz(2400), 12MHz(4800), 24MHz(9600)
;
6T , 6MHz(4800), 12MHz(9600), 24MHz(19200)
;SETB
TR1
;enable Timer 1
;MOV
PCON,#10000000B ;set SMOD = 1
;;;======================================
;;;
;;;======UART Timer2 setting=============
;choise Timer 1 or Timer 2 as baud rate generator
MOV RCAP2H,#0FFH
MOV RCAP2L,#0FAH
MOV T2CON,#34H
;;;======================================
MOV SCON,#01010000B ;serial mode 1, REN=1, TI=0, RI=0
MOV IE,#90H ;enable UART interrupt
MOV UARTCmdCount,#00H
RET
UART_INTERRUPT:
JB RI,RX ; if RI=1 jump RX,else clear TI
CLR TI
RETI
RX:
CLR RI
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
27
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
PUSH ACC
PUSH DPL
PUSH DPH
MOV A,UARTCmdCount
MOV DPTR,#COMMAND_TABLE
MOVC A,@A+DPTR
CJNE A,SBUF,CLR_UARTCmdCount
INC UARTCmdCount
MOV A,UARTCmdCount
CJNE A,#nCommandLength,RETURN
CLR EA
MOV SBUF,#5AH ;transmit ack
MOV DPTR,#3E00H ;LJMP 3E00H ISP code address
PUSH DPL
PUSH DPH
JNB TI,$
CLR TI
MOV T2CON,#00H ;disabling T2 because using T1 baud rate generator in ISP code
RETI
CLR_UARTCmdCount:
MOV UARTCmdCount,#00H
RETURN:
POP DPH
POP DPL
POP ACC
RETI
COMMAND_TABLE:
DB 01H,02H,03H,04H,05H,06H,07H,08H ;to define command by user
DB 09H,10H,11H,12H,13H,14H,15H,16H
DB 17H,18H,19H,20H,21H,22H,23H,24H
DB 25H,26H,27H,28H,29H,30H,31H,32H
END
Note:
※ The sample codes attach in SMAP setup directory “C:\Program Files\SyncMOS\ SyncMOS
Writers\SMAP\OnlineUpdate\User-defined”.
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
28
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
12 ICP tutorials:
12.1 Please connect OCI_SCL, OCI_SDA, VCC, GND with MSM9059. Press “Autorun” then SMAP
will start ICP programming.
VCC
GND
OCI_SCL
OCI_SDA
12.2 If OCI_SCL、OCI_SDA as GPIO, that caused enter ICP mode failed. As long as enter ICP
mode during power-on.
(1) Please power off your target board.
(2) Press “Autorun” then SMAP will display “Detecting… …(0%)”. Please reset MCU or power on
your target board, SMAP will start programming.
(3) When finish programming, SMAP shows “MCU Reset Succeeded!”.
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
29
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
13 Off-line tutorials:
13.1 Off-line ICP:
13.1.1 Select the tasks you want to perform and click <Autorun> to allow the MSM9059 record
all of the source code into its flash. Then, the massage will pop up: Transmitting
succeeded!
13.1.2 Disconnect USB and press button to perform off-line recording. During the recording.
LED will flash yellow until the task is finished. When the LED turn green, the off-line
recording task is completed. If OCI_SCL、OCI_SDA as GPIO, as long as enter ICP mode
during power-on.
13.2 Off-line ISP:
13.2.1 Select the tasks you want to perform and click <Autorun> to allow the MSM9059 record
all of the source code into its flash. Then, the massage will pop up: Transmitting
succeeded!
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
30
Ver. A 2011/04
SyncMOS MSM9059
User’s Manual
13.2.2 Disconnect USB and press button to perform off-line recording. During the recording.
LED will flash yellow until the task is finished. When the LED turn green, the off-line
recording task is completed.
Specifications subject to change without notice, contact your sales representatives for the most recent information.
ISSFT-0041
31
Ver. A 2011/04
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement