Overview of Domestic Alternatives to STM32 (Part 4)

Overview of Domestic Alternatives to STM32 (Part 4)

At the request of readers, Embedded ARM will continue to introduce domestic products that can replace STM32.Today, we present a product that can perfectly replace STM32: the MM32 MCU from Lingdong Microelectronics.MM32 is a global MCU product. Lingdong Microelectronics has established a chip design and operation center in Shanghai, leveraging the complete industrial chain of wafer foundry and packaging/testing in Shanghai to ensure a seamless process from R&D to production for Lingdong MCUs. A software and solution center has been set up in Nanjing, with a 50-person team fully dedicated to the R&D of MCU solutions. In Shenzhen, a sales and technical support center has been established to provide immediate service support to customers. Additionally, an overseas operation and customer service center has been established in Hong Kong, and a marketing and solution center was recently set up in Hsinchu, Taiwan. This multi-site, localized layout allows MM32 to respond quickly and efficiently to a wide range of customers in China.The latest released MM32 MCU product family includes five major product series: the MM32 F series general-purpose high-performance microcontrollers, the MM32 L series low-power wide-voltage microcontrollers, the MM32 W series wireless microcontrollers, the MM32 P series ultra-small package microcontrollers, and the MM32 S series secure encrypted microcontrollers.According to a summary by 21ic forum user Mars Secretary of State, the MM32 has the following highlights:Highlight 1: The Power of MM32FThe MM32F1 has a maximum frequency of 168MHz, Flash/SRAM up to 512KB/128KB, and a rich set of interfaces. It is reported that it will be available in the fourth quarter. Another model, the MM32F0, has a standard frequency upgraded to 72MHz, retaining overclocking potential, which is a significant improvement compared to the typical 48MHz frequency of MCUs. Additionally, the new MM32F031C8T6 series has already achieved deliveries in the hundred-thousand range. Mr. Lou Fangchao stated that in response to the recent supply-demand imbalance in the MCU market, Lingdong Microelectronics promises that as long as there is stock, they will not hoard, ensuring timely delivery while keeping prices stable.Highlight 2: L Series Low Power Wide VoltageThe Lingdong low-power wide-voltage MCU series meets global mainstream low-power MCU standards, featuring an ultra-wide operating voltage range, along with MindSafe’s powerful security features, robust code protection, and data stream encryption.Highlight 3: Wireless MCUSupports wireless connectivity via BLE, OTA (over-the-air upgrades), and sub-1GHz (to be supported in Q1 2018). The MM32 wireless series W0/W3 products are fully pin-compatible with the F/L series and propose the concept of wireless MCUs as direct replacements for general-purpose MCUs, while also advocating for wireless to become a standard interface.Highlight 4: P Series Ultra-Small PackageHighlight 5: MindSafe TechnologyIn addition, Lingdong MM32 has established a rich and mature ecosystem. As Mr. Lou stated, after seven years in the MCU industry, five years have been spent optimizing the ecosystem, highlighting the importance of a well-developed ecosystem for MCU products. This ecosystem includes application documentation, library functions and examples, development evaluation boards, solutions, simulation tools, and online support.Lingdong’s Chief Scientist Liu Qiang stated that based on the Lingdong MM32 development platform, traditional library functions, routines, and peripherals can be seamlessly integrated, providing developers with great convenience, significantly improving development efficiency, effectively reducing development risks, and making development results easy to reuse and maintain. Lingdong will also launch the globally leading SMART agile development platform, elevating local MCU development levels to world standards.

Overview of Domestic Alternatives to STM32 (Part 4)

Words are unnecessary; let’s directly look at some reviews from 21ic users:[MM32 eMiniBoard Review Report] + Bare Machine Multi-Task ProjectUser: BinWinFirst, I would like to thank the manufacturer and the community for providing such a platform and opportunity to directly experience the product. I hope that such vigorous promotion can yield good results and deepen engineers’ impressions of Lingdong, with more products in the future containing Lingdong’s Chinese core.Now let’s take a look at the received item. The entire board is a stable black color, and the layout is quite aesthetically pleasing and tidy, with interfaces close to the board edge, indicating that the designer has considered the details well.Additionally, the onboard MM-LINK debugger includes a virtual serial port, which is very convenient for debugging, as a single USB cable solves both programming and serial printing.With the manufacturer providing programming software, the accompanying debugger can be considered a complete package. The EEPROM memory, CAN controller, and FLASH memory are all onboard, allowing for debugging of SPI and I2C protocols, with three potentiometers connected to the ADC ports. These components allow the board to be ready to use out of the box for initial project debugging.Having said so much, let’s look at some actual photos.Overview of Domestic Alternatives to STM32 (Part 4)It also features a black background.Having showcased the hardware, let’s program a test. Using a timer to design time-slice task polling, adding key detection, LED prompts, buzzer responses, stop mode triggers, and serial printing information tasks, through these code debugging experiences, we can assess the MCU’s development difficulty and peripheral usability, as well as evaluate low power characteristics and stability. Now let’s look at the main code.

