CMOSTEK AN204: CMT2280F2/2281F2/2189B/2189C IDE Operation Guide

CMOSTEK Microelectronics Co., Ltd.

Overview

This document discusses the program development IDE operation guide for the CMT2280F2, CMT2281F2, CMT2189B, and CMT2189C. As part of the CMOSTEK NextGenRF™ product family, which covers short-range wireless communication chips including transmitters, receivers, and transceivers, these 4 wireless MCUs use the same high-performance RISC core and support FLASH ROM for on-line debugging.

The product models covered in this document are shown in the table below.

Table 1. Product Models Covered in This Document
Product Model Frequency Range Modulation Method Transmitting Power Sensitivity Operating Current Configuration Method Package
CMT2280F2 300 - 960 MHz OOK - -110 dBm 3.8 mA MCU Configuring SOP16
CMT2281F2 300 - 960 MHz OOK - -109 dBm 4.5 mA MCU Configuring SOP16
CMT2189B 240 - 960 MHz OOK + 13 dBm - 17.5 mA [1] MCU Configuring SOP14
CMT2189C 240 - 960 MHz OOK/(G)FSK + 13 dBm - 32.5 mA [2] MCU Configuring SOP14

Notes:

[1]. CMT2189B's transmitting power and transmitting current test conditions are: 433.92 MHz, CW mode (namely always in carrier transmitting mode), 50% Duty transmitting mode and transmitting current of 8.5 mA.

[2]. CMT2189C's transmitting power and transmitting current test conditions are: 433.92 MHz and FSK mode.

1 Introduction to IDE

The IDE provides development software for the 4 wireless MCUs, CMT2280F2, CMT2281F2, CMT2189B, and CMT2189C. The major function is to debug and simulate the chip programs.

The IDE provides the following features:

  • Create and edit source programs using the built-in editor.
  • Compile the source code.
  • Download and debug executable programs by connecting to the debugger.
  • View variables in watch window.

2 Main Screen

As shown in the figure, generally 4 basic windows are contained in the main screen including project window, editing window, output window, and watch window, which are draggable, hovering, and docking windows, except the editing window.

Visual Description of Main Screen: The main screen displays a typical Integrated Development Environment (IDE) layout. It features a menu bar at the top, followed by a toolbar with common icons. The central area is divided into several windows: a 'Project Window' typically on the left, an 'Editing Window' in the center, an 'Output Window' below the editing window, and a 'Watch Window' often on the right or bottom. A 'Status Bar' is located at the very bottom, showing progress and system information.

For example, clicking and dragging a window area reveals docking arrows. When a window is dragged into the direction specified by an arrow, it docks in the corresponding screen position.

2.1 Project Window

The Project Window contains two tabs: 'File View' and 'Class View'. 'File View' displays project information, including device name, source file, data file, reference file, and output file. Double-clicking a file name under 'Source File' or 'Include File' opens it. 'Class View' displays all labels after compilation is complete. Double-clicking a label in the editing window can locate the label in the source file.

Visual Description of Project Window Tabs: The Project Window shows a hierarchical tree structure representing project files. The 'File View' tab lists files categorized under 'Source File', 'EE Data File', 'Include File', and 'Output File'. The 'Class View' tab would list program labels and their addresses.

2.2 Editing Window

Users edit source files and reference files in the editing window. The editor colors keywords (blue), immediate data (red), and comments (green). Users can zoom in or out using Ctrl + middle mouse button. The IDE exits debug mode automatically when a file is edited and saved during debugging. Users must recompile and re-download before the next debugging session. If a document open in the editing window is modified by an external editor, it will prompt to reload. This action will also exit debugging if it occurs during a debugging state, requiring recompilation and download to resume debugging.

2.3 Output Window

The Output Window contains three tabs: 'Build', 'Debug', and 'Find'. The 'Build' tab displays output information such as compilation and download status. Compiling errors show the file, line number, and statement of the error. Double-clicking an error message locates the line in the editing area.

To debug and watch variables, users input the variable in the 'Debug' tab. The variable and its corresponding address are refreshed during debugging. For bit variables, the bit address and value are refreshed. The 'Find' tab lists searched files and line numbers; double-clicking a line locates it in the editing window.

