Disastrous consequences of low-cost electronic research and development

As a veteran of electronic R&D, in the face of various complicated problems, it is common practice to work overtime, and it is normal to rack your brains and even go crazy. It's often found that when the project progresses to the point where you want to get rid of the device, you will succeed if you stick to it. But there is a project because of persistence, and now I always feel depressed and depressed.

In 2006, I worked on the development and production of dynamic tokens at Shanghai Zhonghao Information Technology Co., Ltd. The company is a pure software company and there is no hardware department before I join the company. As a hardware manager, responsible for creating teams, prototype development and subsequent mass production. The work pressure is great, but the working atmosphere is very good and the colleagues get along very well.

At that time, the technology of dynamic tokens was rapidly promoted and applied in various industries. It was mainly used to ensure the security of network login for multinational enterprises. In 2002, it was first contacted by NS FAE. The pioneer of this technology was RSA, then NS. It is RSA customized. Later, as the bank's account password was often stolen, major banks also began to promote dynamic ciphers; in those years, online games were extremely hot, followed by game account security issues, and several sensational incidents due to hacking. In the lawsuit, online game companies began to adopt dynamic tokens to protect the security of game accounts.

At that time, there were not many companies engaged in the development and production of dynamic ciphers in China, and there were fewer companies with independent intellectual property rights. The founder of the company is the returnee of Cambridge University, and has the core patent technology of dynamic password based on SHA256 algorithm. At the time, SHA256 was more advanced than other companies' technology. The company's investors are IDG and 5173.

My main job at the time was to implement a dynamic cipher based on the SHA256 algorithm using a suitable microcontroller. The SHA256 algorithm is quite complex, with a large number of matrix and regression iterative operations. The following difficulties exist for the implementation of time-based dynamic tokens by the microcontroller:

1. Larger RAM space;

2, high-speed computing capabilities;

3, ultra low power consumption;

4, ultra high reliability;

5, ultra low price;

Due to the conflict between the above items, it is very difficult to meet these contradictory needs at the same time.

I first implemented the algorithm in C language programming on the PC. After simulation, I found that the minimum requirement of RAM is at least 2KB. If I transplanted to the MCU and added various initialization and control codes, the RAM requirement is close to 3KB. In 2006, I can A microcontroller with 3KB of RAM is extremely rare and extremely expensive. As a last resort, I chose to use assembly language programming, using a lot of programming skills, such as using program space for RAM space, multiple iterations of RAM dynamic allocation and recovery, etc. It took a week to reduce the RAM requirement to 409 bytes, because there was already A lot of single-chip RAM space reaches 512Byte, completely solve the problem of insufficient RAM space.

The hardware uses laser-welded lithium battery and crystal matching and overall fixing. Due to the assembly language used in software, the calculation efficiency and reliability far exceed C language programming; the average power consumption of deep sleep technology is reduced to 3.4uA, a CR2032 The battery can work for more than 3 years and meets the ultra-low power requirements.

At that time, there were three MCUs that met the technical requirements, namely 8-bit machines from TI and Taiwan, and 16-bit machines from Fujitsu. Due to the ultra-low price requirements, we chose Taiwanese MCUs.

Soon the prototype came out, the function and performance test was OK, the 1K sample produced the function and performance are OK, but after a period of time, it was found that there is a certain proportion of the prototype power consumption, the battery will soon have no electricity. Unpacking the test, no abnormalities, normal function after changing the battery; during the period, the crystal oscillator is stopped, the battery is loose, the static electricity is disturbed, the circuit board is abnormal, the software runs away, the chip is bad, etc.; the technology of the supplier and the agent is requested many times. The personnel analyzed together and even sent the physical objects to Taiwan to ask the original factory for analysis. The conclusions were that no abnormalities were found.

In the test analysis and unremitting persistence, I successfully ported the code to TI and Fujitsu's MCUs separately, but at this time, the domestic manufacturers of dynamic ciphers began to increase. They used the previous generation of simple encryption algorithms, although they were safe. Not enough, but the requirements for the microcontroller are very low, and there is no difference in appearance. Under the pressure of cost, the new MCU import work has not been carried out at the company level, the production orders began to flow, and the custom 50K Dice film was masked.

After a long time of persistence, through the investigation of 500 sets of samples, it was finally found that because of the inherent BUG of the MCU, the P64 pin IO port register configuration will reverse during the sleep period, and the high and low levels will start to discharge quickly once inverted.

The problem was clarified, but the losses for the company were already huge, including customer churn and word of mouth. This is the most difficult problem to reproduce, the most difficult to simulate, and the most difficult to analyze since I worked. It is also the most influential problem for the company.

The main lessons are as follows:

1. Over-consideration of low-cost solutions during the development phase of the prototype often leads to catastrophic consequences. Priority is given to the completion of technical verification and production and sales of large brand products with good reputation, and then gradually reduce the cost;

2. If the hardware problem is not solved, if there is no progress after a period of time, it is necessary to stop the loss in time and switch between different schemes. At this time, the insistence on sticking will often pay a more painful price;

3, the surface hardware problems are sometimes caused by software configuration, but the deep-rooted reasons may be hardware defects, especially in this difficult problem to reproduce;

4. Don't be superstitious about chip companies. The so-called original technical support is actually limited. The so-called analysis report is sometimes nothing more than an excused excuses, and this deep-seated problem is hard to blame.

Switching Wall Charger

Switching wall charger


AC wall 5V 2A power adapter with multiple tips works for many small 5V electronics. Like Scanner, Router, Bluetooth speaker, Foscam Wireless IP Camera, CCTV camera, USB hub, bluetooth GPS Receiver, tv box, tablets, Baby Monitor, Graco Swing, Home Phone System, VoIP Telephone Routers, Serato DJ Controller, DVR, ADSL Cat, External battery, hubs, switches, Led Strip, String Lights, vibrator, Raspberry pi 3 Raspberry Pi A/A+/B/B+ Raspberry Pi Zero and more 5V devices. (5V ONLY)


Worldwide Input: 110-240V; Output: 5V 1000mA, 1.5A, 1.75A, 5V 1A, 5V 500mA, 5V 2.1A, Max 10W. DC Tip Polarity: Central Positive(+). Please read manual carefully before using 5vdc power supply.


MULTIPLE TIPS - Selected various popular connectors, this AC adapter can power most of your 5V DC charging devices. Providing you more power choices. DC Tip Dimensions: 3.0x1.0mm, 2.5x0.7mm, 3.5x1.35mm, 5.5x2.5mm, 5.5x2.1mm, 4.0x1.7mm, Micro USB
Design-safeguard features against incorrect voltage, short circuit, internal overheating and overloading. This 5v Ac power supply charger is made from quality material to ensure the long lifetime. Power your 5v electronics perfectly and replaces lots of 5 volt power chargers
Package include: 1 x High Quality 5V 2A AC DC Power Adapter, 1 Set x Tips

5V Switching wall charger 6V Switching wall charger 9V Switching wall charger 12V Switching wall charger 15V Switching wall charger 19V Switching wall charger 24V Switching wall charger 36V Switching wall charger 48V Switching wall charger

Shenzhen Waweis Technology Co., Ltd. , https://www.waweisasdapter.com

Posted on