The chip driver is normal, and there is no problem in implementing the functional application separately. However, when it was transplanted to the main program, the clock display stopped, the touch screen failed, and the parameter display had problems.
Reason:
In the development of the chip driver, a problem was ignored. That is, the IO resources occupied by the chip pins should not change the normal function of other pins during initialization. The functions of the remaining functional pins were artificially changed when the chip was initialized. The function of its multiplexing function was changed to an output pin. Only the IO pins when the chip was working normally were paid attention to, and the multiplexing status of the remaining IO ports was ignored. After that, the initialization operation of IO in the original main program was analyzed one by one, and the problem was found by comparing one by one.
Solution:
Reinitialize the interface and retain the function multiplexing of the remaining pins.
Summary:
Work carefully and don't take it for granted. Stay calm after a problem occurs. It is wrong to bite people, haha. . .
1.
The timing requirements of the delay chip are very strict. The most basic time unit must be very accurate, accurate to the microsecond level. This is the basis for subsequent work. Because C language is used for programming, it is not very good to control the length of the delay. Therefore, the test method is used. In order to minimize the error as much as possible, the test time is extended. The basic idea is to print the time on the screen after a certain delay, and analyze the relationship between the interval between the two times and the specific delay parameters. For example: when the delay parameter is 60000000, is the time interval between the two times less than 1 minute? [Note: 60000000us=1min]
2. Verification of chip read and write operations
Perform chip self-verification, write data to the fixed bytes of the chip register, and then read it out byte by byte to compare whether the written and read data are the same.
3. The necessity of non-volatile operation
RAM data register is used for internal calculation and data access, and the data is lost after power failure. In order to save the data information that needs to be saved for a long time, the relevant data information needs to be copied from the register to the EEPROM.
After power-on reset, the chip automatically copies the relevant bytes in the EEPROM to the RAM.
4. Necessity of non-essential operations
When the chip reads, first read the lower 8 bits of the data, then read the upper 8 bits of the data. Whether it is the lower 8 bits or the upper 8 bits, they are read one by one from the lowest bit. Even if the lower bits are unnecessary bytes, they must be read out. This is called a rule.
Previous article:A high-precision and low-cost temperature measurement solution
Next article:error:undeclared name solution
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- 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
- Have you replaced your instrument with a touch screen today?
- [Event Posting Summary] Prize-giving Event: Show off your electronic collection
- Enable TI 15.4-Stack to support 470M frequency band
- A problem in the high-frequency equivalent circuit of transistors
- MSP430 program library digital tube display
- Harmonics and Suppression Analysis of Switching Power Supplies
- When downloading the program to the flash of the SM320F2812 chip, the buttons on the On-Chip Flash Programmer interface are all gray.
- Showing off my products + my entire fortune
- Is there any professional term for the switching power supply marked with a red circle in the picture?
- The most annoying thing about making a power supply is drawing the board yourself