SD card plays an important role in today's mobile storage due to its large capacity, low power consumption, compactness, lightness, hot pluggability and low price.
Today, we will take the LAB7504, a series of logic analyzers produced by Guangzhou Zhiyuan Electronics , as an example to introduce its application in SD card design.
2. Introduction to SD card
SD cards support three transmission modes: SPI mode (independent serial input and serial output), 1-bit SD mode (independent command and data channels, unique transmission format), and 4-bit SD mode (supporting four-bit wide parallel transmission). Table 1 introduces the relationship between data rate and mode.
The bus topology of SD mode is:
A star topology with one master (such as a microcontroller), multiple slaves (cards) and synchronization.
All cards share the clock CLK, power and ground signals. The command line (CMD) and data lines (DAT0~DAT3) are dedicated lines for the card, that is, each card has these signal lines independently. Table 2 introduces the signal functions in SD mode.
In SPI mode, the host uses the SPI bus to access the card. The microcontroller can select the card to enter SD mode or SPI mode in the first reset command after the card is powered on. However, the communication mode between them cannot be changed to SD mode during the card power-on period.
Table 3 describes the signal functions in SPI mode.
3. Decoding Analysis
The SD card protocol is relatively complex and has many modes. The commands, response behaviors, and CRC of data tokens in each mode are also very complex. If the R&D personnel need to parse the logic levels one by one during the design, the efficiency is too low and it is easy to make mistakes. The LAB7504 logic analyzer produced by Guangzhou Zhiyuan Electronics Co., Ltd. has SD card SPI mode and SD mode plug-in decoding tools, which can easily help engineers quickly and intuitively analyze the commands and data on the SD card bus. The following introduces the decoding plug-ins of the two modes respectively.
SD Mode
Click [Tools] and [Plugin Manager] on the logic analyzer host computer and select "SD Card SD Mode Protocol Analysis". The SD_SDMODE setting dialog box pops up. Fill in the bus setting options according to the actual situation of the SD card being collected. The bus settings for this collection are shown in Figure 1 (excluding the color setting and display setting).
Parameter Setting Introduction
CLK: Select the clock signal of the data to be decoded, which represents the CLK clock signal in the protocol.
Block length: Enter the number of blocks in the multi-block transmission process. In the process of reading and writing data blocks, there are multi-block read and write commands. The user needs to set the number of blocks when reading and writing multiple blocks, and enter the corresponding number in the block length.
CLK frequency: Enter the clock frequency. The clock frequency refers to the frequency of the clock signal transmission and is set according to the transmission of the clock signal.
Wide bus: Select whether to use wide bus transmission.
That is, whether to select 4-bit SD mode, single bus is 1-bit SD mode.
CMD bus settings: Set command bus parameters.
DATA bus settings: Set data bus parameters.
Frame color setting: Set the display color of each frame in the decoded packet.
Packet color setting: Set the display color of the decoded packet.
Display mode: Set the display mode of the decoded data, which can be hexadecimal, decimal or character format.
Let's take a look at the result after decoding through the plug-in. As shown in Figure 2, the decoded signal is enlarged, and the start bit: START; transfer bit: ToCard; command: READ_MULTIPLE_BLOCK and other information can be seen (there are also command parameters, CRC check, end bit and other information not displayed here).
As shown in Figure 3, the result after data bus decoding, the red box is the data start mark.
Click [Tools] and [Plugin Manager] on the logic analyzer host computer and select "SD Card SPI Mode Protocol Analysis". The SD_SPI Settings dialog box pops up. Fill in the bus setting options according to the actual situation of the SD card being collected. The bus settings for this collection are shown in Figure 4 (color settings and display settings are omitted).
Parameter Setting Introduction
CS: Select the chip select signal line, representing the CS chip select signal in the protocol.
CLK: Select the clock signal of the data to be decoded, which represents the CLK clock signal in the protocol.
Block Length: Enter the number of blocks in a multi-block transfer.
CLK frequency: The clock frequency of the input CLK signal.
SPI mode: Select the SPI decoding mode, starting from the first or second pulse, rising edge or falling edge sampling.
DataIn bus: Set the input bus information in the protocol.
DataOut bus: Set the output bus information in the protocol.
Frame color setting: Set the display color of each frame in the decoded packet.
Packet color setting: Set the display color of the decoded packet.
Display mode: Set the display mode of the decoded data, which can be hexadecimal, decimal or character format.
Due to space limitations, we will not go into detail about the decoding of the SPI mode here. The way to view the instructions and data after software decoding is similar to the operation in the SD mode. Readers can experience these operations themselves in actual applications.
Here is a screenshot of the start transmission command, as shown in Figure 5. Error! Reference source not found. At the beginning, the command information is clear at a glance.
4. Conclusion
LAB7504 provides excellent sampling rate and storage capacity, which can easily find timing problems between communication signals, helping engineers to quickly find and solve current problems and potential timing risks.
Previous article:Digital stopwatch design using Verilog
Next article:Circuit for testing capacitors
- High signal-to-noise ratio MEMS microphone drives artificial intelligence interaction
- Advantages of using a differential-to-single-ended RF amplifier in a transmit signal chain design
- ON Semiconductor CEO Appears at Munich Electronica Show and Launches Treo Platform
- ON Semiconductor Launches Industry-Leading Analog and Mixed-Signal Platform
- Analog Devices ADAQ7767-1 μModule DAQ Solution for Rapid Development of Precision Data Acquisition Systems Now Available at Mouser
- Domestic high-precision, high-speed ADC chips are on the rise
- Microcontrollers that combine Hi-Fi, intelligence and USB multi-channel features – ushering in a new era of digital audio
- Using capacitive PGA, Naxin Micro launches high-precision multi-channel 24/16-bit Δ-Σ ADC
- Fully Differential Amplifier Provides High Voltage, Low Noise Signals for Precision Data Acquisition Signal Chain
- 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!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- 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
- Overall design of wireless sensor network nodes
- EEWORLD University Hall ---- Fundamentals of Circuit Theory by Zhao Jinquan, Xi'an Jiaotong University
- Anxinke NB-IoT module review - some speculation about the failure of CH340
- A low-cost differential audio signal transmission solution for automotive applications
- Understand the structure and working principle of thyristor in a few steps
- Introducing a newly invented bandwidth amplifier circuit: "Angel"
- Embedded Qt-FFmpeg design an RTSP player
- dsp28335 ADC differential sampling
- Book Festival is coming, let me recommend a wave of must-read books on electromagnetic waves and microwave radio frequency
- [NXP Rapid IoT Review] W2 web development platform trial