Page 1
Overview The CMT2189B is a low power, high performance, Flash-based, OOK RF transmitter chip embedded with the RISK MCU , which covers a wireless communication band of 240 - 960 MHz. The product is a part of the CMOSTEK NextGenRF product family which covers a complete product line consisting of transmitters, receivers, transceiver, etc.
1.1 Overall Operating Principle The CMT2189B is a RF transmitting chip integrated with digital and analog parts altogether, which applies a crystal oscillator to provide the reference frequency and digital clock for PLL, supporting OOK modulation with a data rate range of 1 ~ 40 kbps. It supports status control through the MCU programming to fulfill various low power transmission applications.
Page 6
AN201 Table 2. CMT2189B Pin Description - SOP14 Package Pin # Pin Name Type Description DVDD Digital Chip power supply + General purpose IO Digital General purpose IO PC4/C2OUT Digital Comparator 2 output C2OUT XTAL Analog Crystal oscillator input in RF part SPI interface enabling control in RF part, low active, internal pull up.
Page 7
PC<3:0> is the internal control pin of the chip, which has no package pin, but it is used as a bus controlling RF part internally. Rev 1.5 | 7/91 www.cmostek.com...
2 RF Part Configuration and Control Mechanism 2.1 Operating Mode The built-in OOK Tx function of the CMT2189B supports 2 operating modes. Simple operating mode: the default entry mode upon power-up, namely, the non-configuration mode, which supports the pass-through Tx mode only.
PC1/SDIO is used as the serial data line of SPI. With both using the register configuring method, the pass-through mode in advanced configuration mode can support more frequency selection and power selection than that in the simple operating mode. Rev 1.5 | 9/91 www.cmostek.com...
RFCTRL is an input port requiring external control. It is recommended that users control it through any function port in the CMT2189B, and pull it down to enable SPI interface function. In the whole process, RFCTRL can keep low, but in the low power sleep mode, it needs to set the MCU pin controlling RFCTRL to a high impedance input, since the pull-up inside RFCTRL can pull the level high.
Page 12
Export to generate an exp file with file content as follows. ;--------------------------------------- ; CMT2157B Configuration File ; Generated by CMOSTEK RFPDK 1.46 ; 2017.11.14 13:47 ;--------------------------------------- ; (Among them, the annotation part with ; is omitted.) ;---------------------------------------...
Page 13
; The following is the CRC result for ; the above EEPROM contents ;--------------------------------------- 0xEDFA ;--------------------------------------- ; The following are for CMOSTEK ; use, customers can ignore them ;--------------------------------------- 0x0000 0x0018 Among them, the specific configuration content is with red font, which are all 16-bit Word with a total of 24 Words contained, therefore users need to convert the 16-bit Word to the format of 8-bit register content.
Users only need to write the above contents (as parameters) into the 0x01~0x2E register address while writing timing through SPI. 2.6 Configuration Register The above exported configuration parameter address from 0x01 to 0x2E can be divided into three banks according to the functions, which are as follows: Rev 1.5 | 14/91 www.cmostek.com...
The blue area indicates that users need to understand it. The registers will be detailed one by one in below. The built-in packet structure pattern of the CMT2189B is the same as that of the CMT2157B. Users can select the packet structure of the CMT2157B in RFPDK configuration screen.
AN201 2.7.2 Hardware Packet Format The CMT2189B supports hardware packet structure internally with data frame structure as follows. Head/ Stop Preamble ID/ADDR Key Value Pause/Interval Sync Status Figure 7. Packet Structure As shown in the packet structure in the above figure, it contains 7 parts.
CUS_PKT5 SYNC_HEADER<7:0]> (0x0C) CUS_PKT6 The value of sync can be filled in different registers SYNC_HEADER<15:8> (0x0D) according to the different SYNC_LENGTH settings, please refer the next table for details. CUS_PKT7 SYNC_HEADER<23:16> (0x0E) CUS_PKT8 SYNC_HEADER<31:24> Rev 1.5 | 18/91 www.cmostek.com...
0 ~ 7. 0 represents 1 symbol and so on. 7 represents 8 symbols. CUS_PKT15 BIT_LOGIC_L<7:0> Logic 0 definition (0x16) CUS_PKT16 BIT_LOGIC_H<7:0> Logic 1definition (0x17) CUS_PKT9 ADDR_ID<7:0> (0x10) CUS_PKT10 ADDR_ID<15:8> (0x11) Addr ID value CUS_PKT11 ADDR_ID<23:16> (0x12) CUS_PKT12 ADDR_ID<31:24> (0x13) Rev 1.5 | 19/91 www.cmostek.com...
Page 20
0x5678. Then users will fill the value into ADDR_ID<31:24> and ADDR_ID<23:16> registers. MSB is corresponding to the 31 bit and LSB corresponds to the 16 bit, that is, 0x56 is filled into ADDR_ID<31:24> and 0x78 is filled into ADDR_ID<23:16>. Rev 1.5 | 20/91 www.cmostek.com...
The key value length can be configured to 0~7. 0 represents sending a key of 1 logic bit, and so on. 7 CUS_PKT4 (0x0B) KEY_LENGTH<2:0> represents sending a Key of 8 logic bits.The logic bit length is random. CUS_PKT17 (0x18) KEY<7:0> Key Value Rev 1.5 | 21/91 www.cmostek.com...
The voltage comparison threshold of the LBD. Iif the actual voltage is greater than the threshold, the LBD_TH<3:0> LBD result is 1 (logic 1), and conversely, it is 0 (logic 0). CUS_LBD_RESULT LBD_RESULT<3:0> Voltage measurement value (0x4B) Rev 1.5 | 22/91 www.cmostek.com...
Page 23
If LBD_OUT_EN is configured as 1, the LBD result will be sent out as part of the packet. See Section 2.7.1 for details. In the chip, the voltage value is converted by a 4-bit ADC to obtain LBD_RESULT with each step as 0.2 V. The relationship between the voltage value and LBD_RESULT is as follows. Rev 1.5 | 23/91 www.cmostek.com...
The stop bit length can be configured to 0 ~ 15. 0 CUS_PKT14 represents sending a stop of 1 Symbol, and so on. 15 STOP_LENGTH<3:0> (0x15) represents sending a stop of16 symbols, The symbol length is random. CUS_PKT27 STOP_BIT<7:0> (0x22) STOP_BIT Value CUS_PKT28 STOP_BIT<15:8> (0x23) Rev 1.5 | 24/91 www.cmostek.com...
(N) repeated packet transmissions with the support of pause/interval between packets. It also supports transmitting m data groups in a transmission cycle with each data group composed of N packets. The different transmission cycle configurations are shown in the below figure. Rev 1.5 | 25/91 www.cmostek.com...
Page 26
0: In one cycle, each Packet contains 1 Preamble, i.e. PREAMBLE_LOCATION in one cycle, N Packets contain N Preambles. CUS_PKT1 1: In one cycle, only 1 Preamble is included, which is (0x08) only in the first Packet. Tcycle Enable bit: TCYCLE_EN 0:Disable 1:Enable Rev 1.5 | 26/91 www.cmostek.com...
(CFG) is configured. 2.8.2 Operating State and State Switching The CMT2189B RF supports 3 major operating states. In advanced configuration mode, the states and state switching are shown in the below diagram. Rev 1.5 | 27/91...
Table 25. State Switching Command and Reset Command Control Register Command Type Command Writing Value Function Description go_sleep 0x01 Return SLEEP state CUS_MODE State jumping go_tx 0x02 Enter TX state (0x33) go_stby 0x08 Enter STBY state 2.8.3 Operating State Query Rev 1.5 | 28/91 www.cmostek.com...
After initialization, the chip can enter low power based sleep state or perform other processing. 2.9.2 Tx Process The CMT2189B hardware data packet frame structure is shown in the below figure. Please refer to Section 2.7.2 for the data frame structure descriptions.
Page 30
The standby state cannot be judged by transmission completion since it's in standby state as well during the data packet interval. It should be noted that the internal pin state processing after transmission completion is different from the processing after power-up initialization. Rev 1.5 | 30/91 www.cmostek.com...
When the transmission is started up again, execute the Tx process once again. In step 3, 6, 1, 11, users need to use read-modify-write method to avoid modifying the value of other bits by mistake. 2.10.3 Related Register Rev 1.5 | 31/91 www.cmostek.com...
Page 32
PC0. Users need to consider the TX_OVERTIMES setting according to the encoding format. TX_OVERTIMES is set to 20 ms by default, and can increase to 90 ms by the step of 10 ms. Rev 1.5 | 32/91 www.cmostek.com...
User and factory configuration information bank is 0x2000 ~ 0x203F. 0x000 Program area 0x7FF 0x2000 UCFG0 0x2001 UCFG1 0x2002 UCFG2 Reserved Unusable 0x2010 FCFG0 0x2011 FCFG1 0x2012 FCFG2 0x2020 INFOx 0x1FFF 0x2000 Information area 0x203F 0x203F Figure 11. Program Space Address Mapping Rev 1.5 | 33/91 www.cmostek.com...
Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 TMR0 Timer0<7:0>, counter result register Reset Type 4.1.4 STATUS (Addr:0x03) Table 30. STATUS Register Name Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 STATUS PAGE Reset Type Rev 1.5 | 36/91 www.cmostek.com...
Page 37
0 = bit 4 carrying/borrowing does not occur in the calculation result. Carrying/borrowing ( ADDWF, ADDLW, SUBLW and SUBWF instruction). 1 = carrying/borrowing occurs in the calculation result. 0 = carrying/borrowing does not occur in the calculation result. Rev 1.5 | 37/91 www.cmostek.com...
PORTA5 only has input function. There is no corresponding output data register. PORTA4 data PORTA3 data PORTA2 data PORTA1 data PORTA0 data 4.1.6 PORTC(Addr:0x07) . PORTC Register Table 35 Name Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 PORTC Reset Rev 1.5 | 38/91 www.cmostek.com...
Timer 2 and PR2 compare matching interrupt flag bit. TMR2IF 1 = Timer 2 and PR2 matching occurs (must be cleared by software) 0 = Timer 2 and PR2 matching does not occur Reserved bit, cannot be written to 1. Rev 1.5 | 40/91 www.cmostek.com...
101 = 1 independent comparator 110 = 2 common reference comparators with outputs 111 = the comparator is turned off, and the CxIN pin is the digital IO pin. 4.1.13 PR0 (Addr:0x1A) Table 48. PRO Register Rev 1.5 | 43/91 www.cmostek.com...
1 = enable measuring slow clock period using fast clock CKCNTI 0 = disable measuring slow clock period using fast clock. Notes: The bit will automatically return to 0 after the measurement is completed. Reserved bit, cannot be written to 1. 4.1.15 SOSCPR (Addr:0x1C/0x1D) Rev 1.5 | 44/91 www.cmostek.com...
1 = no brown-out reset occurs or it is set to 1 by software. 4.1.21 OSCCON (Addr:0x8F) Table 65. OSCCON Register Name Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 OSCCON LFMOD IRCF<2:0> OSTS Reset Type Rev 1.5 | 48/91 www.cmostek.com...
Name Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 PR2<7:0> Reset 0xFF Type . PR2 Bit Function Description Table 68 Name Function PR2<7:0> Timer 2 period (compare) register (see Timer 2 specific sections for details). Rev 1.5 | 49/91 www.cmostek.com...
The software cannot access UCFG0, UCFG1 and UCFG2. They can only be written by the hardware (programming) in the power up process. UCFG0, PROM address 0x2000 . UCFG0 Configuration Register Table 81 Name Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 UCFG0 MCLRE PWRTEB WDTE FOSC<2:0> Rev 1.5 | 52/91 www.cmostek.com...
Page 53
0 = disable Port read control bit in output mode RD_CTRL 1 = read the value of the PAD returned from the data port 0 = read the value of the Latch returned from the data port Rev 1.5 | 53/91 www.cmostek.com...
PCLATH is not required since the operating code in the instructions is 11-bit, and the chip PC is exactly 11-bit. ALU结果 OPCODE<10:0> PCLATH<2:0> PCLATH PCLATH Instruction with PCL as Instruction Target LJUMP and LCALL Instruction Figure 12. PC Loading in Different Situations Rev 1.5 | 54/91 www.cmostek.com...
0 ~ 255. Any instruction using the INDF register actually accesses the unit that the file selection register FSR points to. Reading the INDF indirectly will return 0. Writing the INDF indirectly will cause the control operation (It may affect the state flag bit). Rev 1.5 | 55/91 www.cmostek.com...
The internal clock mode is built in the oscillator module. The oscillator module has a 16 MHz high frequency oscillator and a 32 kHz low frequency oscillator. Internal or external clock sources can be selected by the system clock selection bit(SCS) of the OSCCON register. Rev 1.5 | 56/91 www.cmostek.com...
IRCF<2:0> is used to select the frequency output of the internal oscillator. Select 1 of the following 8 frequencies via the software. 16 MHz 8 MHz 4 MHz (Default value after reset) 2 MHz 1 MHz 500 kHz 250 kHz Rev 1.5 | 57/91 www.cmostek.com...
Figure 15. Switch from Fast Clock to Slow Clock 5.4 Clock Switching Users can switch the system clock source between the external and internal clock sources by operating the system clock selection (SCS) bit of the OSCCON register via software. Rev 1.5 | 58/91 www.cmostek.com...
The two-speed start-up mode is configured by the following settings. Configure the IESO bit in the Configuration Word register UCFG1 as 1, namely the internal/external switching bit (enable the two-speed start-up mode). Configure the SCS bit of the OSCCON register as 0. Rev 1.5 | 59/91 www.cmostek.com...
The FSCM module detects the oscillator fault by comparing the external oscillator with the FSCM sampling clock. LFINTOSC divided by 64 is the sampling clock. See Figure 16 for details . There is a latch inside the fault detector. On each falling edge of Rev 1.5 | 60/91 www.cmostek.com...
(e.g. after exiting reset or sleep). After an appropriate amount of time, users should check the OSTS bit of the OSCCON register to verify whether the oscillator has successfully started and whether the system clock has been switched successfully. Rev 1.5 | 61/91 www.cmostek.com...
AN201 6 Reset Timing The CMT2189B supports several types of resets as follows. Power-on reset (POR) WDT reset during normal operating WDT wakeup during sleep MCLR pin reset during normal operating /MCLR pin reset during sleep Brown-out reset/low voltage reset (BOR/LVR) Some registers are not affected in any reset condition.
VDD is lower than the threshold on which the system can operate normally. If the reset signal is generated by the BOR circuit, the VDD voltage must keep for more than 100 us at the VSS level. Rev 1.5 | 63/91 www.cmostek.com...
1 and check whether it is 0 then. Bit 1 is the /POR indication bit, which is 0 upon power-on reset, and the software must set it to 1. POR_RSTN 4ms delay BOOT_EN PWRTE BOOT_END PWRT,64ms PWRT_OV MCLRB SYS_RSTN Figure 19. Power-on Reset with MCLRB Rev 1.5 | 64/91 www.cmostek.com...
Page 65
After the voltage is restored to normal, the internal reset will not be released immediately, but wait for about 8 ms instead. Table 87. Timeout in Various Cases Oscillator Power-on Reset Brown-out Reset Sleep Wake-up configuration /PWRTEB=0 /PWRTEB=1 /PWRTEB=0 /PWRTEB=1 INTOSC TPWRT TPWRT Rev 1.5 | 65/91 www.cmostek.com...
Page 66
AN201 Table 88. STATUS/PCON Bit Description (U: no change, X: unknown) /POR /BOR Condition WDT Reset WDT Wake-up /MCLR reset during normal operation /MCLR reset during sleep Rev 1.5 | 66/91 www.cmostek.com...
After POR or BOR, it inserts a state and maps the program EEPROM units starting from 2000H into configuration registers. The system reset is released until the end of the BOOT, as shown in Figure 19 and Figure 20. The process needs about 17 us. Rev 1.5 | 67/91 www.cmostek.com...
If the internal slow clock switches from the 32 k to 256 k mode (or from the 256 k to 32 k mode), it does not affect the watchdog timing, as WDT is fixed to use the 32 k clock source. Rev 1.5 | 68/91 www.cmostek.com...
In this mode, Timer 0 increases by 1 (without prescaler) in each instruction cycle. The software can clear the T0CS bit of the OPTION register to enter the timer mode. When the software performs write operation to the TMR0, the timer will not increase in the following 2 cycles. Rev 1.5 | 69/91 www.cmostek.com...
OPTION_REG, PSA CLRWDT ;Mask prescaler bits LDWI b’11111000’ ANDWR OPTION_REG, W ;Set WDT prescaler to 1:32 IORWI b’00000101’ When switch the prescaler assignment from the WDT to TMR0, please execute the following instruction sequence. LDWI OPTION_REG Rev 1.5 | 70/91 www.cmostek.com...
In the counter mode, the synchronization between the T0CKI pin input and the Timer 0 register is fulfilled by sampling the phase of the internal clock Q1 and Q2, therefore the high level time and low level time of the external clock source cycle must meet the relevant timing requirement. Rev 1.5 | 71/91 www.cmostek.com...
Setting the TMR2ON bit of the T2CON register to 1 can enable Timer 2, and clearing the TMR2ON bit can disable Timer 2 on the contrary. The Timer 2 prescaler is controlled by the T2CKPS bit of the T2CON register. The Timer 2 postscaler is controlled by the TOUTPS bit of the T2CON register. Rev 1.5 | 72/91 www.cmostek.com...
Page 73
The prescaler counter and postscaler counter will be cleared when the following registers are written: Write the TMR2 Write the T2CON Any reset action Writing the T2CON does not clear the TMR2 register. Rev 1.5 | 73/91 www.cmostek.com...
When the word D is marked on the port, users should set the corresponding TRIS bit to 0 to open the digital output driver circuit. In addition, the comparator interrupt should be disabled during the comparator configuration switching to avoid unexpected miss-triggered events. Rev 1.5 | 74/91 www.cmostek.com...
EECON1 register to 1. In the next cycle, the EEDAT register is written with the EEPROM data. Therefore, this data can be read by the next instruction. The EEDAT will keep this value until the user reads or writes the data of the unit the next time (during the write operation). Rev 1.5 | 75/91 www.cmostek.com...
After the end of the measurement, MSCKCON.1 is automatically cleared, and the interrupt flag is set to 1. Wait for the measurement completion in a query or interrupt manner. When the interrupt flag is checked to be 1, the read SOSCPR is the final result. Rev 1.5 | 76/91 www.cmostek.com...
Page 77
AN201 CKMAVG BUS<1> CKCNTI MSCKCON WR CKMEAS EN T2 SYSCLK MEAS DONE SYSCLK TMR2 16-bit SOSCPR<11:0> To INT Figure 26. Block Diagram for Slow Clock Measurement Mode Rev 1.5 | 77/91 www.cmostek.com...
AN201 Interrupt Mode The CMT2189B supports the following interrupt sources: External interrupt from the PA2/INT pin Timer 0 overflow interrupt PORTA change Interrupt Timer 2 compare matching interrupt EEPROM data write Interrupt Slow clock measurement Interrupt The interrupt control register (INTCON) and peripheral interrupt request register (PIR1) record the interrupt flag bit.
The interrupt delay of the external interrupts, including the interrupt from the INT pin or the PORTA change interrupt, is usually 1 to 2 instruction cycles depending on actual interrupt situations. INT(PA2) INTF 中断矢量 PC-1 PC+1 PC+2 0x004 0x005 Figure 27. Interrupt Response Timing Diagram Rev 1.5 | 79/91 www.cmostek.com...
Clearing watchdog (CLRWDT) and SLEEP instruction will clear the watchdog counter. When enabled, the watchdog overflowing event can be used as a wake-up source when the MCU is in sleep mode, while it can be used as a reset source when the MCU operates normally. Rev 1.5 | 81/91 www.cmostek.com...
The mismatching result will always set the PAIF bit. Reading PORTA once can end any mismatching status to clear the PAIF bit. The last read value kept in the data register will not be affected by /MCLR or BOR. As long as the mismatching status exists, PAIF bit will set to 1. Rev 1.5 | 82/91 www.cmostek.com...
The following figure describes The internal circuit architecture of the port is shown in the below figure. Data CLK Q /RAPU WPUA WPUA CLK Q PORTA CLK Q TRISA TRISA PORTA CLK Q IOCA PORTA IOCA Interrupt On Change T0CKI (PA2 Only) . PA<2:0> Architecture Diagram Figure 29 Rev 1.5 | 83/91 www.cmostek.com...
Data WPUA /RAPU WPUA PORTA ATEST1 EN TRISA TRISA PORTA IOCA PORTA IOCA Interrupt On Change Figure 30. PA3 Architecture Notes: ATEST1 is used for internal test, but not for users. Users can ignore it. Rev 1.5 | 84/91 www.cmostek.com...
IR MODE IR MODE ATEST0 EN TRISA TRISA PORTA IOCA PORTA IOCA Interrupt On Change Figure 31. PA4 Architecture Notes: ATEST0 and IR are used for internal test, but not for users. Users can ignore them. Rev 1.5 | 85/91 www.cmostek.com...
The internal circuit architecture of the port is shown in the below figure. (Only PC4) C2OUT Enable C2OUT Data PORTC Analog Input mode TRISC TRISC To Comparator PORTC (Only PC0 & PC1) Figure 33. PC7~PC0 Architecture Rev 1.5 | 87/91 www.cmostek.com...
AN201 Instruction Set The CMT2189B adopts the reduced instruction set architecture with a total of 37 instructions. The instruction description is listed in the below table.. Table 90. Instruction Set Table Instruction Function Operation Status Period BCR R, b Bit clear 0->...
Page 89
S U B W I Subtract W from imm I-W-> W C, HC, Z Notes: The TMODE register of the chip refers to the OPTION, namely, the operation of the STTMD instruction is to save W to OPTION. Rev 1.5 | 89/91 www.cmostek.com...
Increase the Section 2.7.1 'Tx rate description' 2017-11-29 'PC4/RFDIN”is modified as“PC0/RFDIN' 2018-01-09 Update the function description of SLVREN bit. 4.1.14, 4.1.30 2018-12-19 Change LVDEN to LVREN. Rewrite the whole EN version document 2019-03-29 Change Tx. process 2.9.2 2019-11-05 Rev 1.5 | 90/91 www.cmostek.com...
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.
Need help?
Do you have a question about the CMT2189B and is the answer not in the manual?
Questions and answers