STM8 MCU learning summary 01

Publisher:as8849402Latest update time:2017-10-23 Source: eefocusKeywords:STM8 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Due to an accident, I came into contact with STM8. I mainly used STM32 before. At some point, I did feel that STM8 was more convenient to use.

Although STM8 is an 8-bit single-chip microcomputer, it can support mainstream peripherals, especially its built-in ADC and PWM. The price is also very touching, about "1.20RMB/PSC". From the perspective of cost saving, it is a great temptation for both R&D and companies, and the cost performance is quite high. Even the first generation of "51 single-chip microcomputer" does not have much advantage compared with it, but "51 single-chip microcomputer" is indeed the "best choice" as an "entry-level single-chip microcomputer";

The mainstream "single-chip microcomputers" now support the use of "library" development methods. If you use "library" from the beginning, you may get stuck in the later stage. Because you don't understand "bit operation" and "register operation", it is difficult to do "what you want" in the subsequent "coding". You may need to go through a lot of circles to realize a simple function, while "bit operation" can be realized with just a few simple codes.

-------------------------- Gorgeous dividing line 1-------------------------

Recently, a very lazy friend said that he "didn't want to get up to turn off the lights when lying in bed" and wanted an automatic lamp that could be controlled by a mobile phone. He had an old "Bluetooth module" and didn't want to spend more money on other things. It would be best if the price was around 10.0 yuan, otherwise he would be reluctant to "cut meat"; since the "main body" was completed by himself, this price seemed possible, so I gave it some preliminary thought;

i) "Power supply part": The overall power consumption is not large, and the "Micro USB" interface can be used directly for power supply, and a "mobile phone charger" can be used;

ii) If the purpose is "lighting", it is recommended to use "LED full-color lamp" or "LED single-color lamp". The price error shall not exceed 1.0 RMB if calculated as "single-color".

iii) "with program control", it is necessary to introduce a "single-chip microcomputer", combined with the "lighting" requirements, retain the "user button", it has low requirements for "peripherals", "GPIO", etc., and low real-time requirements, so a low-end "single-chip microcomputer" can be considered;

iv) "Bluetooth module": the other party already has it, so a "communication interface" is reserved for it;

When I first listed the plan, I thought of "STM8" and the general bill was as follows:

i) "STM8 master control": 1.3 RMB;

ii) PCB board: Made of 15.0cm*15.0cm “panel”, the total price is about 96.0RMB, there are 15 boards, the unit price is about 6.4RMB;

iii) “2 power LED lights”: total price is about “4.0RMB”;

iv) "Other accessories": about "1.5RMB", no more, no less;

v) "Others": "Schematic diagram", "PCB board diagram", "welding" and "driver code" were all completed by myself, which took about "1 day" and cost "0.0RMB";

After calculating the total price, it was about "1.30+6.4+4.0+1.5+0.0=13.2RMB", which was a bit over budget. After asking, they said "you can cut down", after all, a few dollars means you can go hungry for a meal.

--------------------------Gorgeous dividing line 2-------------------------

From college to now, after “accumulating for several years”, I have already had my own “library”, basically I can “have whatever I want”. If I come across something I don’t have, that’s actually a good thing, because it can further improve my “library”.

Start drawing the "schematic diagram" and "PCB board diagram". It should take less than "6 hours" to make it in your spare time. The overall frame paper is as follows:

STM8 MCU learning summary 01

After that, the "PCB board" took "about 5 days". During this period, the control "driver code" was written. The subsequent debugging is expected to take "less than 1 day". The actual PCB board is as follows. Please forgive me for watching it:

STM8 MCU learning summary 01

Note 01: "V-Cut" is used for "paneling" instead of "stamp hole", mainly because I want to keep the "rounded corners" for "single PCB board". Considering that I will be soldering myself, I don't want to be stabbed by the "PCB board" during "soldering";

I will write about welding and code debugging next time. This time, when I made the "PCB", I really felt the "magic" of "platemaking". In some "occasion", "platemaking" is really amazing, and the "cost price" has dropped sharply.


Keywords:STM8 Reference address:STM8 MCU learning summary 01

Previous article:Explain the characteristics of the I2C bus and how to implement it in a microcontroller
Next article:STM8 MCU learning summary 02

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号