DM9000 Ethernet Tibetan information control platform

DM9000 Ethernet Tibetan information control platform

Abstract: Based on the Ethernet circuit of DM9000, the simplified TCP / IP protocol stack unIP is transplanted to the single-chip end to realize a simple TCP server. The simple TCP server was transformed, the Tibetan web page was stored in the TCP server, and the Tibetan TCP server was directly accessed through the Internet to directly control household appliances. This miniaturized, microcontroller-based TCP server can be connected to any port with Internet, and users can easily control home appliances through the Internet. The Tibetan information platform brings more humanized information services to Tibetan compatriots and has certain prospects for promotion.
With the development of IT technology, especially network technology, the network has brought convenience and swiftness to people's lives, which has also attracted much attention to technologies such as "smart houses" and "home automation". Although there are many designers engaged in the control of network home appliances, there are few related designs developed in minority languages. This solution is based on the Tibetan information exchange platform, combined with the current network development trend, based on the reality of the vast number of Tibetan compatriots. It is based on SPCE061A as the main controller, DM9000 is the Ethernet MAC controller, and cooperates with certain peripheral circuits. The simple server based on TCP / IP protocol stack. When a user accesses a Tibetan webpage stored on the server through a browser, the server will parse out the corresponding operation instruction of the user and convert it into an electrical signal, and control the corresponding home appliance by means of the control circuit.
Keywords: Ethernet; MCU; TCP; IP; server

1 System hardware design The system design is a simple and easy-to-use network home appliance terminal device, using Internet resources to enable the vast number of Tibetan compatriots to easily control home appliances while working. Based on the above considerations, therefore, the terminal device can communicate with the Internet; the TCP server must provide Tibetan services to facilitate the operation of the Tibetan compatriots; the terminal device is simple and clear; the AC 220 V power supply is used; the indicator and the Tibetan voice broadcast and other operations Instruction; Considering security, you must log in with a password and at the same time be able to monitor the status of home appliances via the Internet.


Figure 1 is a block diagram of the hardware design of the system, mainly composed of SPCE061A main control board, DM9000 control module, power circuit, external electrical control circuit, and speaker. Among them, the DM9000 Ethernet control module is directly controlled by the 16-bit microcontroller SPCE061A to complete the sending and receiving and parsing of the corresponding data packets. After the parsing is completed, the SPCE06iA sends operation instructions to the external electrical control circuit, speaker and indicator module to control the home appliance.
1. The SPCE061A main control board is cost-effective, and the 16-bit single-chip SPCE061A can conveniently and flexibly realize the voice recording and playback system. The device has 8 10-bit precision A / D converters, of which l is the audio conversion channel, and the built-in automatic gain circuit , It is convenient to realize voice input: 2-channel 10-bit precision A / D converter, only need external power amplifier (SPY0030A) to complete voice playback. In addition, the device has an efficient instruction system and integrated development environment that are easy to learn and use. In this environment, it can realize the mutual call of C language and Lingyang assembly language, and provide library functions for voice recording and playback. As long as you understand the use of library functions, it is easy to complete voice recording and playback.
The main characteristics of SPCE061A are as follows: 16-bit un'SP microprocessor: core operating voltage VDD is 3.3 ~ 3.6 V (CPU), IO port operating voltage VDH is VDD ~ 5.5 V; CPU clock is 0.32 ~ 49.152 MHz: Built-in 32 K word Flash; programmable audio processing; 32-bit universal programmable input / output port; 14 interrupt sources from timer A / B, time base, 2 external clock source inputs, key Wake up; use Sunplus audio coding SACM S240 mode (2.4 kbit / s), which can store 210 s of voice data: the phase-locked loop PLL oscillator provides the system clock signal. It should be noted here: I / O connection can not be reversed, using a regulated power supply, and the voltage is 5 ~ 6 V; the current flowing through the I / O port should not be too large to prevent the I / O port from burning out.
1.2 Ethernet module The Ethernet module is an Ethernet data packet sending and receiving control module. This module cooperates with the controller. In addition to completing Ethernet data packet sending and receiving, it also has a 4 Mbit serial Flash memory SPR4096, which provides users with a Larger storage space. In the network, IP packets with the same MAC address can be obtained automatically, and the sending and receiving of IP packets can be completed. In this design scheme, the SPCE06lA single-chip microcomputer is used as the main controller to control the DM9000 to complete Ethernet data packet transmission and reception and TCP / IP protocol implementation. The main features of DM9000 are as follows: the operating voltage is 5 V, the connection mode with MCU has ISA 8 bit / ISA 16 bit mode, and supports 3.3 V and 5 V I / O control; and supports EEPROM (93C46), available Store the information required by the system. Figure 2 shows the hardware circuit connection of the Ethernet module.


It should be noted here: SPCE06lA main control board and Ethernet module must share the same ground, it is best to use the same power supply, the Ethernet module power supply voltage must be 5 V, control I / O port voltage is 3.3 V; SPCE061A main The length of the control line used for data transmission between the control board and the Ethernet module should not exceed 20 cm; the power supply current should be greater than 200 mA.
1.3 Control circuit The external electrical control circuit is the main body that realizes the control from the single-chip computer to the electric device. The single-chip computer obtains the user's operation instructions through processing the webpage, and converts the instructions into electrical signals to the external electric appliance control circuit through the I / O interface of the single-chip computer. The two stages of amplification are completed, and then through the relay to complete the connection and disconnection of external appliances and AC 220 V power supply and the operation of the indicator light. Figure 3 is a schematic diagram of the control circuit.


