Design of intelligent safe based on AT91SAM9260

Publisher:xxoke624Latest update time:2011-09-21 Source: 现代电子技术Keywords:AT91SAM9260 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

introduction

The metal safe management model has shortcomings such as security risks caused by human factors and insufficiently detailed recorded information. If intelligent management of items can be achieved and item logs can be automatically recorded, the quality and efficiency of safe management will surely be improved.

This paper designs an embedded control system for a smart safe based on the industrial-grade AT91SAM9260 processor. The system uses fingerprint comparison to manage item permissions, the camera system automatically records the entry and exit of items, and the system has an alarm function. The system is embedded with a high-performance, multi-tasking real-time operating system Linux, which has the advantages of open source code, small kernel size, and low system resource usage, ensuring the reliability and real-time performance of the system.

1 System Hardware Design

1.1 Smart safe hardware structure

The intelligent safe system consists of an upper PC and a lower intelligent safe, and its hardware structure is shown in Figure 1.

Smart safe hardware structure

The upper PC can query the status and item record information of the lower intelligent safe. The lower intelligent safe is composed of intelligent control computer, dual-screen reader, camera, fingerprint meter, status light, numeric keyboard, vibration sensor, electric lock and alarm. Its functions are as follows: the camera is used to capture the user of the safe; the card reader is used for the user of the safe to swipe the card to open the door of the corresponding authority; the fingerprint reader is used to provide a higher level of biometric authority management door; the numeric keyboard is used to input the door number when the user of the safe has multiple door permissions; the display is used to display the operation results; the alarm is used to alarm when illegal operation occurs; the dual-frequency reader is used to collect data from the dual-frequency tag on the confidential carrier; the vibration sensor is used to sense the vibration signal of the cabinet to prevent illegal intrusion; the intelligent control computer is used to control all the equipment in the cabinet to ensure that the intelligent safe can operate independently from the upper computer.

Before lending or returning items, the user first inputs the fingerprint through the fingerprint collector. The central control system opens the cabinet door through fingerprint comparison and corresponding authorization information, and the camera takes a photo of the user. The user can take out and return the items at this time. When the cabinet door is closed, the central control system starts the RFID reader to collect the information of the items in the cabinet, and compares it with the previous information to automatically obtain the items lent and returned by the user in this operation; finally, the central control system records the relevant information such as the door opening time, user image, lent and returned items, etc. in the storage area. The administrator can query the detailed records of item lending and returning at any time through the upper PC. The system also provides an alarm function under abnormal conditions to improve security.

1.2 Hardware Circuit Layer

The central control hardware circuit logic of the system is shown in Figure 2.

Central control hardware circuit logic

The central processor uses the AT91SAM9260 chip of Atmel Company, which is a 32-bit processor based on the ARM926EJ-S core, with an operating frequency of 190 MHz and an instruction running speed of 210 MIPS. It has 8 KB instruction and 8 KB data cache, 8 KB SRAM and 32 KB ROM, which can be accessed in a single cycle between the processor and the bus speed. It has a rich peripheral interface, including USB full-speed HOST and Device interface, 10M/100M BaseT, Ethernet MAC, image sensor interface, multimedia card interface (MCI), synchronous serial controller (SSC), 4 universal synchronous/asynchronous receivers and transmitters (USART), 2 two-wire asynchronous receivers and transmitters (UARTs), master/slave serial peripheral interface (SPI), and 1 three-channel 16 b timing controller (TC), 2 two-wire E1 (TWI), 4 10 b ADCs, 3 32 b parallel I/O controllers, and the peripherals use DMA channels.

The host PC is connected to the UART1 port of ARM through the RJ-45 interface circuit. The dual-frequency reader, card reader, numeric keyboard and fingerprint reader are connected to the RJ-45 interface circuit and then to the UART2-5 ports of ARM respectively. The camera is connected to the USB host port of ARM through the USB port. The control signals of the electric lock and alarm output by ARM are controlled by the ULN2003A op amp chip to control the small DC relay to drive the electric lock and alarm. The vibration sensor is inverted and output to the input I/O pin of ARM through 74L804. NANDFLASH is directly connected to the I/O pin of ARM.

2 Embedded Operating Systems

Three-layer structure of embedded operating system

The system can be divided into three layers from the inside to the outside: operating system layer, task layer and hardware circuit layer, as shown in Figure 3. The embedded operating system is the control center of the embedded system's software and hardware resources. It organizes multiple tasks to share the resources of the embedded system. Common embedded real-time operating systems include Window CE, VxWorks, μC/OS-Ⅱ, Linux, etc. The latter two operating systems have free open source codes.

2.1 Embedded operating system solution selection

In order to select a suitable embedded operating system, this paper analyzes and compares the process scheduling, file system support and system porting of the open source μC/OS-Ⅱ and Linux operating systems, because these are the key factors in the design, application and porting of embedded operating systems.

(1) Process Scheduling

Process scheduling is the competition for the use of internal resources of the computer system by multiple tasks in the operating system coordination scheduling system. As a real-time operating system, μC/OS-Ⅱ adopts a preemptive real-time multitasking kernel, which runs the highest priority task that is ready at any time. μC/OS-Ⅱ can support up to 64 tasks. It searches for the highest priority task through the ready task table and performs task switching.

The Linux operating system suspends the process at regular intervals, and the system generates fast and periodic clock timing interrupts, and determines the called process through the scheduling function. The task_struct structure of each process in the Linux operating system has five parameters: scheduling policy, static priority, dynamic priority, time slice, and real-time priority. Linux distinguishes between real-time processes and ordinary processes based on the scheduling policy, and real-time processes run before ordinary processes. The Linux operating system uses different standards to select processes for different processes of the same type:

