Abstract: Introduced one kind inlays the CAN main line network based on DS80C410 in the cafeteria to sell the food system’s design, including system’s network architecture and hardware design. Introduced in with emphasis the system the window machine hardware, the software design, and described in DS80C410 to inlay the CAN module in detail the initialization process and the text receiving and dispatching process.
Key word: DS80C410 CAN main line The cafeteria sells the food system Window machine
1. introduction
The CAN main line (Controller Area Network Bus) is one kind supports the distributional control effectively the serial communication network. It has a higher reliability, timeliness and the flexibility compared to the general correspondence main line. CAN is the multi-host’s side type work, in the network any node may in the random time on own initiative to the network in other node transmitter data, moreover punishes a group indiscriminately, the mailing address is flexible, does not need node information and so on station address. The CAN main line already widely applied in the industry scene control, plot An Fang, the environment monitoring and so on the numerous domains.
2. system structure
Real-time communication’s cafeteria sells the food system’s correspondence characteristic to be suitable to use the CAN main line. Its short frame structure very suitable system resistance disturbance ability and the real-time communication ability request is high, single communication load very small situation; The nimble network characteristic definitely may solve the large-scale cafeteria to sell in the food system many cafeterias and the sales network scattered question.
Sells food system network architecture as shown in Figure based on the CAN main line’s cafeteria 1. Uses always the linear connection, mainly contains three: Server, repeater and terminal. And server including work server and spare server, these two servers in business time also works, mutually for spare, guarantee system stable reliable. The repeater may extend the signal distance, increases the terminal number, the transformation correspondence speed, and can play the filter and the isolation role. The terminal is mainly the window which machine the sale uses, but also includes hangs the fail, the solution on-hook, to send the card/to be on the set and so on sufficiently.
Figure 1 the cafeteria sells the food system network structure drawing

Figure 2 window machine hardware architecture diagram
3. window machine hardware design
The window machine with sells the main onstage equipment which directly the food personnel and the user have to do. Figure 2 is the window machine hardware architecture diagram. Uses in Dallas to inlay CAN controller’s high speed network micro controller DS80C410 to take the window machine microprocessor, is responsible for the entire window machine and keyboard’s monitoring. MMM is non-contact IC (Mifare) the card reads/writes the module. This module under microprocessor’s control, may complete to the card non-contact type reads/writes and so on operations. The window machine communication task is the CAN controller which in DS80C410 inlays completes under the CPU control, on the CAN controller’s through CAN main line transceiver PCA82C250 receive main line data, reads for CPU, may also the data which sends CPU transmit to the CAN main line on. In inlays on CAN controller’s (the C0RX-CAN receive) and P5.0 (the C0TX-CAN transmission) the foot separately (receive data output) and TXD (transmission data feeds) the foot is connected through DS80C410 chip P5.1 with transceiver RXD. The window machine hardware also includes a 4×4 keyboard (10 integer keys, 6 functional keys), around each 10 numerical codes to demonstrate that (demonstration content is completely same), 32KB EEPROM (to use for to save expends record), the watch-dog and so on partial electric circuits.
4. window machine software design
4.1 master routine designs
The window machines and tools have Lian Wanghe to escape the net two movement ways. The window machine default working divides into continually the net movement, when presents the network breakdown or other reasons is unable the net moves continually, only then through the switch hypothesis to escape the net movement. Figure 3 is the window machine movement master routine flow chart. After window machine initialization, carries on keyboard processing first, LED demonstrates processing, and judges whether to recycle expends the record. Then inquires whether to read the card, after reading the card, transfer corresponding Lian Wanghuo escapes the net procedure, carries on business operation.

Figure 3 window machine master routine flow chart
4.1.1 CAN initialization
Window machine initialization, including to CAN module initialization. After the system hardware repositions, first shields the CAN interrupt, will then be located at DS80C410 SFR (special function register) C0C (CAN control register) CRST (replacement) the position clear 0, namely eliminated the CAN controller’s reset state, simultaneously SWINT (software initialization) the position must set 1, namely forbids CAN the main line activity, like this only then permits the procedure (C0EGM0~C0EGM3) carries on to the CAN module control register and the expansion frame shield register writes the operation, and establishes the correspondence baudrate, window machine ID, the window serial number, the CAN condition, the CAN mouth to enable, CAN fixed time and so on parameters, the initialization CAN module. Finally resumes the CAN interrupt. After the initialization had ended, wants the clear SWINT position, resumes the CAN main line’s activity.
4.2 subroutine designs
4.2.1 work flows
In continually net situation, when window machine after MMM gain card number, the card number transmission for the server, after the server receives the card number, in the database searches the corresponding card number the user remaining sum and its returns gives the window machine. The window machine demonstration receives user remaining sum, when after a business operation completes, the window machine the user total amount of consumption transmission for the server, after the server receives the amount of consumption, carries on the corresponding database record the renewal, and will have received the amount of consumption the confirmation frame (ACK) to return gives the window machine. If the window machine will read the card number (SNR) transmits for in server’s process the frame loss, namely the window machine has not received server’s remaining sum frame, window machine waiting reproduction time, after still had not received by now server’s remaining sum frame, will reissue the formerly card number. Most reissues 3 times, when after reissuing 3 times was still unable to receive server’s response frame, demonstrates the corresponding prompting message. If after paying up, the window machine issues server’s user amount of consumption frame loss, namely the server has not received the amount of consumption frame, is unable to carry on the corresponding record the renewal, similarly adopts the above method reproduction user amount of consumption. Figure 4 is continually the net program flow diagram.

