This document describes the SyncMOS MSM9066, a device used for In-System Programming (ISP) and In-Circuit Programming (ICP) of microcontrollers (MCUs). The MSM9066 supports various SyncMOS SM59XX and SM39RXX series MCUs.
Function Description:
The SyncMOS MSM9066 serves as a programming tool for SyncMOS microcontrollers, facilitating both In-System Programming (ISP) and In-Circuit Programming (ICP). ISP allows users to directly update MCU code on a system board, while ICP is a method of directly programming the MCU without having to program the ISP Service Code into the target IC. The device connects to a PC via a USB port and communicates with the MCU through a UART or IIC interface.
For ISP, the MSM9066 uses a firmware code residing in the MCU. Users can select RS-232 or USB to execute functions of erase and program for the MCU. Before a user uses ISP, it is essential to program an appropriate ISP firmware code to the MCU with the writer first. The ISP process involves loading an ISP bin file according to the IC model, executing programming actions, and attaching ISP codes in the SMAP setup directory.
For ICP, the MSM9066 has a dedicated ICP boot code built into the hardware structure of the IC. This means that ICP does not require an ISP boot code. The ICP process involves connecting the OCI_SCL, OCI_SDA, VCC, and GND pins with the MSM9066 and pressing "Autorun" in the SMAP software to start ICP programming.
The device is managed through the SMAP software, which provides a user-friendly interface for selecting MCUs, configuring programming settings, and monitoring the programming process. SMAP allows users to select the target MCU model (e.g., MSM9059, MSM9066, MSM9171), choose between on-line ISP, off-line ISP, on-line ICP, and off-line ICP modes, and perform operations such as chip erase, program, verify, and protect.
Important Technical Specifications:
The MSM9066 supports a range of SyncMOS MCUs, including:
- SM5964, SM5964A
- SM59R02/03/04A1, SM59R04A2
- SM59R05/09/16A3, SM59R05/09/16A5
- SM59R05/09/16G6
- SM59R01/02G1
- SM39R20/4051, SM39R02/04G1, SM39R08/12/16A2
The device communicates with the PC via a USB port and with the target MCU via a UART or IIC interface.
For ISP, the hardware mechanism to enter the ISP code area varies by IC model:
- SM5964, SM5964A, SM59R02/03/04A1, SM59R04A2, SM59R05/09/16A3, SM59R05/09/16A5, SM59R05/09/16G6, SM59R01/02G1: First address $0000=FFH$. Reset with first flash address blank ($0000=FFH$) will load the PC counter with the start address of the ISP code area.
- SM39R20/4051, SM39R02/04G1, SM39R08/12/16A2: Low pin count package.
The programming interface for ISP uses P2.6/P2.7 = 0 for "active low" during reset period, and P4.3 = 0 for "active low" during reset period. The DIP package has no port 4, so QFP package and PLCC package support this function. Rx inputs 2 clocks are detected when the two clock signals during hardware reset period.
The MSM9066 supports various oscillator frequencies for the target board, ranging from 1.3824MHz to 24.576MHz. The SM59XX Series uses Timer1 as the baud rate generator in ISP service code. If using Timer2 as the baud rate generator, T2CON should be set to 0x00 before jumping to ISP to avoid occupying the UART port.
Usage Features:
The SyncMOS MSM9066 is designed for ease of use with the SMAP software.
- SMAP Software: The SMAP software provides a graphical user interface for managing programming tasks. It can be launched from a desktop shortcut.
- MCU Selection: Users can select the target MCU from a dropdown list within the SMAP software.
- Operation Modes: SMAP supports four operation modes:
- On-line ISP: Connects to PC and programs by UART. Requires setting the frequency according to the target frequency.
- Off-line ISP: Sends code to MSM9066 before programming. MSM9066 doesn't need to connect to PC during ISP programming.
- On-line ICP: Connects to PC and programs by IIC.
- Off-line ICP: Sends code to MSM9066 before programming. MSM9066 doesn't need to connect to PC during ICP programming.
- Program File Selection: Users can select program files (XXX.HEX or XXX.BIN) from their computer.
- Configuration: The software allows detailed configuration of programming parameters, including watch dog, system clock, pin function, reset time, ISP block, and ISP entry mechanism.
- Buffer Management: SMAP provides file and MCU buffers, allowing users to open, save, and refresh code files and MCU content.
- Automatic and Manual Updates: SMAP supports automatic firmware updates. If the firmware version of MSM9066 is not up to date, SMAP will prompt for an update. Manual updates are also possible by selecting the firmware file and clicking "Update."
- Power-on Recording: This feature allows the MSM9066 to operate as a power-on user's target board. SM59RXX and SM39RXX series have an ISP entry mechanism of Rx inputting 2 clocks, exclusive of SM59R08/16A2. Other models need a software method to detect Rx. If it receives 5 commands of 0x69, the PC counter will jump to the address of the ISP code area. Pressing "Autorun" will display "Detecting..." and then "Program."
- User-defined Recording: Users can define commands as entry ISP password through SMAP software to run programming. This involves programming sample code and ISP code into the IC, powering on the target board and connecting to the MSM9066, selecting a baud rate (e.g., 115200bps), loading sample code into SMAP, and keying in a user-defined command into SMAP according to the receive command of the UART interrupt subroutine. User-defined command length ranges between 1-32 bytes, and data type is hexadecimal.
Maintenance Features:
- Firmware Updates: The SMAP software facilitates firmware updates for the MSM9066, ensuring the device remains compatible with the latest MCUs and programming features. Both automatic and manual update options are available.
- Error Handling: During programming, SMAP provides feedback on the process, indicating success or failure. For example, "Clear offline data succeeded!" means finished firmware update. If an error occurs, messages like "MCU Reset Succeeded!" will be displayed.
- Troubleshooting: The manual provides detailed instructions and flowcharts for ISP and ICP processes, which can be used for troubleshooting. For instance, the ISP flowchart illustrates the communication between the PC and MCU, including data reception, UART interrupts, and command validation.
- Code Examples: The manual includes sample code for ISP, such as
main.c and assembly code, which can be helpful for developers in understanding and debugging their programming routines.
- Connectivity Check: The SMAP software indicates the connection status (e.g., "Connecting succeeded!"). If the device fails to detect the target MCU or establish a connection, users can check the physical connections and settings.
- Offline Mode: The offline programming modes (Off-line ISP and Off-line ICP) allow the MSM9066 to perform programming tasks without continuous PC connection, which can be useful in production environments. During offline recording, the LED will flash yellow until the task is finished. When the LED turns green, the off-line recording task is completed.