#include "main.h"
#define TASKS_MAX 4

typedef struct _TASK_COMPONENTS{
    uint16_t Run;
    uint16_t Timer;
    uint16_t ItvTime;
    void (*TaskHook)(void);
} TASK_COMPONENTS;

static void System_Task(void);
static void Uart_Process(void);
static void Key_Scan(void);
static void AdcTemp_Samp(void);

static TASK_COMPONENTS TaskComps[] = {
    {0, 10, 10, Key_Scan},
    {0, 200, 200, Uart_Process},
    {0, 500, 500, AdcTemp_Samp},
    {0, 1000, 1000, System_Task},
};

void TaskRemarks(void) {
    uint16_t i;
    for (i = 0; i < TASKS_MAX; i++) {
        if (TaskComps[i].Timer) {
            TaskComps[i].Timer--;
            if (TaskComps[i].Timer == 0) {
                TaskComps[i].Timer = TaskComps[i].ItvTime;
                TaskComps[i].Run = 1;
            }
        }
    }
}

void TaskProcess(void) {
    uint8_t i;
    for (i = 0; i < TASKS_MAX; i++) {
        if (TaskComps[i].Run) {
            TaskComps[i].TaskHook();
            TaskComps[i].Run = 0;
        }
    }
}

static void System_Task(void) {
    bsp_LedToggle(1);
}

static void Uart_Process(void) {
    //printf("hello mm32\r\n");
    bsp_LedToggle(2);
}

static void Key_Scan(void) {
    uint8_t ucKeyCode;
    bsp_KeyScan();
    ucKeyCode = bsp_GetKey();
    if (ucKeyCode != KEY_NONE) {
        switch (ucKeyCode) {
            //stop mode, turn off adc, set gpio in case
            case KEY_DOWN_K1:
                printf("\ninto stop mode\r\n");
                for (uint8_t i = 1; i < 5; i++) {
                    bsp_LedOff(i);
                }
                HSI_SYSCLK();
                Sys_Stop();
                break;
            default:
                bsp_LedOff(4);
                break;
        }
    }
}

static void AdcTemp_Samp(void) {
    uint16_t adcVal;
    float Temp;
    adcVal = ADC1_SingleChannel_Get(ADC_Channel_10);
    Temp = 27.0 + (adcVal - 1800) / 5.96;
    printf("\ncpu temp is %.2fC\r\n", Temp);
}

int main(void) {
    Hal_Init();
    printf("\ninto normal mode\r\n");
    for (;;) {
        TaskProcess();
    }
}

When the onboard button K3 is pressed, it enters stop mode. No IO configuration or ADC shutdown operations were performed here. I would like to point out that this board’s standout features are USB and low power. However, there is no convenient interface on the circuit for measuring operating current, or a resistor or ferrite bead that could be used to measure it. After reviewing the schematic, I found none. I conducted a simple measurement of the overall operating current, which includes the debugger circuit and other onboard usage.Overview of Domestic Alternatives to STM32 (Part 4)After powering on, the task begins to run. Before entering stop mode, LED1 blinks at 0.5Hz, LED2 blinks at 1Hz, and the ADC task collects the core temperature, with the serial output shown in the following image, which is quite cool. Overview of Domestic Alternatives to STM32 (Part 4)The project structure is shown below.Overview of Domestic Alternatives to STM32 (Part 4)Establishing and debugging the entire project is still quite convenient compared to other manufacturers, and many of the registers in the library functions are quite similar to those of commonly used MCUs, so friends looking for replacements can give it a try. It can be said that in cost-sensitive and localized applications, using MM32 has significant advantages. Based on the design and resources of the demo board, the manufacturer’s support should also be quite good. This is the overall experience so far, and I will continue to explore detailed content in upcoming small projects.[MM33 eMiniBoard Review Report] + My Review SummaryUser:hu9jj