Visual Description of Output Window: The Output Window typically displays compilation logs, error messages, and debugging information. It is segmented into tabs for different types of output, such as build status, runtime debugging data, and search results.

2.4 Watch Window

The Watch Window consists of four tabs: 'RAM', 'EEPROM', 'STACK', and 'Register'.

  • RAM Tab: Displays RAM values. Changes during debugging are marked in red. Users can double-click to modify RAM values, and the change is written to the chip after clicking anywhere in the tab.
  • EEPROM Tab: Displays EEPROM values. Data can be imported via 'Project -> Load EEPROM Data...' or defined using the 'DE' command in a source file. Similar to RAM, EEPROM values can be edited directly in the tab and written to the chip. 'Project -> Export EEPROM Data...' can be used to save EEPROM data. Note that EEPROM data modified during debugging might differ from data compiled.
  • STACK Tab: Shows stack values, which are read-only and used for monitoring stack push/pop operations.
  • Register Tab: Displays Special Function Registers (SFRs), including address, name, and value. Data format can be hexadecimal (H) or binary (B). Clicking '+' expands to show bit variables and their values; clicking '-' collapses them. Registers are refreshed during debugging, with changes highlighted in red. Register values can be modified by double-clicking and then clicking elsewhere in the tab to write to the chip.

Visual Description of Watch Window: The Watch Window presents data in a tabular format, allowing users to monitor the state of variables (RAM, EEPROM), stack, and CPU registers during program execution.

2.5 Menu, Toolbar and Status Bar

The Menu contains all operations. The Toolbar provides quick access to commonly used menu items. The Status Bar displays progress information, chip status, and the debugger version number.

Visual Description of Status Bar: The Status Bar is a horizontal bar at the bottom of the IDE window, typically showing a progress indicator (e.g., a progress bar), a stop button, and the current debugger version information.

3 New Project

The IDE uses a project management mode. To start, users select 'Project -> New Project'. A dialog box appears where they fill in the Project Name, select the Project Path, and choose the Device (e.g., CMT60F02X). The 'Create directory for project' option can be checked to create a project folder.

After project creation, users add source files via 'Project -> Add File...' or by right-clicking in the 'Source File' section of the Project Window and selecting 'Add File'. If the added file is not in the project directory, it is copied automatically. Data files (like EEPROM data) can be added similarly via 'Project -> Load EEPROM Data...' or by right-clicking 'EE Data File'. Include Files and Output Files are generated automatically during compilation.

4 Compiling

To compile, select 'Debug -> Build' (F7) or click the compile button. An 'Options' dialog box appears before compilation, allowing users to select specific settings. After selecting options and clicking OK, compilation begins. Compilation information is displayed in the Build window. For compilation errors, double-clicking the error message navigates to the corresponding line in the editor. Refer to Appendix 1 for detailed compiler descriptions.

5 EEPROM Settings

EEPROM data can be imported in three ways:

  1. Using the menu: 'Project -> Load EEPROM Data...'.
  2. Defining data via the 'DE' command in a source file.
  3. Directly inputting data by double-clicking the EEPROM tab in the Watch Window.

When using menu import or DE data definition, the compiled DE definition overwrites file-imported data. For direct input (method 3), modification is written to the EEPROM immediately upon editing and confirmed by reading back. EEPROM data is related to program operation.

Data can be exported using 'Project -> Export EEPROM Data...'.

6 Downloads

To erase, download, and reset the device, select 'Debug -> Build All' (Ctrl+F7). After a successful download, the simulation toolbar becomes active. If the file is modified and saved during simulation, the toolbar becomes invalid, requiring recompilation and download. If a program is not compiled before download, compilation, erasing, downloading, and resetting are performed sequentially.

7 Simulation

7.1 Set Breakpoint

Breakpoints can be set in two ways:

  1. Select a statement line, then choose 'Debug -> Breakpoint' (F9) or click the breakpoint icon. Setting a breakpoint for the first time adds it; setting it again removes it.
  2. Click the line number in the editing window to set or delete a breakpoint. Breakpoints are marked with a yellow circle. The IDE currently supports only one breakpoint at a time; setting a new one automatically deletes the previous one.

7.2 Reset (Ctrl + F5)

Resets the device and sets the Program Counter (PC) to 0. After reset, RAM, EEPROM, STACK, and registers are refreshed, and chip status is displayed in the status bar.

