This article explains the I2C communication problems encountered in actual development and how to use an oscilloscope to analyze and solve the problems.
The latest DS6104 oscilloscope launched by RIGOL was used in the analysis process. Its specific features include: up to 1GHz bandwidth, which is sufficient to meet the bandwidth requirements of commonly used standard buses; 5GSa/s real-time sampling rate to ensure that signal details are not missed; 180,000 waveform capture rates per second, with the highest probability of capturing signals of interest; standard 140M deep storage to meet the needs of both global overview and local observation; can record up to 180,000 frames of waveforms, and can replay and analyze strange signals at will; provides a variety of serial triggers, RS232, I2C, SPI, CAN, USB, etc.
Problem Discussion
The project design plans to use the Cypress 68013A chip to implement the USB device function. The 68013A is a high-speed USB device produced by Cypress. The reference design of this chip runs by reading the firmware program stored in the EEPROM through the I2C bus, as shown in Figure 1.
Figure 1: Schematic diagram of the connection between Cypress 68013A and EEPROM.
In order to further reduce the device area, power consumption, and facilitate the subsequent online firmware upgrade, it was decided to use DSP to simulate the communication between EEPROM and 68013A. At the same time, the firmware was downloaded to 68013A online through the I2C bus and run, as shown in Figure 2.
After programming with reference to the 68013A data sheet, I found that the firmware program could not be downloaded correctly when communicating with the 68013A through the DSP emulation EEPROM. That is, how can the DSP download the firmware to the 68013A through the I2C bus?
Figure 2: Schematic diagram of the connection between Cypress 68013A and DSP.
Workaround
First, you need to confirm that there are no problems with the communication environment, that is, there are no problems with the bus connection; there are no problems with the DSP's I2C communication program; there are no problems with the Cypress 68013A's I2C communication.
After verification, it was found that all the above items were correct, so the only possibility was that an error occurred during the communication process. However, no detailed description of the communication between 68013A and EEPROM was found in the reference manual. In order to obtain detailed data between the two in the initial communication stage, the DS6104 oscilloscope of RIGOL was used to capture the communication data in the initial stage.
The DS6104 oscilloscope has an I2C trigger and I2C decoding suite. To capture data, the following settings are required: Set the DS6104 oscilloscope trigger mode to "I2C" and the trigger condition to "start"; set the trigger clock source, data source and appropriate trigger level; turn on I2C decoding and set the decoding threshold; set the oscilloscope to single trigger. After the settings are completed, all communication data headers can be captured by monitoring the I2C communication with the EEPROM. Figure 3 shows the decoded data obtained.
Figure 3: Cypress 68013A and EEPROM I2C initial communication data.
By comparing with the firmware data read into the DSP memory (Figure 4), it can be seen that the "0xC2 0x47..." and subsequent data in the figure are the real firmware data. Therefore, the reason for the failure of DSP simulation EEPROM communication is the I2C communication from the start data to the firmware data (hereinafter referred to as handshake communication). After using the horizontal time base fine-tuning function of DS6104 to expand the waveform in the figure, the handshake communication process can be seen more clearly (Figure 5), which is described as follows: read address "0x50", no data is returned; read address "0x51", return "0xAD"; write address "0x51", write two bytes "0x00". [page]
Figure 4: 68013A firmware program data (partial) read into DSP memory.
At this point, the problem is simplified to: How to simulate this part of the handshake communication in DSP? After obtaining the visual handshake communication data through the oscilloscope, simulating its communication process only requires the following three steps: Set the I2C bus address of DSP to "0x51", and there will be no return if it does not match the address "0x50"; in the I2C communication program of DSP, send "0xAD" first when downloading the firmware, so that the first data read at the address "0x51" is "0xAD"; when DSP downloads the firmware through I2C, it can receive "0x00" but does not process it, to ensure the integrity of the handshake communication.
As mentioned above, after including this part of the handshake communication processing in the DSP's I2C communication program, the DSP emulated EEPROM and Cypress 68013A can communicate normally and successfully download the 68013A firmware.
Previous article:Parallel port capable of controlling arbitrary waveform generators
Next article:Methods of testing components using oscilloscopes and waveform generators
- Popular Resources
- Popular amplifiers
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- How to measure the quality of soft start thyristor
- How to use a multimeter to judge whether a soft starter is good or bad
- What are the advantages and disadvantages of non-contact temperature sensors?
- 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
- When the comparator output is connected to the logic OR gate input, it cannot generate a high voltage signal (logic "1"), how to solve it?
- [NXP Rapid IoT Review] "Smart Home Control System Based on Rapid IoT" - Review Summary
- Advantages of TI's multi-channel PA controller AMC7932 in MIMO systems
- 555 classic circuit diagram: DC-AC converter diagram composed of 555 circuit
- Is there any mobile phone positioning software that you would recommend?
- TI Live: A detailed discussion of a candidate solution for "electric vehicle on-board charger". Will it be popular among engineers?
- DSPC6678 on-chip storage space allocation mechanism
- EEWORLD University Hall ---- Computer Control Devices Zhang Guangxin of Zhejiang University
- The most worrying thing happened: ARM complies with new US regulations and stops cooperating with Huawei
- Summary of remote firmware upgrade for MSP430, STM8L, cortex-M0 core