当前位置:网站首页>Eating this open source gadget makes MCU development as efficient as Arduino

Eating this open source gadget makes MCU development as efficient as Arduino

2022-04-21 17:56:00 Dafang single chip microcomputer

Eat this open source gadget , Let MCU develop and Arduino As efficient as ( All Chinese Notes )

8fa2fced9f0b22917293843fb993ca39.png

Whether you are a novice in SCM , Or an electronic  DIY Lovers , Or is it an engineer interested in embedded development , Today's open source project is worth watching .

/// Insert a : At the beginning of this year, I recorded a set of systematic introductory single chip microcomputer tutorial , If you want, just ask me for it. It's free , I can send a private message ~ You can also get it by clicking my avatar in black font and adding my earth . I've been relatively idle recently , Take me to finish the design , Take students to provincial or above competitions ///

Text begins :

ECBM What is it? ?

ECBM, Is based on  STC8 MCU peripheral function library , And it's also “Everything Can Be Module( Everything can be modular )” For short .

The project author once said on his personal platform , He believes that regardless of software 、 The hardware can be modularized , And only need to build the wheel once .2017 From the year onwards , Based on the modular design concept , This paper proposes to establish a software system of module + Hard products , If you want to judge one day “ Why is the house so stuffy today ” when , According to the humidity module + CO2 modular + The main controller analyzes the cause .

thereafter , The author learned the official library of each single chip microcomputer factory , Understand the program structure of software , Select the appropriate carrier . After practice , The author found that the official library of single chip microcomputer can be divided into two categories : One is by DIY Enthusiasts write simple packages into functions , Write what you use , The style is chaotic and easy to conflict , There is no good system ; The other is written by engineers , Although there is a good framework , But because of the English notes 、 English documents, complex file structure and code rules are prohibitive for novices .

Holding other products that don't meet the demand , Just the idea of making your own wheels ,ECBM The birth of , After several years of technical iteration , at present , The project has been released to  V3 edition .

characteristic

· be based on  C Language , Write in a unified style

· have  KEIL characteristic , Can be applied to graphical editing tools

· The running speed of the code is improved , big data

· Support multi device multiplexing , arbitrarily  IO Can be driven

· All Chinese Notes , It's in line with the habits of Chinese people

· The code can be clipped , It can be installed into a smaller single chip microcomputer

· The current support  STC8 The whole series of single chip computers

Preparation

Before use, you need to ensure that the software 、 The programs have been downloaded and installed , For specific links, please contact me .

Operation process

newly build

Double click new project .bat, newly build test engineering

c3ee15f062b7f4822798c2aa085960c3.png

Get into  ecbm_test Folder , open  ecbm.uvproj, Programming begins

Be careful : Input English or Pinyin in the interface , because Keil Low support for Chinese , Chinese characters... Are not recommended here

Design the correct model of single chip microcomputer

STC8 The series currently has F、A、G、H、C These series , their 8051 The registers are consistent , But expansion 8051 The function registers are different , Therefore, the model of single chip microcomputer must be set correctly , To access the correct register .

Method : stay  Keil Left side  LIB_LIST Find below  ecbm_reg.h, Double-click to open ecbm_reg.h. Then click in the lower left corner of the window  Configuration Wizard The tag enters the graphical configuration interface .

8f9e763bc627d7ae0201e514b2f85d5d.png

Why? STC8 Single chip microcomputer ?

· The library requires universality , In order to ensure universality, you can't optimize for running speed . This requires the use of a high-speed 51 Single chip microcomputer .

·STC8 In integer calculation, it is slightly lower than stm32f030( At the same operating frequency ), Slightly higher than... In floating-point calculations stm32f030( Also under the same operating frequency ).

Set clock parameters

open ecbm_core.h, Enter the graphical configuration interface . stay 【 MCU system clock 】 Under the 【 SCM system clock setting 】 Choose the option you want .

for example : The author uses  STC8A8K64D4, stay  STC-ISP Set up in  40MHz The frequency of , Because more than  30MHz And my application is that swiping the screen must work at a high frequency . So I choose “ Internal high speed clock  HSI( Customize )”, Save hundreds of bytes first , Then fill in the frequency  40000000.

As shown in the figure :

148985228c53f2922d103d37962772d2.png

File structure

53c97b3b33336b81b25de0be507014be.png

版权声明
本文为[Dafang single chip microcomputer]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204211748023232.html