Design and implementation of interface between single chip microcomputer and CF card

Publisher:飘然出尘Latest update time:2012-04-12 Source: 维库开发网 Keywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Keywords:MCU Reference address:Design and implementation of interface between single chip microcomputer and CF card

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

Basic knowledge of 8051 microcontroller
8051 microcontroller is one of the most popular and commonly used microcontrollers in various fields such as embedded systems, consumer electronics, automobiles, etc. Technically known as Intel MCS-51 architecture. The 8051 microcontroller series was developed by Intel in 1980 and was very popular in the 1980s (and of
[Microcontroller]
Basic knowledge of 8051 microcontroller
Design of digital controlled current source based on PIC16F877A microcontroller
1 Introduction Power supply technology, especially digital control power supply technology, is a very practical engineering technology, involving many disciplines such as electrical, electronic, system integration, control theory, and materials. The development of computer and communication technology has provided a b
[Microcontroller]
Design of digital controlled current source based on PIC16F877A microcontroller
PIC microcontroller CCS C language (#UNDEF usage)
#UNDEF Syntax: #undef id id is the preprocessor id defined by #define Purpose: Specifies that the preprocessor id is no longer meaningful to the preprocessor. Example: #if MAXSIZE 100 //If MAXSIZE 100, execute the following statement #undef MAXSIZE // MAXSIZE is no longer meaningful to the preprocessor. #def
[Microcontroller]
How to use microcontroller to implement caller ID decoding
   1. Introduction   With the expansion of urban water supply and urban pipe network, the original telemetry system of Xiamen Water Company is difficult to adapt to the production scheduling needs. A set of reliable and fast dispatching telemetry system is required. Taking into account the development status of domes
[Home Electronics]
51 MCU matrix keyboard driver implementation
Use this matrix keyboard as microcontroller input, plug it into P1.0~P1.6 of P1 port. I want to ask, when: When key 1 is pressed, P0.0 of P0 port outputs high level; Press the 2 key and P0.1 outputs high level; … Just go up to the 8 key. There is also a requirement that when a key is pressed, the delay is 5 seconds
[Microcontroller]
51 MCU matrix keyboard driver implementation
Pulse meter and heart rate meter based on single chip microcomputer
introduction In traditional Chinese medicine, pulse diagnosis refers to the doctor using his fingers to feel the patient's pulse and explore the patient's condition. Pulse diagnosis is of positive significance for analyzing pathology. However, pulse diagnosis is greatly affected by subjective factors. The pulse heart
[Microcontroller]
Pulse meter and heart rate meter based on single chip microcomputer
NXP MCX microcontrollers enhance motor control capabilities for mobile robots
Excellent performance, smooth motion and reliable operation of mobile robots require efficient and precise control. The increasing autonomy and complexity of robots have put a great demand on advanced control and other tasks. NXP's new generation MCX microcontroller portfolio features advanced peripherals to help de
[robot]
MCU Experiment Board 2011_V1.1-74HC244 Key Test Program
/************MCU teaching experiment board******************/ /*74HC244 key test program*/ #include reg52.h ac #include STC_Delay.h #include stdio.h #include stdlib.h #include intrins.h #include math.h   #define uchar unsigned char #define uint  unsigned int #define long unsigned long   sbi
[Microcontroller]
MCU Experiment Board 2011_V1.1-74HC244 Key Test Program
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号