I was fortunate to receive the opportunity to review the MM32 eMiniBoard. Since receiving this compact and exquisite evaluation board on the 20th of last month, I immediately began the review process. In just half a month, I have tested the ADC, I2C, UART, INT, TIM, PWM routines provided by the manufacturer. For ADC conversion, I also compared the firmware library and register versions, tested enabling DAM for second-order filtering ADC conversion, and multi-channel ADC conversion. I also tested the four onboard buttons using both polling and interrupt methods. Although the K1 button did not test successfully, the other buttons performed well. I also tested the timer and PWM output routines.

In addition to testing the integrated peripherals on the board, I also tested the I2C driver for the DS1307 calendar module, successfully performing read and write operations on the calendar chip. I tested the SPI emulation driver for the LCD_5110 display and tested the one-wire serial communication driver for the JQ8400 voice module, etc.

Through a series of tests, the MM32 eMiniBoard was able to communicate well with the peripherals, demonstrating good adaptability.

This was my first encounter with Lingdong’s MCU products. Through the testing activity, I gained a certain understanding of the MM32. During the testing process, I did not find any significant differences compared to mainstream similar products, proving that domestic MCUs are also excellent in ordinary applications. Among the materials provided by the manufacturer, the most commendable aspect is that they provide both firmware library and timer versions, which greatly facilitates beginners like me who are preparing to learn register programming. After a simple comparison of the ADC routine, I found that the register version has significantly less code than the firmware library version for the same functionality, and the running efficiency is also higher.

However, during the testing process, I also discovered some shortcomings in the materials provided by the manufacturer, such as the LED numbering in the code being opposite to the circuit diagram and the board’s silk screen, the pin definitions in the button routine not matching the actual ones, and the excessively long timing in the TIM1 routine affecting the testing results. These phenomena indicate that the manufacturer needs to strictly control the quality of the materials provided. All routines should be tested on the specified board before being provided to everyone, which would give everyone a better experience.

Although this test is not yet complete and comprehensive, based on the results, the MM32 performs quite well, and I personally believe it can be considered as one of the options for product development. The development of domestic MCUs has a long way to go and needs everyone’s support. I also hope that Lingdong can further improve the materials and provide everyone with cost-effective MCU products.

In terms of specific evaluation:

After eagerly waiting for many days, I had not received any information from the courier. This morning, I couldn’t help but email to inquire about the tracking number, and in the afternoon, I received it. Below is the full view of the evaluation board—elegantly black:Overview of Domestic Alternatives to STM32 (Part 4)This is the back of the evaluation board—clean and tidy:Overview of Domestic Alternatives to STM32 (Part 4)The board has a download/debug interface and a USB interface, as well as a three-wire serial port (including GND) and a CAN communication interface. I eagerly connected the download/debug interface, and with a short beep, the four different colored LEDs on the evaluation board began to blink at different frequencies—vibrantly colorful:Overview of Domestic Alternatives to STM32 (Part 4)After receiving the evaluation board and powering it on for testing, the next essential task is to establish the development platform and my testing program. The relevant materials had already been downloaded, just waiting for the evaluation board to arrive to get started, everything was ready, just waiting for the right moment.1. Establishing the Development PlatformI used Keil 5.28, first running the MindMotin.MM32L0xx_DFP.1.0.9.pack upgrade package to add the relevant parameters of the MM32L0xx system to Keil. At this point, Keil can recognize the mm32L0xx series MCUs.Overview of Domestic Alternatives to STM32 (Part 4)Overview of Domestic Alternatives to STM32 (Part 4)Then I ran the mm32_devkit.setup.exe program to add mm32-LINK, at which point Keil can select mm32-LINK, allowing for code downloading and programming.Overview of Domestic Alternatives to STM32 (Part 4)Overview of Domestic Alternatives to STM32 (Part 4)I am using the WIN10 system, so I only need to do these two steps. It is said that if the code still cannot be programmed normally, then run the mm32_usb_setup.exe program.It is important to note that the above programs need to be run with administrator privileges; otherwise, installation may fail.2. Establishing the Testing ProgramThe manufacturer’s resources include both firmware library and register versions of various peripheral routines, which can be directly used for testing. I simply copied one of the routines into my project directory and modified it to create my testing project.After moving the project, the include paths and some file paths in Keil need to be modified. To keep the project resources self-contained and easy to copy to other computers, I also copied the Device folder into the project files. Modifying the include paths is relatively easy and can be done directly in KEIL, as shown below:Overview of Domestic Alternatives to STM32 (Part 4)Modifying the library file paths is more troublesome. One method is to delete and re-add them, but this is prone to missing files. I opted to modify the paths of each file individually. In the project file list box, right-click on the file name with an exclamation mark:Overview of Domestic Alternatives to STM32 (Part 4)In the pop-up menu, select the first line:Overview of Domestic Alternatives to STM32 (Part 4)In the modification window, change the path:Overview of Domestic Alternatives to STM32 (Part 4)This is the modified path:Overview of Domestic Alternatives to STM32 (Part 4)After modification, the exclamation marks in the project file list box disappeared. Once all exclamation marks are gone, the path modification is complete.Next is writing the testing code. Like most testers, I started with lighting up an LED, choosing a running light. The main program code is as follows:

#include "delay.h"
#include "sys.h"
#include "uart.h"
#include "adc.h"
#include "led.h"

uint8_t ledn;
/**********************************************************************************************************
函数信息 :main(void)
**功能描述 :**
输入参数 :**
输出参数 :**
    备注 :********************************************************************************************************/
int main(void) {
    delay_init();
    LED_Init();
    while (1) {
        switch (ledn) {
            case 0:
                LED1_ON();
                LED2_OFF();
                LED3_OFF();
                LED4_OFF();
                break;
            case 1:
                LED1_OFF();
                LED2_ON();
                LED3_OFF();
                LED4_OFF();
                break;
            case 2:
                LED1_OFF();
                LED2_OFF();
                LED3_ON();
                LED4_OFF();
                break;
            case 3:
                LED1_OFF();
                LED2_OFF();
                LED3_OFF();
                LED4_ON();
        }
        ledn++;
        if (ledn > 3)
            ledn = 0;
        delay_ms(100);
    }
}

The code compiled successfully, with 0 errors and 0 warnings:Overview of Domestic Alternatives to STM32 (Part 4)Code download and programming completed:Overview of Domestic Alternatives to STM32 (Part 4)Finally, the testing effect: the LED lights up sequentially.Overview of Domestic Alternatives to STM32 (Part 4)More processes can be seen at:https://bbs.21ic.com/icview-2968410-1-1.html?_dsign=50d64354Performance Introduction of Lingdong Micro MM32 eMiniBoardUser: Mars Secretary of StateShanghai Lingdong Microelectronics is a domestic supplier focused on MCU products and application solutions, dedicated to providing high-performance, high-quality 32-bit MCU components. Lingdong has completed hundreds of product designs to meet the diverse application needs of customers and the market across various fields and levels. Lingdong Micro’s primary distributor introduces relevant materials for the MM32 eMiniBoard.MM32 eMiniBoard (MCU model: MM32L073PF), photos and introduction of the MM32 eMiniBoard development board.MM32 eMiniBoard Introduction: MM32L073PF (Cortex-M0 MCU: 128k FLASH, 8k SRAM); onboard SPI Flash chip; onboard IIC EEPROM chip; onboard CAN conversion chip; onboard passive buzzer; equipped with 3 VR; equipped with 4 LEDs; equipped with 4 KEYS; all peripheral IOs are brought out for convenient and quick module testing.Dual USB interfaces, USB-1 supports USB emulation, downloading, and debugging, USB-2 supports USB device and power supply; onboard MM32-LINK OB can perform online emulation, debugging, and downloading for the main MCU; supports Keil uvision/IAR EWARM development environments.Overview of Domestic Alternatives to STM32 (Part 4)The MM32L073F product uses a high-performance ARM® Cortex®-M0 as the core 32-bit MCU, with a maximum operating frequency of 48MHz, and built-in high-speed memory, rich enhanced I/O ports, and peripherals connected to the external bus. The product series operates at a voltage range of 2.0V to 5.5V, with a temperature range of -40◦C to +85◦C for standard types and -40◦C to +105◦C for extended types. Multiple power-saving operating modes ensure low-power application requirements. Suitable for applications in motor drive and application control, industrial, etc.