① Ordinary process scheduling. When the scheduling policy value is SCHED_OTHER, it is an ordinary user process. Linux uses the dynamic priority scheduling standard, and the basis for selecting the process is the value of the process time_sli-ce.

② Real-time process scheduling. For real-time processes, Linux uses two scheduling strategies, namely first-come-first-served scheduling and time slice round-robin scheduling. When the scheduling strategy value is SCHED_FIFO, the first-come-first-served scheduling rule is used. When the scheduling strategy value is SCHED_RR, the time slice round-robin scheduling rule is used, that is, the CPU is released when the time slice is used up, and the process is placed at the end of the waiting queue.

(2) File system

The file system is responsible for accessing and managing file information. In embedded systems, common file systems include YAFFS, JFFS2, CramFS, RamFS, Ramdisk, etc.

The μC/OS-Ⅱ operating system itself does not support the file system. Although μC/OS-Ⅱ has good scalability and can expand its support for the file system if necessary, it will increase the development workload.

The Linux operating system has a complete file system and network advantages. It can easily support network file systems and has built-in TCP/IP protocols, which makes it convenient for Linux to develop network access devices.

(3) Operating system migration

Embedded operating systems must be ported before they can run on different microprocessors. Both μC/OS-Ⅱ and Linux provide open source code, and their structured design is easy to tailor, so they can be ported to new processor platforms.

① Porting of μC/OS-Ⅱ. To port the μC/OS-Ⅱ operating system, the target processor must meet the following requirements: the processor's C compiler can generate reentrant code, and interrupts can be turned on and off using C language; the processor has sufficient storage capacity as a task stack in a multi-tasking environment; the processor has instructions to read and store stack pointers and registers into the stack or memory. Therefore, the porting of μC/OS-Ⅱ only requires modifying the relevant codes between different processors according to the above requirements.

②Linux porting.

First, the system is initialized: turn off Watchdog, change the system clock, initialize the storage controller, and copy the operating system kernel to the memory. This series of operations is called BootLoader. Usually, U-boot is transplanted to realize the function of BootLoader; secondly, Linux kernel transplantation is performed: download the kernel source code, cut and configure the kernel, compile the kernel to generate an image file, and download it to the target board; finally, the file system is transplanted: generate the root file system directory, transplant Busybox, generate an image file, and download it to the target board. In summary, both μC/OS-Ⅱ and Linux have open source code and meet high real-time requirements. μC/OS-Ⅱ is a compact real-time operating system. Its kernel provides functions such as task scheduling and management, time management, synchronization and communication between tasks, memory management and interrupt services. The minimum kernel can be compiled to 2 kB, and the kernel only occupies 6 to 10 KB after all functions are compiled. Although μC/OS-Ⅱ has high execution efficiency, small footprint, excellent real-time performance, and strong scalability, the μC/OS-Ⅱ system lacks support for the file system, so μC/OS-Ⅱ is suitable for applications with limited storage resources and small control systems. However, Linux has multi-tasking, customizable kernel, perfect network communication, graphics and file management mechanism, can support a large number of peripheral hardware devices and other functions, its performance is efficient and stable, and the development and transplantation environment is good. In view of the fact that the system needs to complete multiple task control and file management, and has abundant storage resources, and also considering the future network expansion, Linux was selected as the embedded operating system.

2.2 Task Layer

For applications managed by the Linux operating system, firstly, relatively independent sub-function modules are divided according to the system functions. Each module is a task, and each task is composed of several sub-tasks. The scheduling between tasks is determined by the Linux kernel scheduler. The tasks divided by the system include:

① Read/write UART0 task. It is mainly responsible for interacting with the host PC, parsing and executing the control commands sent by the host PC, and returning the results of the execution to the host PC.

② Read/write UART1 camera task. When the user inputs the fingerprint, the fingerprint reader is activated to receive the fingerprint data, the camera is activated, and the user is photographed. After the cabinet door is closed, the RFID reader is activated to collect the file ID information in the cabinet and compare it with the last information to obtain the information of the items borrowed and returned by the user after this operation.

③ Recording task: When the UART1 task completes the RFID reader's collection task, the task will store the user's fingerprint information, the time of opening and closing the cabinet door, the user's head portrait, and the ID of the borrowed and returned files.

④ Cabinet door opening and closing task: After the fingerprint data is identified, the fingerprint data is compared with the data in the authorized fingerprint library, and the unlocking operation is performed if the match is successful.

⑤Alarm task: Cycle the vibration sensor and activate the alarm if abnormal vibration is found.

After writing the codes for these tasks and starting the operating system, the application starts running. To extend other functions, just add the corresponding tasks.

3 Conclusion

The experimental results show that the system meets the users' confidentiality needs, has real-time processing capabilities, and is easy to expand. The selected Linux multi-tasking real-time operating system provides good support in process scheduling, file system management, etc.

Keywords:AT91SAM9260 Reference address:Design of intelligent safe based on AT91SAM9260

Previous article:CAN bus realizes industrial network distributed measurement and control system
Next article:DSP video processing via open source API

Recommended ReadingLatest update time:2024-11-17 02:58

Multi-mode buoy shore-based data transceiver platform based on ARM9260
    The ocean occupies more than two-thirds of the earth's surface, and with its rich resources, vast space and huge regulatory effect on the earth's environment and climate, it has become an important part of the global ecosystem and human development. Therefore, the development of marine science and technology, espec
[Microcontroller]
Multi-mode buoy shore-based data transceiver platform based on ARM9260
Latest Industrial Control Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号