The utility model content:
The purpose of the utility model just is to overcome above-mentioned defective, and a kind of single-chip microcomputer and CPLD collaborative design teaching experiment system are provided, and is hardware platform with this experimental system, can carry out the experiment or the electronic engineering design of single-chip microcomputer and CPLD collaborative design.In this scheme, single-chip microcomputer only is connected with another acp chip CPLD as acp chip, and all peripheral function circuit all only are connected with the CPLD circuit, are not connected with single chip circuit.In the electronic system based on this structure; Single-chip microcomputer only carries out issued transaction, does not carry out any interface sequence or logical process, and all sequential and logical process are accomplished by CPLD; CPLD is designed to a coprocessor of single-chip microcomputer; Be used to handle more complicated affairs when adopting this structure can make single-chip microcomputer save a large amount of machines, give full play to the advantage separately of single-chip microcomputer and CPLD, finally realize the purpose of simplified system design.
The technical scheme that adopts is:
The teaching experiment system of a kind of single-chip microcomputer and CPLD collaborative design; Comprise single chip circuit and CPLD circuit; Single chip circuit connects the single-chip microcomputer programmed circuit; The CPLD circuit connects the CPLD programmed circuit, and the signal input part that the CPLD circuit connects clock source circuit, A/D change-over circuit, static memory circuit, eeprom circuit, asynchronous serial communication circuit, usb circuit, temperature measuring circuit, infrared transtation mission circuit, infrared receiving circuit, the static display circuit of LED, LED dynamic display circuit, matrix keyboard circuit, hummer control circuit, control relay circuit, photoelectricity coupling output circuit connects.
Singlechip chip in this scheme in the single chip circuit adopts the CPLD chip in AT89S51/52, the CPLD circuit to adopt the USB interface chip in XCR3256TQ144, the usb circuit to adopt FT245BL.
Except that the mcu programming circuit; Single chip circuit is not connected with any peripheral circuit, only is connected with the CPLD circuit, and single-chip microcomputer adopts the mode and the CPLD of external data communication to carry out exchanges data; Promptly use MOVX DPTR; The A instruction is sent data to CPLD, uses MOVX A, and DPTR instructs from the CPLD reading of data.The sequential that CPLD visits according to the single-chip microcomputer external data realizes the exchanges data with single-chip microcomputer, and according to the corresponding peripheral components of single-chip microcomputer instruction control, realizes function corresponding.Adopt this mode, CPLD is designed to the coprocessor of single-chip microcomputer as the bridge of single-chip microcomputer and peripheral circuit, and by means of this coprocessor, single-chip microcomputer only just can be realized the control to peripheral components with an instruction, in the time of can significantly practicing thrift the machine of single-chip microcomputer.
The beneficial effect of the utility model is:
1, can bring into play single-chip microcomputer and CPLD advantage separately, integrated use singlechip technology and EDA technology can be simplified electronic system design;
But 2, the equal field programming of single-chip microcomputer and CPLD, system is easy to use flexibly;
3, complete, the good reliability of circuit module; Can carry out multiple single-chip microcomputer coprocessor contrived experiment, as: LED dynamically shows coprocessor, matrix keyboard coprocessor, static memory visit coprocessor, asynchronous serial communication coprocessor, A/D conversion coprocessor, EEPROM visit coprocessor, USB interface coprocessor, temperature survey coprocessor, infrared transmission/receiving interface coprocessor etc.;
4, cooperate software can not only satisfy the needs of teaching, can also directly carry out the electronic engineering Application Design.
Embodiment:
In Fig. 1,power circuit 20 provides+5V and+3.3V direct supply, supply other modular circuit to use; Singlechip chip in the single chip circuit 1 adopts AT89S51/52, and its 32 I/O pins and ALE, XTAL1 pin all are connected toCPLD circuit 2, and for it work clock are provided by the CPLD circuit; CPLD chip in theCPLD circuit 2 adopts XCR3256TQ144;
Single chip circuit 1 is connected withmcu programming circuit 3, and the user can download to singlechip chip throughmcu programming circuit 3; CPLD programmed circuit 4 is connected withCPLD circuit 2, and the user can download to the CPLD chip through CPLD programmed circuit 4.
Clock source circuit 5 is connected withCPLD circuit 2, for the CPLD chip provides work clock; A/D change-overcircuit 6 is connected withCPLD circuit 2, and A/D conversion chip wherein can arrive CPLD with the result transmission of A/D conversion under the control of CPLD;Static memory circuit 7 is connected withCPLD circuit 2, and the static storage cell of 32K byte is provided, and under the control of CPLD, can carry out read and write access to these static storage cells; Eepromcircuit 8 is connected withCPLD circuit 2, and the EEPROM storage unit of 256 bytes is provided, and under the control of CPLD, can carry out read and write access to these EEPROM storage unit; Asynchronous serial communication circuit 9 is connected withCPLD circuit 2, and its function is to realize Transistor-Transistor Logic level and RS-232 level conversion, through this circuit, can realize the asynchronous serial communication of computing machine and experimental system;Usb circuit 10 is connected withCPLD circuit 2, and the USB interface chip in theusb circuit 10 is selected FT245BL for use, through this circuit, can realize the usb communication of computing machine and experimental system;Temperature measuring circuit 11 is connected withCPLD circuit 2, under the control of CPLD, can temperature measuring data be transferred to CPLD; Infraredtranstation mission circuit 12 is connected withCPLD circuit 2, under CPLD control, can launch the infrared light of certain frequency;Infrared receiving circuit 13 is connected withCPLD circuit 2, when it receives the infrared light of 38KHz, and to the CPLD output low level, otherwise the output high level, CPLD can receive the information that transmits frominfraluminescence circuit 12 in view of the above; Thestatic display circuit 14 of LED is connected withCPLD circuit 2, is made up of 8 LED and related circuit, by the light on and off of CPLD control LED; LEDdynamic display circuit 15 is connected withCPLD circuit 2, constitutes by 4 cloudy altogether 8 sections charactrons and related circuit, and by its dynamic refresh of CPLD control, thus display message;Matrix keyboard circuit 16 is connected withCPLD circuit 2, is made up of one 4 * 4 matrix keyboard, can send keyboard signal to CPLD;Buzzer circuit 17 is connected withCPLD circuit 2, and whether it sends buzz by CPLD control;Control relay circuit 18 is connected withCPLD circuit 2, by its switch of CPLD control; Photoelectricitycoupling output circuit 19 is connected withCPLD circuit 2, is made up of 4 road photoelectric coupled devices, by its switch of CPLD control.
Under the cooperation of software, above circuit can be realized certain function, and teacher or student this experimental system capable of using and a computing machine are tested through programming accordingly.