7.3 Step Into (F11)

Executes a single step. If a 'Call' instruction is encountered, it enters the sub-function. Upon completion, RAM, EEPROM, STACK, and registers are refreshed, and chip status is updated.

7.4 Step Over (F10)

Executes a single step. If a 'Call' instruction is encountered, it does not enter the sub-function. Upon completion, RAM, EEPROM, STACK, and registers are refreshed, and chip status is updated.

7.5 Run to Cursor (Ctrl + F10)

Allows execution to stop at a specific cursor position. If the cursor position is unreachable, the program runs at full speed. Upon completion, RAM, EEPROM, STACK, and registers are refreshed, and chip status is updated.

7.6 Go (F5)

Runs the program until a breakpoint is hit. The breakpoint must be set before execution. If the breakpoint is unreachable, the program runs at full speed. Upon completion, RAM, EEPROM, STACK, and registers are refreshed, and chip status is updated.

7.7 Stop (Shift + F5)

Stops the program running at full speed. Upon completion, RAM, EEPROM, STACK, and registers are refreshed, and chip status is updated.

8 Appendix 1 - Compiler Description

8.1 Variable Naming Rules

Variables must start with a letter and can consist of letters, numbers, and underscores. They are not case-sensitive. Variable names cannot be keywords, including instructions and pseudo instructions.

8.2 Digital Format

The compiler supports binary, hexadecimal, and decimal formats:

  • Binary: Ends with 'B' (e.g., 00010110B) or starts with 'B"' and ends with '"' (e.g., B"00010110").
  • Hexadecimal: Ends with 'H' (e.g., 1FH), starts with '0x' (e.g., 0x1F), or starts with 'H"' and ends with '"' (e.g., H"1F").
  • Decimal: Numbers without a suffix are decimal (e.g., 16). Decimal numbers can also start with '.' (e.g., .10).

8.3 Address Label

Label names follow variable naming rules and must be unique. Labels can optionally end with a colon (:). Undefined single strings are treated as labels. A label without a colon cannot be on the same line as an instruction, while one with a colon can.

8.4 Instruction

Table 2. Instructions
CMT PIC Instruction Cycle Function Operation Status
BCRR, bBCF F, b1Bit clear0→R(b)NONE
BSRR, bBSF F, b1Bit set1→R(b)NONE
BTSC R, bBTFSC F, b1(2)Bit test, skip if 0Skip if R(b)=0NONE
BTSS R, bBTFSS F, b1(2)Bit test, skip if 1Skip if R(b)=1NONE
NOPNOP1No operationNoneNONE
CLRWDTCLRWDT1Clear WDT0→WDT/PF, /TF
SLEEPSLEEP1Enter Sleep Mode0 WDT, STOP OSC/PF, /TF
STTMDOPTION1Store W TO TMODEW→TMODENONE
CTLIO RTRIS R1Control IO direction regW→IODIRrNONE
STR RMOVWF F1Store W to regW→RNONE
LDR R, dMOVF F, d1Load reg to dR→dZ
SWAPR R, dSWAPF F, d1Swap halves reg[R(0-3)R(4-7)]→dNONE
INCR R, dINCF F, d1Increment regR+1→dZ
INCRSZ R, dINCFSZ F, d1 (2)Increment reg, skip if 0R+1→dNONE
ADDWR R, dADDWF F, d1Add W and regW+R→dC, HC, Z
SUBWR R, dSUBWF F, d1Sub W from regR-W→d or R+/W+1→dC, HC, Z
DECR R, dDECF F, d1Decrement regR-1→dZ
DECRSZ R, dDECFSZ F, d1 (2)Decrement reg, skip if 0R-1→dNONE
ANDWR R, dANDWF F, d1AND W and regR&W→dZ
IORWR R, dIORWF F, d1Inclu.OR W and regW|RdZ
XORWR R, dXORWF F, d1Exclu.OR W and regW^R→dZ
COMR R, dCOMF F, d1Complement reg/R→dZ
RRRR, dRRF F, d1Rotate right regR(n)→R(n-1), C→R(7), R(0)→CC
RLR R, dRLF F, d1Rotate left regR(n)→R(n+1), C→R(0), R(7)→CC
CLRWCLRW1Clear working reg0→WZ
CLRR RCLRF F1Clear reg0→RZ
RETIRETFIE2Return from interruptStack PC, 1→GIENONE
RETRETURN2Return from subroutineStack→PCNONE
LCALL NCALL k2Long CALL subroutineN→PC, PC+1→StackNONE
LJUMP NGOTO2Long JUMP addressN→PCNONE
LDWIMOVLW k1Load immediate to WI→WNONE
ANDWIANDLW k1AND W and immW&I→WZ
IORWIIORLW k1Inclu. OR W and immW|I→WZ
XORWIXORLW k1Exclu. OR W and immW^I→WZ
RETWRETLW k2Return, place imm to WStack→PC, I→WNONE
ADDWIADDLW k1Add imm to WW+I→WC, HC, Z
SUBWISUBLW k1Subtract W from immI-W→WC, HC, Z