When designing the control circuit, it should be noted that the operating voltage of the relay of the control circuit is 6 V, but the actual power supply voltage should be greater than 6 V to ensure better operation of the relay; the voltage of the command control port should be 5 V, if If it is not reached, the amplifier circuit should be added to prevent the instruction from being executed.
1.4 Power supply and power supply conversion circuit The design of the power supply circuit is to convert 220 V AC to 9 V DC through a transformer to supply power to the external electrical control circuit, and at the same time convert 12 V DC to 5 V through a three-terminal integrated regulator 7805 , Power supply for SPCE061A main control board and Ethernet module respectively. This allows the user to use the most commonly used power supply to power the device. The circuit is shown in Figure 4.


In Figure 4, the choice of transformer should be appropriate, and the three-terminal integrated voltage regulator should be equipped with heat dissipation equipment to avoid burnout and cause the entire equipment to fail to work properly.

2 System software design
2.1 Server program According to the analysis of needs, the software design needs to implement a TCP server based on Tibetan. At the same time, considering the humanization, the Tibetan voice prompt is also given in the action of household appliances. The core is the transplantation of unIP and the TCP server Implementation. Among them, the unIP protocol stack is a streamlined TCP / IP protocol stack running on the unSP series microcontrollers of Sunplus. The initial version of the protocol stack was ported from LwIP. It is not just a change in the arch directory described by LwIP. The core part has also been modified a lot to adapt the 16-bit feature of unSP to the protocol stack. UnSP does not have 8 bit data type, the address is also in 16 bit units, so unIP is not compatible with LwIP, in addition, DNS Client domain name resolution client and sub-application examples, such as WEB SERVER and so on. Maintain the integrity of the protocol stack. The design scheme needs to use the transport layer TCP protocol provided in the unIP protocol stack to establish the application layer HTTP protocol in order to complete the Web server, so that the web page and server data can communicate with each other.
The realization of the TCP server on the single-chip side: HTTP protocol is a common application layer protocol, which is based on TCP protocol. In this scheme, the application layer protocol is realized by some interface function APIs of the TCP / IP protocol provided by unIP. The specific ideas for implementing the entire server are:
1) Initialize the unIP protocol stack, then use DM9000 to create a network interface, add it to the unIP protocol stack, and set it as the default network interface of the unlP protocol stack.

2) Apply to create a TCP protocol control block, and configure it to listen on port 80 (the default port of the Web service), and set the callback function of the TCP protocol to receive the connection (meaning that the user passes the function pointer of the function defined by the user through a certain The way to tell the protocol stack, so that the protocol stack calls the function through the function pointer at the appropriate time, thereby performing user operations).
3) Establish a loop, continuously detect whether the DM9000 has new data input, and send the received data packets to the protocol stack for processing. When TCP's three-way handshake is completed, the protocol stack automatically calls the receive connection callback function set by the user, and the application layer handles the matters after the connection is established.
Based on the above ideas, the flow of the server based on TCP protocol is conceived, as shown in Figure 5.



2.2 Partial design of Tibetan webpage There are two schemes for the realization of Tibetan webpage: using picture form and standard Tibetan international encoding (UTF-8). The former is that all operating systems can open the Tibetan web pages. However, the processing process is relatively cumbersome; the latter uses international Tibetan encoding, and the web page is simple to produce, but the web page must be displayed on a system equipped with a Tibetan text library. The webpage of this solution needs to store the corresponding webpage data in the single-chip microcomputer through the webpage conversion tool. Since the web page conversion tool cannot save the picture information, it can only choose the latter.
The monitoring interface is designed with 3 electrical appliances (air conditioner, lamp, music) as examples in this solution. The operation design of the electrical appliance is controlled by buttons, and the monitoring of the electrical appliance state is displayed by the roaming table. When the electrical appliance is not operated The default is "C" (closed). When the appliance is turned on, the status of the status bar is "0" (opened). Its web page is shown in Figure 6.


The prepared Tibetan webpage file is converted into a C file by the "NetpagetoC" webpage conversion tool and added to the corresponding project location, thereby completing the storage of the webpage data in the server composed of SPCE0-6lA and the Ethernet module.

3 System Test Connect the TCP server terminal composed of DM9000 Ethernet module and MCU directly to the switch, then you can access the terminal device through the Internet. After connecting the TCP server, you can directly log in to the TCP server through a PC that can connect to the Internet, and you can set the status of the corresponding household appliances. This scheme uses the switch that controls the power supply line of the terminal block for simulation. After logging in to the TCP server, click the on or off of the home appliance. When the network is clear, the home appliance can respond to the control command of the PC in less than ls. The main control board designed by this system consumes 20 mA; the Ethernet module consumes 212 mA; the terminal board controls the drive circuit to consume 40 mA.

4 Conclusion After testing, all the functional indicators have reached the system design requirements. This plan combines the growing material and cultural life needs of the people in Tibet, based on solving and improving the actual quality of life of the Tibetan compatriots, while considering the needs of the Tibetans in terms of demand, it has the characteristics of easy operation and friendly interface. Further development of the system design will have a certain market prospect.

Buffet Warmer

Buffet Warmer,Food Warmer,Stainless Steel Food Warmer,Unter Top Buffet Food Warmer

Shaoxing Haoda Electrical Appliance Co.,Ltd , https://www.zjhaoda.com