Advertisement

Quick Links

Cmsemicon 8051 Microcontrollers
Application Notes
Rev. 1.1.0
Please note the following CMS IP policy
*China Micro Semicon Co., Ltd. (hereinafter referred to as the Company) has applied for patents and holds absolute legal rights and
interests. The patent rights associated with the Company's MCUs or other products have not been authorized for use, and any company,
organization, or individual who infringes the Company's patent rights through improper means will be subject to all possible legal actions
taken by the Company to curb the infringement and to recover any damages suffered by the Company as a result of the infringement or any
illegal benefits obtained by the infringer.
*The name and logo of Cmsemicon are registered trademarks of the Company.
*The Company reserves the right to further explain the reliability, functionality and design improvements of the products in the data sheet.
However, the Company is not responsible for the use of the Specification Contents. The applications mentioned herein are for illustrative
purposes only and the Company does not warrant and does not represent that these applications can be applied without further modification,
nor does it recommend that its products be used in places that may cause harm to persons due to malfunction or other reasons. The
Company's products are not authorized for use as critical components in lifesaving, life-sustaining devices or systems. The Company
reserves the right to modify the products without prior notice. For the latest information, please visit the official website at
www.mcu.com.cn.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 8051 Series and is the answer not in the manual?

Questions and answers

Summary of Contents for Cmsemicon 8051 Series

  • Page 1 Company to curb the infringement and to recover any damages suffered by the Company as a result of the infringement or any illegal benefits obtained by the infringer. *The name and logo of Cmsemicon are registered trademarks of the Company. *The Company reserves the right to further explain the reliability, functionality and design improvements of the products in the data sheet.
  • Page 2: Table Of Contents

    AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers Table of Contents 1. SIMULATION USAGE NOTES ......................5 2. BANK ..............................6 3. LOW POWER CONSUMPTION ....................... 6 4. ADC ............................... 7 5. I C ................................9 6. SPI ................................9 7. UART ..............................10 8.
  • Page 3 AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers 23. POWER ON ............................24 24. SLEEP MODE (STOP) ........................25 25. OTHERS ............................. 26 26. REVISION HISTORY ........................27 www.mcu.com.cn 3 / 27 V1.1.0...
  • Page 4 AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers The application notes apply to the following Cmsemicon 8051 microcontroller series: CMS8S3660, CMS8S3680, CMS8S6980, CMS8S6990, CMS8S5880, CMS8S5887, CMS8S5888, CMS8S5889, CMS80F231x, CMS80F253x, CMS80F261x, CMS80F251x, CMS80F751x, CMS8S7885, CMS8S7895, CMS8S6997, CMS8S6998, CMS8S6999, CMS8S589x, CMS8S369x, CMS8M35xx, and other series.
  • Page 5: Simulation Usage Notes

    AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers 1. Simulation Usage Notes ➢ When configuring the simulation mode, it is recommended not to connect an external pull-down resistor to the DSDA pin. ➢ If the LED/LCD SEG corresponding to the debug port is enabled, the debug mode will be disabled.
  • Page 6: Bank

    AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers 2. BANK When using the CMS80F261x, CMS80F251x, or CMS80F751x series chips, if different BANKs are used and there is a BANK switch operation in the interrupt service routine, please save the BANK value before entering the interrupt and restore it upon exiting the interrupt (This is to prevent inconsistencies in the BANK state after exiting the interrupt.)
  • Page 7: Adc

    AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers 4. ADC When using the ADC on the 51 series chips, the following points need to be noted: If you encounter insufficient sampling accuracy, it may help to reduce the ADC speed or decrease the impedance of the ADC sampling circuit.
  • Page 8 AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers ADC Clock Division Ratio Operation Notes: After detecting the completion of the previous ADC conversion, if it is necessary to change the ADC clock division ratio again, it is recommended to wait for at least 4 ADC conversion clock cycles (Tadck).
  • Page 9: Spi

    AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers 5. I ➢ When using the CMS80F261x chip and configuring the IO port alternate function, setting PS_SCL and PS_SDA as write-only registers, the registers must be directly assigned values. The use of logical operations (AND/OR) in the program is prohibited.
  • Page 10: Uart

    AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers 7. UART ➢ The PS_RXDI register of the CMS80F261x chip is a write-only register. When assigning a value to this register, direct assignment must be used. The use of logical operations (AND/OR) in the program is prohibited.
  • Page 11: Wdt

    AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers 9. WDT When modifying the WDCON register, there is a logical sequence that needs to be followed: first, write 0xAA and 0x55 to the TA register, and then assign a value to WDCON. When using C language for definition, it is recommended to define this operation sequence as a macro, and then directly call the defined macro wherever needed.
  • Page 12: Interrupts

    AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers 11. Interrupts This section primarily discusses the precautions for using interrupts. The chip’s interrupt clearing methods are: automatic hardware clearing after entering the interrupt service routine, software clearing, and read/write register clearing. 11.1 Cleared by Hardware...
  • Page 13: External Oscillator

    AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers 12. External Oscillator When using an external crystal oscillator with the chip, the following two points need to be noted: The crystal oscillator should not exceed 16 MHz. When using FLASH with an external oscillator as the main frequency, some chips require writing 256 bytes of 0xFF to the FLASH after each erase operation.
  • Page 14: Flash Usage

    AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers 14. FLASH Usage 14.1 FLASH Erase Operation For certain chips, after each FLASH erase operation, it is necessary to write 256 bytes of 0xFF consecutively to the FLASH memory (the write address can be any unused address in the FLASH, or it can be any address within the erased sector).
  • Page 15: Flash Locking

    AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers 14.2 FLASH Locking Before performing operations on the FLASH, it is necessary to unlock the FLASH, and after completing the operation, the FLASH should be locked. ➢ For chips such as CMS8S3660, CMS8S3680, CMS8S5880, CMS8S6980, CMS8S6990, CMS80F261x, CMS8M35xx, etc., the MLOCK register can be operated directly when unlocking the FLASH.
  • Page 16: Boot Usage

    AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers 15. Boot Usage During program execution, if the pointer is directed to a non-existent address or an address that exceeds the chip’s address range (for example, when using the BOOT function, and the next execution address points to an address outside the BOOT region), this is not allowed.
  • Page 17: Cautions For Ta Timing Operations

    AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers 17. Cautions for TA Timing Operations When operating certain registers, it is necessary to first write the TA timing. Only after the TA timing is completed will the operations on the registers be effective. The TA write timing requires that the entire writing process must not be interrupted;...
  • Page 18: Operational Amplifier

    AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers 18. Operational Amplifier 18.1 Overview The operational amplifier (op-amp) is a general-purpose op-amp built into the MCU. The input and output terminals of the amplifier are open, and the gain of the op-amp can be adjusted by external resistors to achieve basic signal amplification and operation functions.
  • Page 19: Analog Comparator

    AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers 19. Analog Comparator 19.1 Overview The built-in comparator is a general-purpose analog comparator integrated into the MCU. When the voltage at the positive input is greater than the voltage at the negative input, the comparator outputs a logical 1. Otherwise, it outputs a 0.
  • Page 20: Lvd

    AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers 20. LVD The CMS8S589x MCU has a built-in power supply detection function. When the Low Voltage Detection (LVD) module is enabled (LVDEN=1) and the voltage detection threshold (LVDSEL) is set, an interrupt will be triggered when the supply voltage drops below the set LVD threshold, alerting the user.
  • Page 21: Lse

    AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers 21. LSE 21.1 Cautions If the Watchdog Timer (WDT) is set to reset the system, and the LSE module is enabled, it is important to clear the watchdog counter promptly during the process of waiting for the LSE clock to stabilize. Otherwise, an undesired watchdog reset may occur, as shown in the figure below.
  • Page 22: Recommended Operations

    AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers 21.2 Recommended Operations As shown in Figure 21-2 b, the recommended operation flow is to promptly clear the watchdog counter during the process of waiting for the LSE clock to stabilize. Start Start...
  • Page 23: T Mode Ta Register Operation Notes

    AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers 22. 1T Mode TA Register Operation Notes 22.1 Cautions During TA register operations, no interruption is required between TA=0xAA and TA=0x55. Therefore, when operating on TA, interrupts must be disabled (EA=0). The common example is: EA = 0; → TA = 0xAA; → TA = 0x55;...
  • Page 24: Power On

    AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers 23. Power On During the power-on process, ensure that the chip’s VDD and GND pins have good contact to guarantee the chip operates in the normal power-on mode. If the GND pin has poor contact and an IO pin is at a low input level, the power supply may deliver abnormal power to the chip through VDD and the IO (low level).
  • Page 25: Sleep Mode (Stop)

    AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers 24. Sleep Mode (STOP) After the chip enters the sleep mode (STOP), all circuits except the LVD and LSE modules are powered off (the LVD/LSE modules must be turned off via software). The system enters a low-power mode, and the digital circuits stop functioning.
  • Page 26: Others

    AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers 25. Others ➢ For programs that require multiple consecutive statements to complete an operation, do not insert delays or breakpoints between the consecutive statements. If an interrupt occurs in the middle, it will interrupt the sequence of operations, which may affect the success rate of the operation.
  • Page 27: Revision History

    AN220009-Z Application Notes for Cmsemicon 8051 Microcontrollers 26. Revision History Version # Date Description of changes V1.00 Dec. 2020 Initial release V1.01 Feb. 2021 Added notes for using external oscillators. V1.02 Apr. 2021 Added a diagram illustrating the time intervals for FLASH operations.

Table of Contents