8.5 Pseudo Instruction

8.5.1 ORG

Format: ORG ADDR

Description: Defines the PC address. The ADDR cannot be smaller than the current PC or larger than the maximum PC.

Example:

ORG 0000H
Goto START
ORG 0004H ;interrupt entry
JUMP INTtimer0

8.5.2 Include

Format: #Include<filename>, #include "filename"

Description: <filename> is a file in the system directory; "filename" is a file in the project directory. The file type can be a header file (.H or .HIC) or a source file (.ASM). A header file must be imported before the PC address is 0, and a source file can be imported anywhere in a file.

Example:

#INCLUDE <CMT2189B.inc>
#INCLUDE "LED.ASM"

8.5.3 EQU

Format: variable name EQU RAM address

Description: The variable name follows the variable naming rules. The same variable name cannot be assigned multiple addresses. Multiple variables can correspond to the same address. Note that the RAM address is not checked if the variable is not used.

Example:

LEDLEVEL EQU 0x40

8.5.4 DB

Format: variable name DB ?

Description: The variable name follows the variable naming rules. A same name cannot be defined repeatedly. The address is automatically assigned by the compiler without needing to specify the corresponding RAM address. Note that the address is not assigned when a variable is not in use.

Example:

V1 DB?

8.5.5 DE

Format: DE Data0, Data1, ... Datan

Description: In the EEPROM data table, the address of the data table must be after 0x4100. Data following the DE table is arranged sequentially starting from the address defined by ORG. The number of data is unlimited, but must be on the same line.

Example:

ORG 4110H
DE 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17
DE 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F

8.5.6 DBIT

Format: variable name DBIT ?

Description: Defines a bit variable following variable naming rules. The address is automatically assigned by the compiler without specifying the corresponding RAM address. Note that the address is not assigned when a variable is not in use. Variables defined by this instruction can only be used in bit operation instructions including BCR, BSR, BTSC, BTSS, BCF, BSF, BTFSC, and BTFSS.

Example:

V1_1 DBIT?

8.5.7 Define

Format: #define identifier string

Description: Macro definition without parameters. It uses a macro name to represent a string, replacing the macro name with the string. This is a simple substitution; the string can contain any characters, constants, or expressions. The preprocessor does not check for errors; they are found during compilation after macro expansion.

Example:

#define Defname 1+5
ORG 0000H
......
LDWI Defname

8.5.8 MARCO

Format: macro name MARCO par1...part n

Macro content

ENDM

Description: Macros with parameters. Macro names and parameter names follow variable naming conventions. A macro module is defined with ENDM. No labels are allowed within the macro definition.

Example:

Delayms macro a1, a2, a3
  LDWI a1
  STR DELAYCNT1
  LDWI a2
  STR DELAYCNT2
  LDWI a3
  STR DELAYCNT3
  CALL DELAYLOOP
Endm

ORG 0000H
......
Delayms 0xF0, 0x49, 0x30

8.5.9 Ifdef

Format: ifdef conditional macro

; program 1

Else

; block 2

endif

Description: If a conditional macro is not equal to 0, block 1 is executed; otherwise, block 2 is executed. This instruction cannot be nested.

Example:

Ifdef defname
  LJUMP RESTART_WDT DECRSZ DELAYCNT1, F
  LJUMP POWERDOWN_2SLOOP
