All Projects → MCU-ZHISHAN-IoT → HML_FwLib_STC89

MCU-ZHISHAN-IoT / HML_FwLib_STC89

Licence: WTFPL license
A lite firmware library for STC micro STC89 series MCU based on SDCC complier | 基於SDCC編譯器實現的針對宏晶微电子(STC Micro)STC89系列單晶片的輕量級固件庫

Programming Languages

c
50402 projects - #5 most used programming language
Makefile
30231 projects
CMake
9771 projects

Projects that are alternatives of or similar to HML FwLib STC89

HML FwLib STC12
A lite firmware library for STC12 series MCU
Stars: ✭ 15 (-63.41%)
Mutual labels:  sdcc, 8051, stc-mcu
FwLib STC8
A lite firmware library for STC8G/STC8H series MCU
Stars: ✭ 32 (-21.95%)
Mutual labels:  sdcc, stc-mcu
S51 UTF 8 FontLibrary
UTF-8 font dot matrix data is saved through external FLASH
Stars: ✭ 30 (-26.83%)
Mutual labels:  8051
stm8-bare-min
Tiny peripheral library for STM8 microcontrolles
Stars: ✭ 103 (+151.22%)
Mutual labels:  sdcc
stm8s-sdcc-examples
Example codes using sdcc to target STM8S MCUs.
Stars: ✭ 31 (-24.39%)
Mutual labels:  sdcc
libasm
C++ library of assembler / disassembler that can run on embedded system
Stars: ✭ 23 (-43.9%)
Mutual labels:  8051
tobutobugirl-dx
An arcade platformer homebrew game for the Game Boy, Game Boy Color and Super Game Boy
Stars: ✭ 58 (+41.46%)
Mutual labels:  sdcc
CH552
L1 R1:WCH 24MHz MCS-51 USB MCU (CH552T/CH552P/CH552E/CH552G/CH551G)
Stars: ✭ 32 (-21.95%)
Mutual labels:  8051
xForth
Experimental Forth cross compiler for tiny devices
Stars: ✭ 53 (+29.27%)
Mutual labels:  8051
platform-intel mcs51
Intel MCS-51 (8051): development platform for PlatformIO
Stars: ✭ 40 (-2.44%)
Mutual labels:  8051

HML_FwLib_STC89

Jenkins GitHub repo size GitHub GitHub tag (latest by date)

What is HML_FwLib_STC89

HML_FwLib_STC89 is a important member component of HML firmware library, providing a group of interface functions for users to operate on-chip resource of STC89 MCUs, including GPIO, ISP, timer, UART, external interrupt and watchdog. The STC89 MCU is a kind of Intel MCS-51 based MCU which released by STC Micro(宏晶), and it's one of the most widely used MCUs series in Mainland, China. This series MCU have more on-chip resource than classical 8051 MCU.

We intend to provide a lite and easy-use firmware library that can help future developers to complete projects based on STC89 MCUs more easily and quickly. All source codes are written in C language and for SDCC compiler, i.e., it can only be compiled by SDCC. This choice is motivated by the fact that SDCC is free and highly efficient, while there are very few examples of application about SDCC on the Internet. We hope that, as one of the early attempts to develop MCU projects using SDCC, this work will make SDCC become more popular among MCU developers.

Please visit detail page for more information to get started it!

Feature

  • 🎯Based on SDCC compiler.
  • Cover all on-chip resource of STC89 series MCUs.
  • Open all source code on Github and licensed under the WTFPL2.
  • Readable code and provide examples to help you get started it.
  • Attached Makefile offers a good reference for developers.

What's working

Here is a list of the all on-chip peripheral drivers and examples that need to be ported.

Peripheral Description Status
extended bus Intel 8080 bus receiver/transmitter supported
EXTI extern interrupt supported
GPIO I/O peripheral supported
ISP internal EEPROM supported
RST reset control supported
TIM timer supported
UART universal asynchronous receiver/transmitter supported
WDT watchdog supported

Config

There are several parameters with compile macro format need to be configured by user manually. They are all defined in hml/conf.h.

__CONF_COMPILE_xxx (for conditional compilation)

In order to ensure the projects based on HML_FwLib_STC89 can run on STC89 MCUs with limited on-chip flash space, the developers can modify value of the macro definition named __CONF_COMPILE_xxx in hml/conf.h as 0 to specify which piece of code will not take part in compilation, then it will reduce size of .hex file finally. If user only use GPIO module, then user just need to enable __CONF_COMPILE_GPIO macro in hml/conf.h. Some macros for conditional compilation rely on others. For example, before you enable the macro definition __CONF_COMPILE_UART, the macro __CONF_COMPILE_TIM and __CONF_COMPILE_TIM2 should be enabled, otherwise the compilation would be failed.

__CONF_FRE_CLKIN

This macro marks frequency of clock source, including extern crystal oscillator or internal RC oscillating circuit, and it's defined in conf.h.

__CONF_MCU_MODEL

This macro marks the model of target MCU and is defined in hml/conf.h.

__CONF_MCU_PRESCALER

This macro is used to specify MCU prescaler factor. The value must be 6 or 12, and they stand for 6T mode and 12T mode.

Above macros can be set via make command line interface variable or a config Makefile (refer to default config file usr/Makefile.config).

Building

We provide two kinds of build system support:

  • cmake
  • gmake

cmake

Run this command for initialization. Add option -GNinja if you expect to build project via Ninja.

$ cmake -S . -B build

Run this command for building project. Add option --clean-first if you want to execute clean operation before building.

$ cmake --build build -j$(nproc)

You can execute command cmake --build build -t usage for usage. If you want to adjust build details, please modify cmake/config.cmake.

gmake

There is a source file named test.c under usr directory, we have put a main function here. Execute this command for building HML_FwLib_STC89 with GNU Make.

$ make -j$(nproc)

You can execute command make help for usage. If you want to adjust build details, please modify mk/config.mk.

Contributing

Welcome PR or issues from you! Please read our CONTRIBUTING.md

License

HML_FwLib_STC89 is licensed under the WTFPL2.

Team

member role e-mail
Amy Chung Testing [email protected]
Jiabin Hsu MCU developer [email protected]
Weilun Fong Director [email protected]
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].