Category:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
0
1
2
3
4
5
6
7
8
9
Position:IcFull.com » IC Electronic information » Category: C

IC Electronic information

C8051F040-based storage device design dump

In Electronic Infomation Category: C | on April 28,2011

Abstract: Dump a single chip storage devices to C8051F040 as the core control module, two CH375 U disk by an external module, LCD module and AD829AR datasheet and keyboard module to achieve the two U disk dump of data between each other , a good solution to dump the contents of U disk can not do without the inconvenience of computers and AD829AR price and susceptible to * and AD829AR suppliers and other defects. C8051F040 by CH375 USB protocol and in accordance with the appropriate USB device communication, CH375 available by calling the subroutine library to read U disk data directly, to achieve a common communication microcontroller and U disk, support for commonly used 12 Mb / s full-speed USB equipment and 1. 5 Mb / s low-speed devices. The design of low cost, low power consumption, simple operation, will have broad application prospects.

U disk with its current small size, easy to carry, large capacity, easy to use and so become the most common one removable storage device. However, it has been the use of U disk U disks is limited to communications between computers. If the contents of multiple U disk dump each other must be completed through the computer to ask then, more trouble, away from home and can not meet the requirements need to dump data anytime, anywhere. In this paper, this need, the design of a microcontroller core with C8051FD40 U disk dump device, the implementation does not directly through the computer to complete the two data exchange between the U disk, with a small size, transmission speed, ease of operation, hardware integrated and low cost.

1 system hardware design

1.1 overall system structure and working principle

System consists of power supply module, USB interface to dump the module, control module, the keyboard module and LCD display modules and other components shown in Figure 1. C8051F040 micro control unit external two CH375 U disk module in the microcontroller through a data buffer within the opening, directly call the subroutine library, responsible for a U disk data transfer selected files to another U disk. LCD and an external keyboard to achieve human-machine interface, through the keyboard on the turn, next turn, select and copy button, select the files to dump, and the liquid crystal display module file name, file size and other related information. Interactive friendly interface, easy to operate.


Figure 1 System block diagram

1.2 CH375 U disk module

Developed by E-vibration South CH375 U disk reader module, the module is compact, only 3.3x2.0 cm2. Module power supply is 5 V, with a light, work lamp is lit. Module uses the USB master and slave controller CH375B, with parallel drive, U disk can read and write. Require a total of 13 signal lines (five control lines 8 data lines).

Provided by the module znFAT, a FAT32 file system on a single chip solution that can easily achieve a variety of U disk file-level applications. The positioning of the major sectors, including files, file open, information changes, file close, file deletion, file read, file write, the disk information search and some basic operations on the file. The module has a small size, low price, easy to use features. The module is easy to pass through the MCU of the two U disk transfer of the relevant documents.

CH375 U disk reader module connected with the C8051F040 microcontroller shown in Figure 2. C8051F040 U disk module is selected by CS, U disk module interrupt through the INT to communicate with the MCU. DO ~ D7 for the CH375 U disk block with single chip parallel data line communications, microcontroller through the AO, RD, WR control signal CH375U panel module. D +, D-module for the CH375 U disk USB storage device with a serial interface. By CH375 U disk module can be easily MCU and USB storage devices directly to the data dump.


Figure 2 CH375 U disk reader module with the C8051F040 microcontroller connected

1. 3 LCD Module

The system uses the MGLS12232 122x32 dot matrix LCD module, the module built-in two pieces of 2.560 of RAM and two pieces of SED1520 controller, respectively, by E1, E2 strobe control both the left and right half screen display. Graphic LCD module has two connections: one for direct access mode, the other for indirect control. This system uses the direct control of the way, the way the LCD display module interface as memory or I / O devices directly attached to the microcontroller bus. The module is small, prices low and through the LCD module can meet the general folder name, file name and file information display.

1.4 Keyboard Module

3x3 matrix keyboard module is the keyboard structure, with Button button, respectively, define the power, reset, on the turn, next turn, select, copy, paste, etc. keys, with minimal implementation file dump of a variety of key operations .

1.5 C8051F040 microcontroller control module