Else
  DECRSZ DELAYCNT2, F
  LJUMP POWERDOWN_2SLOOP DECRSZ DELAYCNT3, F
  LJUMP POWERDOWN_2SLOOP
Endif

9 Appendix 2 - Chip Debugging Manual

9.1 Overview

Visual Description of Development Environment: A schematic shows a Personal Computer (PC) connected via a USB port to an IDE development board, which in turn connects to a Target Board. This illustrates the basic setup for embedded development.

This appendix defines and describes the interface between the IDE development board and the external environment within the product integration development process, covering related hardware and software interfaces.

Visual Description of Debugging Board: A photograph displays the debugging board, labeled 'Link_V2.5', showing various components, connectors, and jumper points.

Visual Description of Debugging Board Top Marking: A schematic diagram illustrates the top layout of the debugging board, indicating component placement, pin assignments, and interface connectors like USB, UART, and power inputs.

9.2 Interface Description

The interface description for Figure 12 is as follows:

  • USB1: Connection between the USB port and the PC.
  • J11: The program interface, acting as the communication control port for a target chip, with connections listed from top to bottom in the table below.
Table 3. Connection Between Debugging Interface and Target Chip
J11 Interface CMT2280F2 CMT2281F2 CMT2189B CMT2189C
VCCDVDD Pin13DVDD Pin13DVDD/AVDD Pin1/Pin6VDD Pin1/Pin11
GNDGND Pin2GND Pin3GND Pin7GND Pin2/Pin10/Pin13
CLKPA0/ICSPCLK Pin9PA0/ICSPCLK Pin9PA0/ICSPCLK Pin12PA0/ICSPCLK Pin8
DATAPA1/ICSPDAT Pin10PA1/ICSPDAT Pin10PA1/ICSPDAT Pin13PA1/ICSPDAT Pin9

Interface Connectors:

  • P1: External power input.
  • J7: Download board GND.
  • J8: Target MCU 3.3 V power supply selection.
  • J9: Target MCU 3.7 V power supply selection.
  • J10: Target MCU 5 V power supply selection (only for CMT2281F2).
  • J13: External input power supply selection.

Visual Description of Debugging Board Power Supply Interface: A photograph shows the power supply selection points on the debugging board, indicating options for 3.3V, 3.7V, and 5V, along with an external power input selection.

Notes:

  • For the 4 short-circuit points (J8, J9, J10, and J13), only one can be shorted at a time.
  • SPWB1: Reset button for the download board.
  • D1: Indicator light.
  • LED Status: Red LED (always on) indicates power-on, meaning the debugger is not yet communicating with the PC. Green LED (always on) indicates successful connection between the debugger and the PC. Yellow LED (always on) indicates the debugger is in BOOT mode, waiting for firmware update. Yellow LED (flashing) indicates the debugger is operating.

9.3 Considerations

  1. The connection between a PC host and the IDE development board is straightforward, using a standard USB interface that requires no additional driver installation for the debugger. Upon first connection, the PC installs the necessary drivers automatically, allowing normal debugger use.
  2. The debugger board is powered by the PC via its USB 5V port. When debugging a target chip/board, the debugger board can power it directly. The power supply voltage (3.3V, 3.7V, or 5V) can be selected using a short-circuit cap; only one voltage can be selected at a time. For external power supply, disconnect the target board's power and connect an external supply to the debugger board's external power interface. Power is then supplied to the target board through the VCC of the Program interface. The maximum input voltage for the external power interface is 12V.
  3. Each time power is switched or a target chip is replaced, press the reset button on the debugger board to reconnect the target chip. When the debugger board's LED turns green, communication with the host computer is successful, enabling debugging operations.
  4. Upon each power-up, the host PC detects the firmware version. If the version is too low, the system enters boot mode, indicated by a constantly lit yellow LED, and the host automatically updates the firmware. Do not disconnect the USB during this process. If disconnection occurs or firmware update fails, press the reset button or re-plug the USB to re-enter boot mode for firmware re-update.

10 Revise History

Table 4. Revise History Records
Version No. Chapter Description Date
1.0AllInitial version2017-11-25
1.12Update some IDE screenshots2017-11-28

11 Contacts

CMOSTEK Microelectronics Co., Ltd. Shenzhen Branch

