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:
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:
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.
Previous article:Explain the characteristics of the I2C bus and how to implement it in a microcontroller
Next article:STM8 MCU learning summary 02
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Summary of national competition experience sharing
- How to understand the equivalent of capacitors passing AC
- [NXP Rapid IoT Review] +6. Guide to Translation Display Elements
- MicroPython driver porting for STTS751
- Please recommend a PAL video signal equalization chip or amplifier chip
- [RVB2601 creative application development] SVM40 UART communication implementation
- EEWORLD University ----TI Precision Laboratory - Isolation
- Fighting back against India? It is said that Huawei will lay off 70% of its employees in India...
- New courses are online at the beginning of the school year! Learn the latest TI training courses and win gifts
- This week's highlights