Lingdong Micro’s New Product MM32F0010: The Best Solution to Replace 8-bit MCUs

User: Wang Xiaoqi

Overview of Domestic Alternatives to STM32 (Part 4)

Overview of MM32F0010The new product MM32F0010 from Lingdong Microelectronics uses a high-performance 32-bit microcontroller with an M0 core, with a maximum operating frequency of 48MHz, built-in high-speed memory, rich enhanced I/O ports, and peripherals connected to the external bus. The MM32F0010 series operates at a voltage range of 2.0V to 5.5V, with a temperature range (ambient temperature) of -40◦C to 85◦C for standard types and -40◦C to 105◦C for extended types (V). Multiple power-saving operating modes ensure low-power application requirements. It is available in two package forms: QFN20 and TSSOP20. Lingdong Micro’s primary distributor, Yingshang Microelectronics, can provide development boards, routines, and necessary FAE support and other product services.Depending on the different package forms, the peripheral configurations in the device vary. These rich peripheral configurations make this microcontroller suitable for various applications such as motor drive and application control, medical and handheld devices, PC gaming peripherals and GPS platforms, industrial applications, alarm systems, video intercoms, and HVAC systems.Overview of Domestic Alternatives to STM32 (Part 4)QFN20 Pin DistributionOverview of Domestic Alternatives to STM32 (Part 4)TSSOP20 Pin DistributionARM Cortex-M0 Core with Embedded Flash and SRAMThe ARM® Cortex®-M0 processor is the latest generation of embedded ARM processors, providing a low-cost platform for MCU needs, reduced pin count, lower system power consumption, while delivering excellent computational performance and advanced interrupt system response.The ARM® Cortex®-M0 is a 32-bit RISC processor that offers additional code efficiency, leveraging the high performance of the ARM core on the storage space of typical 8 and 16-bit systems. The MM32F0010 has a built-in ARM core, making it compatible with all ARM tools and software.Embedded Flash MemoryUp to 16K bytes of embedded flash memory for storing programs and data.Embedded SRAMUp to 2K bytes of embedded SRAM.Low Power ModesThe product supports low power modes, achieving an optimal balance between low power consumption, short startup time, and various wake-up events.Sleep ModeIn sleep mode, only the CPU stops, while all peripherals remain operational and can wake the CPU upon an interrupt/event.Stop ModeIn stop mode, the lowest power consumption can be achieved while retaining the contents of SRAM and registers. In stop mode, the HSI oscillator and HSE crystal oscillator are turned off. The microcontroller can be awakened from stop mode by any signal configured as EXTI, which can be one of the 16 external I/O ports or a wake-up signal from the PVD output.Standby ModeStandby mode achieves the lowest system power consumption. This mode turns off the voltage regulator while the CPU is in deep sleep mode. All power supply areas of the internal 1.5V section are disconnected. The HSI and HSE oscillators are also turned off, and the CPU can be awakened and reset by the rising edge of the WKUP pin, an external reset from the NRST pin, IWDG reset, or watchdog timer wake-up.SummaryGeneral-purpose MCUs may seem simple, but they are actually a complex product system. The characteristics of MCUs are not only about simple replacement but also about product quality, supply assurance, and support services, requiring extensive cooperation and support from partners.From the perspective of Lingdong Micro’s products, they cover various demand scenarios across five series, and the overall ecosystem shows that Lingdong Micro provides a rich variety of support. However, a common issue remains in documentation, but I believe that in the process of localization, Lingdong Micro will continue to improve.Appendix: Lingdong Micro Ecosystem Diagram

Overview of Domestic Alternatives to STM32 (Part 4)

Overview of Domestic Alternatives to STM32 (Part 4)Overview of Domestic Alternatives to STM32 (Part 4)Overview of Domestic Alternatives to STM32 (Part 4)Overview of Domestic Alternatives to STM32 (Part 4)

ENDSource: 21ic Forum, Compiled by Fu BinRecommended ReadingCan domestic MCUs replace foreign products? What does the future hold for MCUs?In the face of skyrocketing STM32 prices, let’s review domestic alternatives to STM32.Choosing a microprocessor MPU or a microcontroller MCU? A detailed explanation of the differences between the two.

Leave a Comment