Embodiment
Below in conjunction with drawings and Examples to the utility model detailed description of making comparisons.
With reference to Fig. 1, this is a system principle diagram of the present utility model, comprises following components: (figure number will adjust accordingly) RS485 communication interface circuit 2, central microprocessor 3, button application circuit 4, storage unit E
2PROM 5, LED display circuit 6, liquid crystal display circuit 7, working power 8.
MCU realizes the transmitting-receiving of Modbus message and the processing of various information and operation by the program that embeds wherein.The RS-485 communication interface is set up a passage between the MCU of VD1M and VD1, the link layer and the physical layer function .MCU that have realized network service have judged whether operation requests by the scanning button, and providing response. message and result are by the demonstration output of LED and liquid crystal. and the display interface of liquid crystal is taked the mode of menu, the user can be easily by the monitoring of button operation realization to each parameter, to the setting of special parameter, and to the control of motor.Can realize that by EEPROM the working power of the preservation .VD1M of some setting value is 5V, can directly provide, also can adopt independently-powered form by VD1.
With reference to Fig. 2 .1, this is the wiring diagram of MCU. selected MCU be STC89C516RD+. shown in the pin network identity among the figure, RXD, TXD, MDS is connected to the RS-485 communication interface, wherein MDS is the transmitting-receiving selecting side, sends when putting high level to enable, and receives during low level to enable, P33, P34, P35, P36, P37 receives the data/commands selecting side that 5 paths of LEDs show that output drive end .D/I receives liquid crystal respectively, R/W receives the read/write control end of liquid crystal, and E receives the Enable Pin of liquid crystal, and DB0-DB7 receives 8 data bit of liquid crystal, CS1, CS2 receives the sheet choosing end of liquid crystal, and RST receives the reset signal end of liquid crystal, and EL1 receives the backlight control end of liquid crystal.P10-P17 is connected to 8 buttons.REST receives the chip IMP810.P40 that resets, P20, and P21, P22 is to eeprom chip.
Fig. 2 .2 is a MCU mouth line pull-up circuit, and it receives VCC by the exclusion of 10K with each pin of MCU, plays and raises level, strengthens the effect of chip mouth line driving force.
Fig. 2 .3 is a RS-485 communication interface circuit.Adopt chip 75176 to realize the transmitting-receiving and the level conversion of message.485-1A, 485-1B is the signal wire on the transmission network, links the RS-485 communication interface of body.When VD1M will send message, MDS is put 1, MCU is transferred to 75176 with serial data by TXD, is converted to the differential level signal through 75176, outputs to Network transmission line 485-1A by A, B two pins, on the 485-1B, is received by body, has realized the transmission of data.When VD1M will receive message, MDS is put 0, the information that body sends is through Network transmission line 485-1A, and 485-1B arrives 75176 A, B end, and 75176 are converted to the Transistor-Transistor Logic level signal with this differential signal, input to MCU by RXD, have realized the reception of data.In communication, VD1M serves as main frame, and body then is a slave.Pull-up resistor RA, pull down resistor RB are used to guarantee that connectionless 75176 chips are in idle condition, and the network failure protection is provided, to improve the reliability of RS-485 node and network.RAB is terminal build-out resistor .LA, LB, and CA, CB, NUP1, LU1, CU1 is optional installation elements, is used for suppressing to disturb, and improves the EMI performance of circuit.
Fig. 2 .4 is the LED display output circuit.Have 5 the tunnel, controlling 5 LED. respectively, to connect triode be in order to strengthen the driving force of MCU delivery outlet line.
Fig. 2 .5 is the liquid crystal display output circuit.Be connected with parallel mode with MCU, concrete wiring front is existing to be described in detail.This liquid crystal is 128 * 64 dot lcds.RTJ is a potentiometer, in order to regulate the contrast of liquid crystal.
Fig. 2 .6 is the connecting circuit of button.The utility model adopts film key, makes the form of surperficial pad pasting, can save the space, dwindles the volume of product, and succinctly attractive in appearance.MCU detects by scanning and has or not actuation of keys, and when the button generation, a mouthful line P10-P17 level changes, and MCU judges whether to be effective action, and provides response.The software judgment mode is taked in the shake of going of button fully, has saved hardware cost. and this product is established 8 buttons altogether, wherein directly controls motor for 4, is respectively to stop, and resets starting A, starting B.All the other 4 buttons are used for the operation of liquid crystal interface menu.
Fig. 2 .7 is the reset circuit of MCU.The employing chip IMP810 that resets.Play the effect of electrification reset and power-off reset.
Fig. 2 .8 is the EEPROM memory circuit.Adopt chip 93C66. as standby functions, can be used for the situation that some need power down to preserve.
Fig. 2 .9 is the wiring circuit of programming program.Link to each other with the special-purpose programming head of STC chip, use the programming software of STC, serial i O mouth RXD, TXD by MCU enter program burn writing.
With reference to Fig. 3, this is a software main program process flow diagram of the present utility model.
Parameter declaration is as follows: bb-major cycle time tag; Dd-does not have the running time sign; 1-contact bed numbering; M-menu layer numbering; The runflag-running mark; The faultflag-Reflector; The alarmflag-warning mark; P4 1-MCU mouth line connects the LCD backlight control end.
Its process step is as follows:
From<opening initialization〉9 beginnings, to<ls to (bb>100), and l!=2, and l!=8, and (l=7﹠amp; ﹠amp; M=3)?>10 judge, if not, then enter<key scan〉22; If enter<bb=0, read running status, put runflag, put corresponding LED〉11,<Read fault state〉12,<non-fault arranged〉13 judge, if then enter<put fault, some LEDS〉14; If not, enter<read the newspaper alert state〉15,<alarm free arranged〉16 judge, if then enter<put alarm, some LED4〉17; If not, then enter<1=0 18 judge, if not, then enter<1=7﹠amp; ﹠amp; M=0? 19 judge, if not, then enter<key scan 22; If, enter<real-time parameter refreshes〉21; Enter<1=0 after 18, if, then enter<the standby real-time parameter refreshes〉20, enter again<key scan 22,<have or not button〉23 judge, if then enter<dd=0; The button effect〉24; If not, then enter<dd 3000? (30s have operation?) 25 judge, if not, then return<ls is to (bb>100), and l!=2, and l!=8 (l=﹠amp; ﹠amp; M=3)? 10; If then enter<P4-1=1 (backlight going out)〉26, then enter<(dd>1000) ﹠amp; ﹠amp; (l!=0) ﹠amp; ﹠amp; (l!=7) ﹠amp // (1=7); ﹠amp; (m!=0)))? 27, if then enter<1=0 the rebound standby interface〉28.