A New Design and Implementation of an Attendance Checking Node for Coal Mines A New Design and Implementation of an Attendance Checking Node for Coal Mines

A New Design and Implementation of an Attendance Checking Node for Coal Mines

  • 期刊名字:中国矿业大学学报(英文版)
  • 文件大小:683kb
  • 论文作者:XIA Shi-xiong,QIAO Da-lei,CHEN
  • 作者单位:School of Computer Science & Technology
  • 更新时间:2020-06-12
  • 下载次数:
论文简介

Joumal of China University of Mining TechnologyVoL 17 No. 2Availableonlineatwww.sciencedirect.comSCIENCEDIRECTSJ China Univ Mining Technol 2007, 17(2): 0193-0196A New design and Implementation of anAttendance Checking Node for Coal minesXIA Shi-xiong, QIAO Da-lei, CHEN Dai, ZHOU YongSchool of Computer Science& Technology, China University of Mining Technology, Xuzhou, Jiangsu 221008, ChinaAbstract: A novel design and implementation of an attendance checking node for coal mines based on the Can bus ispresented in this paper. Hardware circuits and programming methods for the attendance checking node are discussed.including the single-chip computer with CAn controller AT89C51CC03, the Can bus transceiver TJA1050, the largecapacity DataFlash memory, the real-time clock DS1302, the voice chip ISD2560 and the card-reading circuit in Wie-gand format. All the extended hardware satisfies the requirements for intrinsically safe circuits( GB3836. 4-2000)andintrinsically safe authentication promoted by the national explosion-proof institute. Further, the software programmingmethods for the CAN controller(AT89C51CC03)and the implementation of the CAn communications protocol arepresented as wellKey words: CAN bus; attendance checking node; wiegand; message passingCLC number: TD 761 Introductionputer with CAN controller, model AT89C51CC03produced by Atmel Corporation as a core micro-con-The national coal-mine accidents of the last few troller, and expand the ID card-reading moduleyears have spurred the development of an attendance ( wiegand 26/34 format was compatible).Additionalchecking, and locating node intended to insure safe hardware include the real-time clock chip DS1302working in the mine. Real-time performance is an the large capacity Data Flash memory AT45DB16IDimportant criterion of the design. To implement real- the voice chip ISD2560 and a 240x128 lattice LCDtime communication between nodes, a field bus with display/touch modules with Chinese Fonts. In a word,more reliable, better real-time response and multi- the whole node circuit is good and safe for use in amasters must replace the design of one master andoa minemulti slaves. The Controller Area Network(CANcan meet the requirements of real-time data commu- 2 Structure and Function of the Node Sys-nication based on a 1 Mbps baud rate. The Can bustemplays an important role in bus design owing to itsmany merits such as ignoring master and slave, conBased on practical requirements for checking onvenient networking, low cost, high reliability, strong work attendance in a coal mine and considering theanti-jamming tendencies and easy to implement scalability and the real-time communication reliabilreal-time communicationity required of a node, the node mainly includes theThis paper describes a new design of hardware cir- following function modulescuits and software programming to implement an1)The micro-controller module. The micro-conattendance checking node for coal mines based on the troller module uses an 8-bit single-chip computerCAN bus. The construction of the nodes, the con- integrated with a Can controller which is producedstituent hardware, the software functions and the by Atmel Corporation. This was introduced in 2003CAN communication protocol between nodes and the and has high quality and low price. Its instruction setupper computer are delineated in detail. The nodes is compatible with traditional 8051 single-chip com-ncorporate a double channel, flameproof and intrin- puter中国煤某工 includedInsically safe power source, use the single-chip com某化二CAN 2.0A andCNMHGProjects 50674086by the National Natural Science Foundation of China, BS2006002 by the Society Development Science and Technology Planof Jiangsu Province0290508 by the Doctoral Foundatioinistry of Education of ChCorrespondingauthor.Tel:+86-516-83883173:E-mailaddress:xiasx@cumt.edu.cnmal of China University of Mining TechnologyVol 17 No. 2at the same time, and can control up to 15 independ- This module uses a high-speed Can transceiver, theent channels each useful for transmitting, receiving or TJA1050 produced by Phillips Corporation. In thisas a receiving buffer. The AT89C51CC03 also pro- module a high-speed optical coupler, part 6N137,vides rich resources on the chip, such as a 64 kB isolates the transmitting and receiving pins from theFlash memory, a 2 kB Boot loader memory, a 2 kB transceiver. This also insulates VCC and vdd of theEEPROM, 1.2 kB of RAM and a 21-bit watchdog power supply. These things enhance the stability andtimersafety of the entire attendance checking node and2)The node power supply module. The power improve the reliability and anti-jamming properties ofsupply is a 12 V and 5 V double-output, flameproof the Can data streamand intrinsically safe power supply, model KDW438) The LCD display/touch-screen module. Thishich has dual regulators and current limiting abili- module uses a 240x128 lattice graphics LCD moduleties. The two power sources are completely insulated with Chinese fonts. The LCD module has a new typeto ensure the implementation of an intrinsically safe controller, an RA8803, which provides for display ofnode circuita double graphic layer and 4 levels of gray. The func-3)The ID card-reading module. The head of this tions of mixed font size, Chinese-English automaticard uses a radio frequency transceiver module, alignment, row spacing setting and so-forth armodel RFID5 1589B, produced in Taiwan. This available. The LCD module provides an input functransmits data in the standard Wiegand 26 format. tion by scanning an 8x8 keyboard which can be ac-The data reader uses two Schmitt inverters and two cessed by pressing a key on the touch screen. TheXOR gates to interface with the interrupt pins(InTo LCD display/touch screen module provides a friendlyor INT1)of the AT89C51CC03. This card can readand visual interface for usersthe common wiegand 26/34 format data reliably.The system structure of the complete node is4)The real-time clock module. The DS1320 is a shown in Fig. 1eal-time clock chip with high performance, lowpower consumption and internal RAM. It can timeintervals by year, month, day, week, hour, minute andintrinsically safe ID card-readingsecond. It also has automatic leap year compensationA 31x8 bit RAM register is used to store temporarydata. This node is designed to store correlative paMCUrameters giving memory addresses such as the DataAT89C51CC03Flash address pointer, and so on. The module isequipped with a 3.6 V rechargeable Li-battery. Even240×128 latticeSound andif other modules power off, battery power ensuresCANLCDTouchpower-amplifierthat the clock provides exact, reliable timescreen modulemodulemodule5)The data-storage module. This module uses anew type of Dataflash chip, the AT45DB161D, firstFig 1 System block diagram of nodeproduced by Atmel Corporation in 2006. The data isstored in the AT45DB16ID by page. The main stor- 3 Design of Key Hardware Circuit of Nodesage has 4096 pages in all and each page has 512-528bytes. So the size of the main storage is about 2 M 3. 1 Design of Wiegand26/34 card-reading mod-bytes in total. Each page can be erased and writtenover100000 times. Assuming each attendachecking record takes 8 bytes (3 bytes hexadecimalThe Wiegand data convention requires two signallines, named DATAO and DATAl, to show an outputID number+current time)this chip can store over state of 0'or'I'respectively. The DATAO line is200000 attendance checking records even if the up- pulsed negative for a0 bit and the DATAl line isstream server is broken down6)The sound and power-amplifier module. Thepulsed negative for a ' bitvoice chip uses the ISD2560 sound recording andThe timing sequence of the data is shown inplaying integrated chip, which belongs toig. 2. It is obvious that the output signals on DATAOISD2500 series. This chip can record and playand DaTAl are opposite precisely when a data0orI'appears. It is according to this characteristic thatds(about 600 segments at most). The power- the Wiegand data format is readifier chip uses the Hi-Fi power-amplifier inte-grated block, model number TDA2030A, whichmeets the requirements use in the complex environment of a coal mine. It operates at the voltage of 14 DATAYHCN MHGOV and has an output power of 14 w into a load-re-sistance of 4 Q(Harmonic distortion <.5%)7)The CAn bus transmitting receiving moduleFig. 2 Wiegand output formatXIA Shi-xiong et alA New Design and Implementation of an Attendance Checking Node for Coal MinesThe ID card reader module is diagrammed in Fig 3. 3.3 Design of CAN communication module circuitThe two Schmidt inverters play a major role in pulseshaping. There is also a pair of XOR gates. The firstThe signals of the Can bus are a differential volt-age transmitted through two signal lines: CAN_H andXOR gate is used to check whether a data bit "0 Or CAN_L. When CAN_H equals CAN_L, and theIhas appeared, or not. The second XOR is connected to the +5 V rail, causing it to act as an inverter. value is 2.5 V, the state is a logic'1,and it is calledIt produces interrupting signals which trigger the sin- recessive. When the voltage of CAN_H is highergle-chip computer to start an interrupt handling pro-than CAN_L (CAN_H=3.5 V, CAN_L=1. 5 V). thegramstate is a logic 0 and is called 'dominantConsidering the cost, and other factors, a twisted-P17CEX4 pair was adopted as the communication physical me-dium between the nodes and the controlling computer.盟P30/RxDAs shown in Fig. 5, a TJA1050 transceiver is used asthe interface between the can controller of the'INTI 1) P3/NTo AT89C5ICC03 chip and a twisted-pair. 60 2 resistorsconnected to the can h and can L lines to avoidsignal reflection. Due to the complex electromagneticenvironment in a coal mine TxDC(the CAn TransCONemitter) and Rxdc(the Can Receiver) of theAT89C51CC03 are connected to the Tja1050 trans-Fig 3 Circuit diagram of ID card-reading moduleceiver after being isolated by high-speed optical couDATAIirectly connected to the 1/O port of the plers, 6N137. This enhances the reliability and theAT89C51CC03 after being shaped by an inverter. The anti-Jamming ability of the communication betweenAT89C51CC03 judges whether the data being read isOor 'I' by reading this signal. Field testing proved6N137 are completely isolated by a 5 V DC/DC conthat this method would read all the data collected bythe card-reader in Wiegand26/34 format rapidly andreliably 313.2 Design of AT45DB161d data storage module6N137The working voltage of the At45DB161D flashmemory chip is 3.3 V, but the AT89C51CC03, and R16 CANR 6 OUT CTA1050bidirectional transceiver is needed to realize voltageCANH R25CANconversion between the 5 V and 3.3 V levelsAs shown in Fig. 4, the 74HC08 is an AND gatewhich contains four independent 2-input AND gatesThe WR and rd pins are connected to pins P3.6(WR) Fig. 5 Circuit diagram of CAN communication interfaceand P3.7(RD) of the AT89C51CC03, respectivelyThe switching of the data direction is controlled by 4 Software Design of Nodes CommunicaP2.0 of the at89C51CC03tion4.1 Programming of CAN nodesCCA VCCBThe Can communication routine mainly includesWR an initializing program for the CAN node,I RDending and receiving program, and a CAn error74HC8handling program. Only the programs for initializingthe Can node and sending and receiving message arediscussed in this paper, due to space restrictionsThe initializing program includes the clearing of allheir status registers, the setup of the bit中国煤化工 the setup of otherandCNMHGSettIng the sendingr register, and so onAn these steps should be done with the CAn interig. 4 Circuit diagram of data storage modulerupt disabledJournal of China University of Mining TechnologyVol 17 No. 2The setup of the bit timing register is very complex mode, All that we should do is to read the data fromand essential. We calculated the correlative parame-the receiving buffer and then enter the correspondingters through the X-Calculator supplied by Atmel handling subprogram(6-7)Corporation. For example, if the external crystal usedis 12 MHz and the can bit rate is 100 kbps the pa-4.2 Realization of CAn communication protocolrameters from X-Calculator are as follows: BRPThis communication protocol uses a frame formatSJW=00, PRS=01, PHS 1=02, PHS2=03. When the in the form of "Machine Number + Order Datasetup of all the above parameters is completed, we The Machine Number is a 6-bit binary numbercould enable the interrupt of the Can controller us- (01H-7FH, O0H'is broadcast address) which is set ining the following assembler codeadvance for each attendance checking node on theORL CANIE2 #OIh: /*Set IECHo= 1*/network. The Order byte represents the actions prear-ORL CANGIE, #1Oh /CAN_Tx interrupt ranged between the two sides. The Data is the actualenabled */transmitted data. For example, OOH OAH year monthORL CANGIE, #20h /CAN_RX interrupt day hour minute second"means that upper broadcastenabled=*/sends a request for time synchronization. The MaSETB ECAN/* CAN interrupt en- chine Number byte 00H means that this frame is athe can controller of the at89C51CC03 automhour minute second""is the current time 81cally. All that we should do is send data to the transmission buffer register (8 bytes), write the control 5 Conclusionsdata for the message into the correlative register andenable transmission. The transmission process is thenThe design methodology and technical implemerompleted through the hardware. Usually we judge tation of an attendance checking node for use in awhether the data is sent completely, or not, with a coal mine described in this paper are novel. The nodeolling method. For examplehas many advantages, such as intrinsically safe cir-MOV CANMSG. DATAOcuits, low cost, reliable communications resistance toDATAO-DATA7 tO CANMSG*electromagnetic interference, true real-time responseMOV CANMSG DATAIcharacteristics, and so on. In practical applicationsMOV CANMSG DATA2several attendance checking nodes considered as aMOV CANMSG, DATA3substation would be integrated with an upper masterMOV CANMSG DATA4computer using an intelligent PCI-CAN card to formMOV CANMSG, DAtA5a CAn local area network. This system actually realMOV CANMSG, DAtA6izes real-time attendance checking in the coal mine atMOV CANMSG. DAtA7hise speeds. Substations can also commu-ORL CANCONCH, #08H /set transmit 8 nicate each other based on various requirements. Athe same time, the node has a good scalability. WhenORL CANCONCH, #40H /*emission en- expanding by adding a RFID far distance card-readabled */ing head the new node can be a completely functionalReceiving of the CAN messages is also completed locating node which can provide the locating tasks inautomatiby the can controller of the the coal mineAT89C51CC03. The receiving program uses interruptReferences[1] Rao Y T, Zou JJ, Zheng Y Y. Principle and Application Technology of CAN Field Bus. Beijing: Beihang University Press,03:11-19,154-155.( In Chinese)[2] Wang H F, He Y Q. Principle and Application of Field Bus Control System. Beijing: Chemical Industry Press, 2006.(In Chi[3] Yue Y F. Wang R, Sun H T. wiegand protocol and the application. Journal of Qiqihar University, 2002, 18(2): 56-58.(In[4] Chen Z P, Yue Y J. Industry Control Network and Technology of Field Bus. Beijing: China Machine Press, 2006. (In Chine[5] Fu M C, Feng L J, Yun J F. Realization and application of the data acquisition system based on CAn bus. Modern ElectroTechnique, 2006, 2: 71-72.[6] Shi J G zhang PR, Chen Z Y System Design Technology of CAN FiH中国煤化工 Industry Press,200420-38.(In Chinese[7] Lei L. Technology of Field Bus Control Network. Beijing: PublishingCNMHGO4: 266-297 (In Chiese)[8] Wang H Information system about the Can bus. China Measurement Technology, 2006, 32(1): 130-131, 144. (In Chinese)

论文截图
版权:如无特殊注明,文章转载自网络,侵权请联系cnmhg168#163.com删除!文件均为网友上传,仅供研究和学习使用,务必24小时内删除。