I originally wanted to use the SMBus port of the microcontroller, but the official example used several timers, and my small project also needs a lot of timers.
The timer resources are not enough. So I just use the IO port to simulate the I2C timing to operate the FM24C04. The project is not strict on time.
carve.
Therefore, the question that this article will introduce arises:
When drawing the schematic diagram, the SDA/SCL port of SMBus (corresponding to P0_0/P0_1) has been connected to the SDA and SCL of FM24C04.
So according to the normal operation, I enabled SMB0E of XBR0 and connected it to the port. Then I set the corresponding IO ports P0_0 and P0_1 to open drain.
Road, it should be OK, right? Actually not, the data read during operation is always 0xFF, it may be high impedance state.
I checked the read and write operation codes and found no problems. I also couldn't change the timing by increasing or decreasing the delay. So I suspected that there was something wrong with the crossbar switch.
After thinking about it, I thought, since I am using analog timing, why should I set it to open drain? Why should I configure the port to SMBus? Isn't push-pull also
Is it possible? So as shown below, set SMB0E to zero. Burn, debug and run, read and write are OK. In addition, the corresponding IO port settings
Open drain or push-pull can operate normally.
Previous article:Using IAR for 51 to simulate binary addition and subtraction with LED lights
Next article:MCP41010 digital potentiometer driver source code based on C8051F310
Recommended ReadingLatest update time:2024-11-16 20:56
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
- CC1101 433 wireless module, STM8 serial port transparent transmission
- STM32F103 project of LPS33HW
- New Shortlist | 2020-2021 ON Semiconductor and Avnet IoT Creative Design Competition
- [#Ren Zhengfei responds to hot topics#: We cannot narrowly think that loving Huawei means loving Huawei phones]
- How to burn flash of DLPC4422? Does source code engineering require TI authorization?
- NRF52832 Minimal System Debug
- [Anxinke NB-IoT Development Board EC-01F-Kit] V. Comprehensive Test
- 【Beetle ESP32-C3】VII. Network timing and weather request (Arduino)
- If anyone has a Concise Mechanical Manual, please send me a copy. I'd be very grateful.
- Here is the camera information on the national competition list