Address: 2/F Building 3, Pingshan Private Enterprise S.T. Park, Xili, Nanshan District, Shenzhen, Guangdong, China

Tel: +86-755-83231427

Post Code: 518057

Sales: sales@cmostek.com

Supports: support@cmostek.com

Website: www.cmostek.com

Copyright. CMOSTEK Microelectronics Co., Ltd. All rights are reserved.

The information furnished by CMOSTEK is believed to be accurate and reliable. However, no responsibility is assumed for inaccuracies and specifications within this document are subject to change without notice. The material contained herein is the exclusive property of CMOSTEK and shall not be distributed, reproduced, or disclosed in whole or in part without prior written permission of CMOSTEK. CMOSTEK products are not authorized for use as critical components in life support devices or systems without express written approval of CMOSTEK. The CMOSTEK logo is a registered trademark of CMOSTEK Microelectronics Co., Ltd. All other names are the property of their respective owners.

Models: CMT2280F2, CMT2281F2, CMT2189B, CMT2189C, CMT2280F2 Communication Module Micros, CMT2280F2, Communication Module Micros, Module Micros, Micros

File Info : application/pdf, 20 Pages, 1.46MB

PDF preview unavailable. Download the PDF instead.

RF CMT2189C-EM-433 HOPE 0002

References

ywl Adobe PDF Library 15.0

Related Documents

Preview CMOSTEK CMT2300A Configuration Guideline for RF Transceiver Development
This document provides detailed guidelines for configuring the CMOSTEK CMT2300A RF transceiver using the RFPDK software. It covers RF settings, operation modes, OOK and GFSK configurations, and encode/decode settings for developing wireless applications.
Preview CMOSTEK CMT2300A/CMT2119B/CMT2219B RF Frequency Calculation Guide
This guide provides RF frequency calculation formulas and configuration methods for CMOSTEK's CMT2300A, CMT2119B, and CMT2219B RF transceiver ICs, detailing register settings for RX and TX parameters using the RFPDK.
Preview CMT2219A: Ultra Low Power OOK/FSK RF Receiver Datasheet | CMOSTEK
Datasheet for the CMOSTEK CMT2219A, an ultra low power, high performance OOK and (G)FSK RF receiver operating from 300 to 960 MHz. Features low sleep current, SPI interface, and suitability for consumer electronics, home automation, and industrial applications.
Preview CMOSTEK CMT2300A: Ultra-low Power Sub-1GHz RF Transceiver Datasheet
Detailed datasheet for the CMOSTEK CMT2300A, an ultra-low power Sub-1GHz RF transceiver supporting OOK, FSK, and GFSK modulation. Features include wide frequency range, high sensitivity, and low power consumption for various wireless applications.
Preview CMOSTEK CMT2310A: High-Performance Sub-1GHz RF Transceiver Datasheet
Detailed datasheet for the CMOSTEK CMT2310A, a high-performance, ultra-low-power Sub-1GHz RF transceiver supporting OOK, 2(G)FSK, and 4(G)FSK modulation. Features include wide frequency range, high sensitivity, and low power consumption for applications like IoT, home automation, and industrial control.
Preview CMOSTEK CMT2300A: Ultra-low Power Sub-1GHz RF Transceiver Datasheet
Datasheet detailing the CMOSTEK CMT2300A, an ultra-low power, high-performance Sub-1GHz RF transceiver supporting OOK, FSK, and GFSK modulation. Covers features, electrical specifications, applications, and operational modes for wireless systems.
Preview CMT2300A Ultra-Low Power Sub-1GHz RF Transceiver Datasheet
Datasheet for the CMOSTEK CMT2300A, a high-performance, ultra-low power Sub-1GHz RF transceiver supporting OOK, (G)FSK, and (G)MSK modulation. Covers features, electrical characteristics, pin descriptions, application circuits, functional blocks, register maps, and ordering information.
Preview CMOSTEK CMT2310A: High-performance Sub-1GHz RF Transceiver Datasheet
Detailed datasheet for the CMOSTEK CMT2310A, a high-performance, ultra-low-power Sub-1GHz RF transceiver supporting OOK, 2(G)FSK, and 4(G)FSK modulation. Ideal for applications in automatic meter reading, home security, industrial monitoring, and wireless sensor networks.