C8051F040 microcontroller control module is the core of the system control module. The microcontroller chip has rich resources and powerful control features: fully compatible with the 8051, the maximum system clock frequency is 24 MHz, 70% instruction execution time is 1 or 2 system clock cycles. Rich interrupt source, an extended interrupt system to CIP-51 provides 20 interrupt sources, an interrupt driven system requires less MCU intervention, hence the higher the efficiency, so many interrupt sources can meet the system all peripherals. Universal Serial Bus (USB) function controller, 8 flexible endpoint pipes, integrated transceiver and 1K FIFO RAM; chip memory larger, CIP-51 in the SFR address space can contain up to 256 SFR page, through the SFR paging, CIP-51MCU can control a large number of chip used to control and configure the required peripherals SFR. Serial rich in resources, with two full-duplex enhanced UART, an enhanced SPI bus and SMBus/I2C. Each serial bus is fully implemented in hardware, can generate an interrupt to the CIP-51, requiring very little CPU intervention. These strings bus does not "share" the timer, interrupt or port I / O and other resources that can be used with any one or more.

The module functions are: to open a house in the microcontroller through the data buffer cache to be transferred between the two U disk file data, and through two CH375 U U disk drive module control file open, read, write into the on and off the work to achieve the transfer of file data. The control unit can also be sent to the external keyboard interrupt information processing, in order to achieve the file selection control of the microcontroller. By controlling a MGLS12232 LCD module to display some of the relevant file information.

2 system software design

2.1 peripheral control

The system uses CH375 U disk module, the module with znFAT, FAT32 file system on the single chip solution. Thereby reducing the complexity of the Fat32 file systems programming, as CH375 U disk module equipped with the file system and file manipulation routines, called by the main program relatively easy to implement SCM file name, file information of the liquid crystal display, and file selection and transfer operation.

C8051F040 microcontroller interrupt the rich, and the interruption has the following advantages:

1) time-sharing operation. CPU can be time-sharing for multiple I / O equipment services, improve the utilization of the computer.

2) real-time response. CPU to the timely processing of applications of random events, real-time system is greatly enhanced.

3) high reliability. CPU with a processing equipment failure and power-down and other breaking events, thus improving the reliability of the system.

Sum up, all the peripherals of the system are using the keyboard interrupt control, file transfer can be controlled with the interrupt. C8051F040 such a system efficiency of resource use has been greatly improved.

2.2 file dump program C8051F040 microcontroller

first open up a buffer zone inside, when you need to dump file, first select a U disk file, copy and paste when you click the button, it will automatically call by interrupting the relevant procedures, want to Open the file and read the file and open up the data buffer, and then the buffer U disk data storage to another new corresponding directory under the same name file.

Total system flow chart shown in Figure 3. After system power on the C8051F040 microcontroller to initialize the internal buffer to open up and make the initial screen LCD display, then enter the wait state inserted U disk, while waiting for some time, if no use U disk inserted, then "Please insert U disk" prompt information. When the U plate number for one or two, begin to read U disk information, and displayed on the LCD screen the basic U-disk information. After, C8051F040 microcontroller to wait for keyboard operation, according to the code calling the corresponding keyboard interrupt program, dealt with, continue to wait for keyboard interrupt signal.


Figure 3, the total system flow chart

3 online debugging

Dump device in the USB interface, two USB connected, respectively, A, B and two U disk, the LCD screen can display a U disk in the file, by manually operating the dump device on the keyboard button to select a U disk in the file, and can be transferred to the B U plate. Dump the USB device in the production process is more difficult to debug device-side program. The USB protocol has strict requirements, which make the program must be a valid request for some time, or state, or USB will not work. Therefore, in the debugging process, more output through the serial output process some information to aid debugging, locating the problem. Divided into two steps

debugging, first to be able to display the files inside the U disk, using PC debugging software (downloaded from the Internet Bus Hound) the device-side USB protocol transfer pass, and then write U with U disk panel display program, the LCD screen where you can see the U disk in the file name; second step is to dump, dump in the MCU in the writing program debugging. Can be achieved through the keyboard to select the dump file.

4 Conclusion Although the microcontroller on the market today

U disk function module to read and write, but can only read simple function of the two U disk is not able to achieve direct correlation between the transmission and display. U disk dump of the designed experiment showed that the device has a strong practical and feasible, it can be outdoors without the aid of a computer is very easy to complete a U U disk to another disk file dump. Thanks to USB interface transfer speed is very fast, fully able to meet the needs of ordinary users. System uses STM package, with compact, easy to wear, etc., is a cheap and useful electronic products. The current system is the lack of USB storage devices can be managed only two, this is the future of the system need to be further perfected.

AD829AR datasheetAD829AR suppliersAD829AR Price

All right reserved:icfull.com © 2010-2016 Certificate