Figure 4 continually net program flow diagram
Escapes in the net situation, what the window machine uses is the accounting means that will escape under the net condition user’s card number and expends the record to save completely in the window
In mouth machine EEPROM, after and so on system recovery continually network movement, the server recycles the data which from various windows machine saves, carries on the server database the renewal. Because escapes in the net situation the window machine not to be able to carry on the real-time communication with the server, therefore the procedure is simple, no longer gave the flow chart.
Figure 5 transmission subroutine

Figure 6 receive subroutine
4.2.2 transmissions and receive
In DS80C410 the CAN module has provided 15 text centers, takes the transmission or the receive data memory. The frame transmission and the receive realize through these 15 text center, may also choose either a certain text center transmission or the receive frame. These 15 text center transmission or the receive data’s priority order is by the text center in reverse order arrangement. The text center 1-14 may establish as the receive or the transmission data, text center 15 can receive the data. Text center control register (C0M1C~C0M15C) located at SFR. Each text center has a form register (C0MyF), 4 arbitration register and 8 bytes (C0MyD0~C0MyD7) data area. Arbitrates register’s value to be possible to establish in the initialization, may also establish in the calling order, moreover its value may along with the data receive, but changes automatically. Moreover, text center 15 C015M0~C015M3 registers, but may also carry out the filter which attaches.
When in the network some window machine is at the transmission mode, first to the use text center initialization, the text which must transmit loads the text center, the text center arbitrates register’s value to transmit as the frame identifier. Figure 5 is the use text center 1 transmits the data the program flow diagram, MSRDY (text center ready), DTUP (data updating), MTRQ (CPU transmission request) the equipotential line is the text center 1 control register C0M1C position.
When the window machine is at the accepting state, the CAN controller will act according to shields the register and the receive text center arbitration register’s value to receives the frame the ID identifier to carry on the judgment, whether the definite text center does receive, only then, when the receive frame’s identifier with arbitrates register’s value is equal, the frame talent is received; Moreover, the CAN module also has the media to shield the register and the media arbitration register, may 0th and the 1 two bytes carries on the extra verification to the receive data frame. Figure 6 is uses the text center 2 to receive the data the program flow diagram. And the MSRDY, DTUP, MTRQ equipotential line is the text center 2 control register C0M2C position.
5. concluding remark
DS80C410 has the ethernet and the CAN network micro controller. Including 10/100 ethernet MAC, three full-duplex hardware serial port, 8 bidirectional 8 bit ports, the CAN2.0B controller which may elect, 1-Wire® the main engine and 64 I/O pins and use in saving the user application and network storehouse 64K byte interior SRAM. In inlays the CAN module support standard (11) and the expansion (29) the identifier and the general mask, the media byte filtration, DeviceNet™, SDS and high-level CAN agreement, automatic baudrate pattern and SIESTA low power loss pattern. Inlays the CAN main line’s cafeteria based on DS80C410 to sell the food system, not only has the good stability, the security and the reliability, moreover real-time response ability, the network maintenance is convenient, the user interface is friendly, the software use, the promotion and the transplant are convenient, the cost is inexpensive.
This article innovates the spot: The DS80C410 integration rate is high, the 16MB storage space, can simultaneously complete continuously to the window and keyboard’s monitoring. Reaches as high as 75MHz the system clock frequency, causes monocycle instruction only 54ns. In inlays the CAN module, makes the window machine hardware architecture to be simpler, saves the hardware source. The CAN module’s 15 text center, causes the correspondence efficiency enhancement. With expands the exterior procedure/data memory’s operation to the CAN module operation to the monolithic integrated circuit is the same, the software realizes not complex.
Reference:
[1] Dallas/Maxim semiconductor. DS80C410/DS80C411 Network Microcontrollers with Ethernet and CAN, 2005.
[2] Dallas/Maxim semiconductor. High-Speed Microcontroller User’s Guide, 2004.
[3] Dallas/Maxim semiconductor. High-Speed Microcontroller User’s Guide: Network Microcon- troller Supplement, 2005.
[4] Rao Yun Tao, Zou Jijun, Zheng Yong Yun. Field bus CAN principle and applied technology [M]. Beijing: Beijing University of Aeronautics and Astronautics Publishing house, 2003.
no matter what [5] sensitive Zhao Yuehua. In inlays the CAN main line in the intelligence following Lu Qi in application [J]. Electric power automatic equipment, 2003, (11): 0060-03, P60~62.
[6] Dallas \ Maxim integration product company. CAN main line and integration solution [J]. Today electron, 2003(5), P29~31.
[7] Zou Jijun, Rao Yun Tao, Zheng Yong Yun, Feng forest. The CAN main line sells in food system’s application [J] in the cafeteria. Xiamen University journal (natural sciences version), 2001(8), supplement 1, the 40th volume, P252~254.
[8] Zou Jijun, Rao Yun Tao. The cafeteria sells food system window machine design [J]. Donghua Technical institute journal, 2004(3), the 27th volume, P293~297.
[9] Tian Xihui, opens 玘, Zhang Lianchao, Luo Shitu .CAN main line and applied technology [J]. micro computer information (observation automation) 2004,(10).