1 Introduction
The continuous emergence of electronic storage devices has made it possible for many portable devices to process and store large amounts of data in real time. CF cards (Compact FLASH cards) have been widely used in data acquisition systems and many consumer electronic products due to their large capacity, small size, excellent performance, and portability. However, the products currently developed are costly, have complex circuits, and require a large number of components, which seriously restricts the application of CF cards in a wider range of fields. This article presents a simple and practical hardware interface circuit. It successfully realizes the reading and writing of CF card standard files by a single-chip microcomputer.
2 Interface Circuit Design
The interface circuit is shown in Figure 1. It uses the SST89C54 microcontroller compatible with 80C51. The SST89C54 program memory is divided into two blocks, block0 and block1. The former is 16 KB and the latter is 4 KB. The addresses of block0 and block1 are not continuous. Block1 starts from F000H. After power-on, the program can be executed from blockO (0000H) or block1 (F000H). The Re-Map[1:0] bit of the microcontroller determines which program memory the program starts from. When both bits are 1, the program starts from 0000H, otherwise, it starts from F000H. The Re-Map[1:0] bit is non-volatile and can be programmed with a programmer. The reading and writing of the CF card is performed through the buffer in the card. Direct reading and writing of the storage area is not supported. Since at least one sector (512 bytes) must be read and written at a time, most current methods must rely on external memories such as 6116 and 6264, which not only increases costs but also brings a lot of inconvenience to software design. In this system design, the second internal program memory block1 (4 Kbyte×8 bit) of the SST89C54 microcontroller is used as a read and write buffer, which can cleverly solve the above problems and also avoid the disadvantages of relying on external memory and address memory when reading and writing CF cards through microcontrollers [1-3].
In this circuit design, the address latch is omitted. Instead, the AO, A1, and A2 pins of the CF card are directly connected to the address pins A8 (P2.0), A9 (P2.1), and A10 (P2.2) of the microcontroller. It has been verified that the same code is applicable to both hardware connections.
3 Reading and Writing Programming
Since the CF card consists of two parts: the ATA controller and the FLASH memory, and the system access speed of the FLASH memory is much slower than the speed of accessing the internal memory, if the system frequently accesses the CF card, it will inevitably affect the real-time performance and work efficiency of the system, so the design skills of the CF card reading and writing program must be considered. [page]
3.1 Check the status of the CF card
For the sake of rigor, after writing a command or writing data, the status of the status register must be queried to determine whether the CF is ready or the read/write is successful.
3.2 Waiting for CF card data request
3.3 Set 8-bit data width
Due to limited space, other programs will not be listed one by one. Since there are many materials introducing the operation mode of CF card and the principle of reading and writing files, this article will not go into details. For details, please refer to the literature [4-7].
4 Control Software Design
The host computer software for the microcontroller to read and write CF cards is written in Visual C++6.0. The user's operation is relatively simple. It only needs to send the sector number and read/write sector switching command to the control software. The other operations are automatically completed by the software and are completely transparent to the user. Take the reading and writing of sector 1 as an example, as shown in Figure 2.
5 Conclusion
Since CF card is easy to carry, has good compatibility and large capacity, it can be predicted that CF will have broad application prospects. This article gives a solution for the microcontroller to read and write CF card in True IDE mode. Data can be exchanged between PC and CF card through the serial port. While simplifying the hardware circuit design, it also improves the data transmission speed. It has a high reference value.
Previous article:Design of Automatic Transfer Switch Controller Based on Single Chip Microcomputer
Next article:Analysis of I/O port driving capability of several commonly used 51 single-chip microcomputers
Recommended ReadingLatest update time:2024-11-17 01:32
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
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!
- 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
- PYPL Programming Language Popularity Index, September 2022
- I don't quite understand this thermal imager resolution comparison chart
- Where can I buy an LCD that works with the STM32F429IGT6?
- [TI recommended course] #Amplifier design in test and measurement#
- I would like to ask about the problem of packaging multiple sensor data into one data
- Remote power centralized management solution
- Xunwei-i.MX6ULL Development Board-Busybox transplant DHCP (Part 3)
- Free download of test solutions: R&SCMA180 - ideal test tool for analog and digital radio walkie-talkies
- [RISC-V MCU CH32V103 Review] - 4: EXTI starts the troubleshooting journey
- [Zero-knowledge ESP8266 tutorial] Quick Start 17 Station mode creates a wifi hotspot