Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1. INTRODUCTION
An embedded system is a special-purpose system in which the computer is completely encapsulated by or dedicated to the device or system it controls. Unlike a general-purpose computer, such as a personal computer, an embedded system performs one or a few pre-defined tasks, usually with very specific requirements. Since the system is dedicated to specific tasks, design engineers can optimize it, reducing the size and cost of the product. Embedded systems are often mass-produced, benefiting from economies of scale.
1.3 Advantages
Biometrics has no risk of Forgetting it Losing it Getting it stolen Getting it copied Being used by anyone else.
High Distinctiveness Even identical twins have different fingerprints (most biometrics fail)
Fingerprints are formed in the fetal stage and remain structurally unchanged throughout life.
Advantages
Uniqueness Surety over the Cards and Keypads No need to further invest on the Cards Cost No need to further manage the Cards Writing Devices
BUZZER
LCD
EEPROM
EMBEDDED CONTROLLER
KEY-PAD
FINGER
SCANNER
3.2 APPLICATION SOLUTION 1. When ARA-EM01 is embedded into your system, the other functions will be controlled by MCU Controller, so developer can realize his own function logic,
user interface and communication port through hard ware and soft ware development, such as fingerprint time and attendance and so on.
2. Expand the port such as RS485, Wiegand, even GPRS wireless communication with central controller outside by MCU in the central controller system.
3.3 Hardware specification pin 1 2 3 Name GND Reset TXD spec Grand Module reset control Serial sender
4 5 6 REMARKS
1 reset signal is the low level; the level width is bigger than 10ms. 2 high level turn on the power, low level turn off the power.
10
item Work Voltage Work Current Sleep current Work Temperature Humility Module size
Measure
In
50
60
80
mA
Is
10
12
uA
Tn
20
70
Hn Ln
30 40mm*25mm 20mm*25mm
120
mm
3.5.1 INTERFACE Type UART 3.3V CMOS level Baud rates up to 921.6kbps (factory default is 115.2kbps) RS232/422/485 supported via additional level converter Digital I/O 3.3V CMOS level 8 ports separately configurable 26bit Wiegand I/O supported via additional level converter Description
11
3.5.2 CONNECTOR SPECIFICATIONS Connector Usage J1 J2 Host interface port I Host interface port II (Molex 53261-8090
compatible) J3 J4 Debug port for factory use only Sensor interface port, 20 pin FPC/FFC
3.5.3 FLASH STORAGE STRUCTURE Address 0x0000-0x7fff 0x8000-0x8fff Spec Some codes System parameters storage 0x9000-0xffff Fingerprint database 28k- the end Size 32k 4k
12
4 5 6 7
13
PS_UpChar
Code: 08H
Function: transfer the data in the features buffer to the PC. Function: load a template from PC to features buffer. Function: delete a template in the flash fingerprint database. Function: clear flash fingerprint database
PS_DownChar
Code: 09H
PS_DeletChar
Code: 0CH
PS_Empty
Code: 0DH
PS_WriteReg
Code: 0EH
PS_ReadSysPar a PS_SetPwd
PS_VfyPwd
Code: 13H
PS_GetRandom Code
Code: 14H
eteNum
The entire data packets head is 0xEF01, 0xFFFFFFFF Command Packet Format Nam e Packet head Devic e addres s Pack et Flag Packe t Lengt h 2byte s 1byte 2 bytes Comma nd Paramet er 1 Paramet . er N Checksu m
Size
2bytes
4bytes 1 byte
spec
0xEF0 1
xxxx
01
Data Packet Format Nam e Pack et head Devic e addres s Pack et Flag Packe t Lengt h Comman Paramet d er 1 . Paramet er N Checksu m
15
Size
2byte s
4bytes 1 byte
2byte s
N bytes
2 bytes
Last Data Packet Nam e Packet head Devic e addres s Pack et Flag Packe t Lengt h 2byte s N bytes 2 bytes Comma nd Paramet er 1 Paramet . er N Checksu m
Size
2bytes
4bytes 1 byte
spec
0xEF0 1
xxxx
08
1. Download or upload the data packet in the same format. 2. Packet length = the total bytes quantity of from the packet length to the checksum including checksum but not including the bytes quantity of the packet length itself. 3Checksum is the summer of all the bytes quantity from the packet flag to checksum including packet flag; neglect the rounding over 2bytes. Response packet/data packet: The Packet flag = 07 The packet flag = 02 The packet flag = 08 response packet data packet, and packet followed the last data packet
16
3.4 Sensor
17
number of second processors to be made to work with the BBC Micro platform, but processors such as the Motorola 68000 and National Semiconductor 32016 were unsuitable, and the 6502 was not powerful enough for a graphics based user interface. Acorn would need a new architecture, having tested all of the available processors and found them wanting. Acorn then seriously considered designing its own processor, and their engineers came across papers on the Berkeley RISC project. They felt it showed that if a class of graduate students could create a competitive 32-bit processor, then Acorn would have no problem. A trip to the Western Design Center in Phoenix, where the 6502 was being updated by what was effectively a single-person company, showed Acorn engineers Steve Furber and Sophie Wilson that they did not need massive resources and state-of-the-art R&D facilities. The official Acorn RISC Machine project started in October 1983. VLSI Technology was chosen as silicon partner, since it already supplied Acorn with ROMs and some custom chips. The design was led by Wilson and Furber, with a key design goal of achieving low-latency input/output (interrupt) handling like the 6502. The 6502's memory access architecture had allowed developers to produce fast machines without the use of costly direct memory access hardware. VLSI produced the first ARM silicon on 26 April 1985 it worked the first time and came to be termed ARM1 by April 1985. The first "real" production systems named ARM2 were available the following year. The ARM2 featured a 32-bit data bus, a 26-bit address space and twenty-seven 32-bit registers. Program code had to lie within the first 64 M byte of the memory, as the program counter was limited to 24 bits because the top 6 and bottom 2 bits of the 32bit register served as status flags. The ARM2 was possibly the simplest useful 32-bit microprocessor in the world, with only 30,000 transistors (compare them with Motorola's six-year older 68000 model which was aptly named, since it contained 68,000 transistors). Much of this simplicity comes from not having microcode (which represents about one-quarter to one-third of the 68000) and, like most CPUs of the day, not including any cache. This simplicity led to its low power usage, while performing better
19
than the Intel 80286. A successor, ARM3, was produced with a 4 KB cache, which further improved performance. The ARM core has remained largely the same size throughout these changes. ARM2 had 30,000 transistors, while the ARM6 grew to only 35,000. ARM's business has always been to sell IP cores, on which this core. licensees use to design
The original
manufacturer combines the ARM core with a number of optional parts to produce a complete CPU, one that can be built on old semiconductor fabs and still deliver substantial performance at a low cost. The most successful implementation has been theARM7TDMI with hundreds of millions sold.
4.2 ARM7
ARM720T, ARM7EJ-S, ARM7TDMI and ARM7TDMI-S The ARM7 family is a range of low-power 32-bit RISC microprocessor cores optimized for cost and power-sensitive applications introduced in 1994, the ARM7 family continues to be used in a variety of designs, but newer and more demanding designs are increasingly making use of latest ARM processors such as the Cortex-M0 and Cortex-M3 both of which offer several significant enhancements over the ARM7 family. The ARM Cortex-M3 32-bit processor has been specifically developed to provide a high-performance, low-cost platform for a broad range of
applications including microcontrollers, automotive body systems, industrial control systems and wireless networking. The Cortex-M3 processor provides outstanding computational performance and exceptional system response to interrupts while meeting low cost requirements through small core footprint, industry leading code density enabling smaller memories, reduced pin count and low power consumption. The ARM Cortex-M0 processor is the smallest, lowest power and most energy-efficient ARM processor available. The exceptionally small silicon area, low
20
power and minimal code footprint of the processor enables developers to achieve 32-bit performance at an 8-bit price point, bypassing the step to 16-bit devices. The ARM7 family offers up to 130 MIPS (Dhrystone2.1) and incorporates the Thumb 16-bit instruction set. The family consists of the ARM7TDMI, ARM7TDMIS and ARM7EJ-S processors.
ARM 7 may take several cycles for data transfer instructions since they will require at least two accesses onto the bus (one for the instruction one for the data).
4.3.1 ARM7 PROGRAMMING MODEL The programmers model of the ARM 7 consists of 15 user registers, as shown in Fig. 3, with R15 being used as the Program Counter (PC). Since the ARM 7 is a loadand-store architecture, a user program must load data from memory into the CPU registers, process this data and then store the result back into memory.
Fig 4.1: Load and Store Architecture As stated above R15 is the Program Counter. R13 and R14 also have special functions; R13 is used as the stack pointer, though this has only been defined as a programming convention. Unusually the ARM instruction set does not have PUSH and POP instructions so stack handling is done via a set of instructions that allow loading and storing of multiple registers in a single operation. Thus it is possible to PUSH or POP the entire register set onto the stack in a single instruction. R14 has special significance and is called the link register. When a call is made to a procedure, the return address is automatically placed into R14, rather than onto a stack. A return can then be implemented by moving the contents of R14 into R15. For multiple calling trees, the contents of R14 (the link register) must be placed onto the stack.
22
Fig 4.2: User Mode Register Model In addition to the 16 CPU registers, there is a current program status register (CPSR). This contains a set of condition code flags in the upper four bits that record the result of a previous instruction, as shown in Fig 4. In addition to the condition code flags, the CPSR contains a number of user-configurable bits that can be used to change the processor mode, enter Thumb processing and enable/disable interrupts.
23
4.3.2 ARM7 PROGRAM FLOW CONTROL In all processors there is a small group of instructions that are conditionally executed depending on a group of processor flags. These are branch instructions such as branch not equal. Within the ARM instruction set, all instructions are conditionally executable.
The top four bits of each instruction contain a condition code that must be satisfied if the instruction is to be executed. This goes a long way to eliminating small branches in the program code and eliminating stalls in the pipeline so increasing the overall program performance. Thus for small conditional branches of three instructions or less, conditional execution of instructions should be used. For larger jumps, normal branching instructions should be used.
24
4.3.3 THUMB SUPPORT The ARM processor is capable of executing both 32-bit (ARM) instructions and 16-Bit (Thumb instructions). The Thumb instruction set must always be entered by running a Branch exchange or branch link exchange instruction and NOT by setting the T bit in the CPSR. Thumb instructions are essentially a mapping of their 32 bit cousins but unlike the ARM instructions, they are unconditionally executed except though for branch instructions.
Thumb instructions only have unlimited access to registers R0-R7 and R13 R15. A reduced number of instructions can access the full register set.
25
The Thumb instruction set has the same load and store multiple instructions as ARM and in addition, has a modified version of these instructions in the form of PUSH and POP that implement a full descending stack in the conventional manner. The Thumb instruction set also supports the SWI instruction; except that the ordinal field is only 8 bits long to support 256 different SWI calls. When the processor is executing Thumb code and an exception occurs, it will switch to ARM mode in order to process the exception. When the CPSR is restored the, Thumb bit will be reset and the processor continues to run Thumb instructions.
Fig.4.4 Thumb Exception Processing Thumb has a much higher code density than ARM code, needing some 70% of the space of the latter. However in a 32-bit memory, ARM code is some 40% faster than Thumb. However it should be noted that if you only have 16-bit wide memory then Thumb code will be faster than ARM code by about 45%. Finally the other important aspect of Thumb is that it can use up to 30% less power than ARM code.
26
27
The LCDs used exclusively in watches, calculators and measuring instruments are the simple seven-segment displays, having a limited amount of numeric data. The recent advances in technology have resulted in better legibility, more information displaying capability and a wider temperature range. These have resulted in the LCDs being extensively used in telecommunications and entertainment electronics. The LCDs have even started replacing the cathode ray tubes (CRTs) used for the display of text and graphics, and also in small TV applications. This section describes the operation modes of LCDs then describe how to program and interface an LCD to 8051 using Assembly and C. 4.4.1LCD operation 1. The declining prices of LCDs. 2. The ability to display numbers, characters and graphics. This is in contrast to LED which is limited to numbers and a few characters. 3. Incorporation of a refreshing controller into the LCD, there by relieving the CPU of the task of refreshing the LCD. In the case of LED s, they must be refreshed by the CPU to keep on displaying the data. 4. Ease of programming for characters and graphics. 4.4.2 LCD pin description: The LCD discussed in this section has 14 pins. The function of each pin is given in table.
Fig:4.5 LCD
28
Pin
1 2 3
symbol
Vss Vcc VEE
I/O
----
Description
Ground +5V power supply Power supply to
command register RS=1 to select data register 5 R/W I R/W=0 for write R/W=1 for read 6 7 8 9 10 11 12 13 14 E DB0 DB1 DB2 DB3 DB4 DB5 DB6 DB7 I/O I/O I/O I/O I/O I/O I/O I/O I/O Enable The 8-bit data bus The 8-bit data bus The 8-bit data bus The 8-bit data bus The 8-bit data bus The 8-bit data bus The 8-bit data bus The 8-bit data bus
The LCD can display a character successfully by placing the 1. Data in Data Register
1. Data corresponds to the ASCII value of the character to be printed. This can be done by placing the ASCII value on the LCD Data lines and selecting the Data Register of the LCD by selecting the RS (Register Select) pin. 2. Each and every display location is accessed and controlled by placing respective command on the data lines and selecting the Command Register of LCD by selecting the (Register Select) RS pin. The commonly used commands are shown below with their operations.
Code (hex)
1 2 80 C0 38
4.4.3 USES The LCDs used exclusively in watches, calculators and measuring instruments are the simple seven-segment displays, having a limited amount of numeric data. The recent advances in technology have resulted in better legibility, more information displaying capability and a wider temperature range. These have resulted in the LCDs being extensively used in telecommunications and entertainment electronics.
30
4.6 Pin description When a processor communicates with the outside world, it provides data in byte sized chunks. Computers transfer data in two ways: parallel and serial. In parallel data transfers, often more lines are used to transfer data to a device and 8 bit data path is expensive. The serial communication transfer uses only a single data line instead of the 8 bit data line of parallel communication which makes the data transfer not only cheaper but also makes it possible for two computers located in two different cities to communicate over telephone. Serial data communication uses two methods, asynchronous and synchronous. The synchronous method transfers data at a time while the asynchronous transfers a single byte at a time. There are some special IC chips made by many manufacturers for data communications. These chips are commonly referred to as UART (universal
31
asynchronous receiver-transmitter) and USART (universal synchronous asynchronous receiver transmitter). The AT89C51 chip has a built in UART.In asynchronous method, each character is placed between start and stop bits. This is called framing. In data framing of asynchronous communications, the data, such as ASCII characters, are packed in between a start and stop bit. We have a total of 10 bits for a character: 8 bits for the ASCII code and 1 bit each for the start and stop bits. The rate of serial data transfer communication is stated in bps or it can be called as baud rate. To allow the compatibility among data communication equipment made by various manufacturers, and interfacing standard called RS232 was set by the Electronics industries Association in 1960. This standard is used in PCs and numerous types of equipment. However, since the standard was set long before the advent of the TTL logic family, its input and output voltage levels are not TTL compatible. In RS232, a 1 bit is represented by -3 to -25V, while a 0 bit is represented +3 to +25 V, making -3 to +3 undefined. For this reason, to connect any RS232 to a microcontroller system we must use voltage converters such as MAX232 to connect the TTL logic levels to RS232 voltage levels and vice versa. MAX232 ICs are commonly referred to as line drivers.
32
The RS232 cables are generally referred to as DB-9 connector. In labeling, DB-9P refers to the plug connector (male) and DB-9S is for the socket connector (female). The simplest connection between a PC and microcontroller requires a minimum of three pin, TXD, RXD, and ground. Many of the pins of the RS232 connector are used for handshaking signals. They are bypassed since they are not supported by the 8051 UART chip.
IBM PC/ compatible computers based on x86(8086, 80286, 386, 486 and Pentium) microprocessors normally have two COM ports. Both COM ports have RS232 type connectors. Many PCs use one each of the DB-25 and DB-9 RS232 connectors. The COM ports are designated as COM1 and COM2. We can connect the serial port to the COM 2 port of a PC for serial communication experiments. We use a DB9 connector in our arrangement. The AT89C52 has two pins that are used specifically for transferring and receiving data serially. These two pins are called TXD and RXD and are part of the port3 (P3.0 and P3.1). These pins are TTL compatible; therefore they require a line driver to make them RS232 compatible. One such line driver is the MAX232 chip. One advantage of MAX232 chip is that it uses a +5v power source which is the same as the source voltage for the at89c51. The MAX232 has two sets of line drivers for receiving and transferring data. The line drivers for TXD are called T1 and T2 while the line drivers for RXD are designated as R1 and R2. T1 and R1 are used for TXD and RXD of the 89c51 and the second set is left unused. In MAX232 that the TI line driver has a designation of T1 in and T1 out on pin numbers 11 and 14, respectively. The T1 in pin is the TTL side and is connected to TXD of the microcontroller, while TI out is the RS232 side that is connected to the RXD pin of the DB9 connector.
33
To allow data transfer between PC and the microcontroller system without any error, we must make sure that the baud rate of the 8051 system matches the baud rate of the PCs COM port. When communicating with various microprocessors one need convert the RS232 levels down to lower levels, typically 3.3 or 5.0v.
logic HIGH
+3v .. +15v
0v..+8v
LOW
Thus the RS232 signal levels are far too high TTL electronics, and the negative RS232 voltage for high cant be handle at all by computer logic. To receive serial data from an RS232 interface the voltage has to be reduced. Also the high and low voltages are to be inverted. This level converter uses MAX232 and five capacitors. The MAX232 from Maxim was the first IC which in one package contains the necessary drivers and receivers to adapt
the RS232 signal voltage levels to TTL logic .It became popular because it just needs one voltage(+5v or +3.3v) and generates the necessary RS232 levels.
34
1 x female serial port connector 1 x MAX232 4 x 1uf capacitor 1 x 10uf capacitor soldering iron,wires,breadboard etc
35
4.7 Schematic Diagram 4.5.1 RXD and TXD pins in the 8052 The 8052 has two pins that are used specifically for transferring and receving data serially. These two pins are called TXD and RXD and are part of the port 3 group. Pin 11 of the 8052 is assigned to TXD and pin 10 is designated has RXD these pins are TTL compatible, therefore, they require a line driver to make them RS232 compatiable. One such line driver is the MAX232 chip. 4.5.2 Serial Communication UART0, UART1 are the two serial com ports present in LPC2148 controller. To perform the communication TxD0, TxD1, RxD0, and RxD1 are used for serial communication purpose. TxD0, TxD1 are the output pins which can send the data from the controller end. RxD0, RxD1 are the input pins which can receive the data from other end. For UART0 TxD0 and RxD0 are use for communication For UART1 TxD1 and RxD1 are use for communication To transmit a data or to receive a data, separate buffer registers are to be used. THR (Transmitting Buffer Register) is the register used for transmitting a data. RBR (Receiving Buffer Register) is the register used for receiving a data. For UART0 U0THR, U0RBR For UART1 U1THR, U1RBR
36
Bit 0 and 1 are used to set the length of the word i.e, 0 0 5 bit character length 0 1 6 bit character length 1 0 7 bit character length 1 1 8 bit character length For our purpose the character size is 8 bit so we must use Bit 0 as 1 and Bit 1 as 1 Bit-2 is used to select the number of stop bits i.e, 0 1 stop bit 1 2 stop bits For our purpose we use only 1 stop bit so Bit 2 is to be 0. Bit-3 indicates the selection of Parity enable i.e, 0 Disable the parity generation and checking of parity 1 Enable the parity generation and checking of parity For our purpose we simply disable the parity bit so Bit 3 is 0.
37
Bits 4 and 5 are for the selection of type of parity bit, as we dont use any parity bit generation Bit 4 and 5 are to be 0s Bit-6 is to be 0 to disable the break of transmission Bit-7 is the DLAB DLAB Divisor Latch Access Bit Used to access THR and RBR or Divisor Latch Registers DLAB is 0 Disable the access of Divisor Latches and enable THR and RBR to transmit and receive the characters. DLAB is 1 Used to enable in accessing the Divisor Latches 4.5.4 Line Status Register LSR is read only register that provides the status information on Tx and Rx blocks.
Bit-0 is used in receiving mode and Bit-5 is used in transmitting mode. RDR goes high when any character is received; Similarly THRE pin goes high when any character is transmitted. So for transmitting we use UxLSR as 0x20; And for receiving we use UxLSR as 0x01; In order to be able to program the Baud rate generator this bit must be set. The Baud rate generator is a sixteen bit prescaler which divides down Pclk to generate the UART clock
38
which must run at 16 times the Baud rate. Hence the formula used to calculate the UART Baud rate is: Divisor = Pclk/16 x BAUD RATE; Pclk = Cclk/4; Cclk = Fosc * 5; Fosc = 11.0592MHz; Divisor = (((11059200*5)/4)/16) * 9600 180 To set 9600 baud rate load DLL = 0XB4; DLM = 0X00;
4.8 Interfacing Circuit of max232 with LPC2148 UART1 has the same basic structure as UART0; however it has additional support for modem control. This consists of additional external pins to support the full modem interface (CTS, DCD, DSR, DTR, RI, RTS), there are two additional registers the modem control register and the modem status register and an additional interrupt source to provide a modem status interrupt.
39
char x [16] = EMBEDDED SYSTEMS; int i; PINSEL0 = 0X00000001; U0LCR = 0X00000083; baud rate U0DLL = 0XB4; U0DLM = 0X00; U0LCR = 0X00000003; Receive for (i=0; i<16;i++) { U0THR=x[i]; while (! (U0LSR & 0X20)); // wait until U0LSR is = 0X20 } } // to enable TxD0 pin // to enable Divisor latch registers so as to set // to set baud rate 9600 // to enable buffer registers either to transmit /
{ char x [16]; int i; PINSEL0 = 0X00000001; U0LCR = 0X00000083; baud rate U0DLL = 0XB4; U0DLM = 0X00; U0LCR = 0X00000003; Receive for (i=0; i<16;i++) { while (! (U0LSR & 0X01)); x[i] =U0RBR; } } // wait until U0LSR is = 0X01 // to enable TxD0 pin // to enable Divisor latch registers so as to set // to set baud rate 9600 // to enable buffer registers either to transmit /
4.6 BUZZER
A buzzer or beeper is an audio signaling device, which may be mechanical, electromechanical, or Piezoelectric. Typical uses of buzzers and beepers include alarms, timers and confirmation of user input such as a mouse click or keystroke. Early devices were based on an electromechanical system identical to an electric bell without the metal gong. Similarly, a relay may be connected to interrupt its own actuating current, causing the contacts to buzz. Often these units were anchored to a wall or ceiling to use it as a sounding board. The word "buzzer" comes from the rasping noise that electromechanical buz zers made.
42
Fig:4.9 Piezoelectric disk beeper A piezoelectric element may be driven by an oscillating electronic circuit or other audio signal source, driven with a piezoelectric audio amplifier. Sounds commonly used to indicate that a button has been pressed are a click, a ring or a beep. To interface a buzzer the standard transistor interfacing circuit is used. Note that if a different power supply is used for the buzzer, the 0V rails of each power supply mustbe connected to provide a common reference. If a battery is used as the power supply, it is worth remembering that piezo sounders draw much less current than buzzers. Buzzers also just have one tone, whereas apices sounder is able to create sounds of many different tones. To switch on buzzer -high 1 To switch off buzzer -low 1 0V A piezo sounder or speaker can be used to produce many different sounds, whereas a buzzer can only produce a single tone. Buzzers produce a noise when power is applied, but a piezo or speaker requires a pulsed signal to generate the noise. Fortunately this is very easy to generate from the microcontroller by using the BASIC sound command.
43
44
Unipolar stepping motors with 5 or 6 wires are usually wired as shown in the schematic in Figure 1, with a center tap on each of two windings. In use, the center taps of the windings are typically wired to the positive supply, and the two ends of each winding are alternately grounded to reverse the direction of the field provided by that winding. An is available. The motor cross section shown in Figure 1 is of a 30 degree per step motor the difference between these two motor types is not relevant at this level of abstraction. Motor winding number 1 is distributed between the top and bottom stator pole, while motor winding number 2 is distributed between the left and right motor poles. The rotor is a permanent magnet with 6 poles, 3 south and 3 north, arranged around its circumference. For higher angular resolutions, the rotor must have proportionally more poles. The 30 degree per step motor in the figure is one of the most common permanent magnet motor designs, although 15 and 7.5 degree per step motors are widely available. As shown in the figure, the current flowing from the center tap of winding 1 to terminal a causes the top stator pole to be a north pole while the bottom stator pole is a south pole. This attracts the rotor into the position shown. If the power to winding 1 is removed and winding 2 is energized, the rotor will turn 30 degrees, or one step. Assuming positive logic, where a 1 means turning on the current through a motor winding, the following two control sequences will spin the motor illustrated in Figure 1 clockwise 24 steps or 4 revolutions: Winding 1a 1000100010001000100010001 Winding 1b 0010001000100010001000100 Winding 2a 0100010001000100010001000 Winding 2b 0001000100010001000100010 Time ---> Winding 1a 1100110011001100110011001 Winding 1b 0011001100110011001100110 Winding 2a 0110011001100110011001100 Winding 2b 1001100110011001100110011 Time --->
45
Note that the two halves of each winding are never energized at the same time. Both sequences shown above will rotate a permanent magnet one step at a time. The top sequence only powers one winding at a time, as illustrated in the figure above; thus, it uses less power. The bottom sequence involves powering two windings at a time and generally produces a torque about 1.4 times greater than the top sequence while using twice as much power. 4.7.3 Bipolar Stepper Motor
Bipolar permanent magnet and hybrid motors are constructed with exactly the same mechanism as is used on needed to reverse the polarity of each pair of motor poles is more complex. The schematic in Figure 2 shows how such a motor is wired, while the motor cross section shown here is exactly the same as the cross section shown in Figure 1. The drive circuitry for such a motor requires an H-bridge control circuit for each winding. Briefly, an H-bridge allows the polarity of the power applied to each end of each winding to be controlled independently. The control sequences for single stepping such a motor are shown below, using + and - symbols to indicate the polarity of the power applied to each motor terminal: Terminal 1a +---+---+---+--Terminal 1b --+---+---+---+Terminal 2a -+---+---+---+-Terminal 2b ---+---+---+---+ Time --->
46
Note that these sequences are identical to those for a unipolar permanent magnet motor, at an abstract level, and that above the level of the H-bridge power switching electronics, the control systems for the two types of motor can be identical. Note that many full H-bridge driver chips have one control input to enable the output and another to control the direction. Given such bridge chips, one for each winding, the following control sequences will spin the motor identically to the control sequences given above: Enable 1 1111111111111111
47
Featuring continuous load current ratings to 500 mA for each of the drivers, the Series ULN28xxA/LW and ULQ28xxA/LW high- voltage, high-current Darlington arrays are ideally suited for interfacing between low-level logic circuitry and multiple peripheral power loads. Typical power loads totaling over 260 W (350 mA x 8, 95 V) can be controlled at an appropriate duty cycle depending on ambient temperature and number of drivers turned ON simultaneously. The ULx2803A/LW and ULx2804A/LW are the standard Darlington arrays. The outputs are capable of sinking 500 mA and will withstand at least 50 V in the OFF state. Outputs may be paralleled for higher load current capability. The ULx2823A/LW and ULx2824A/ LW will withstand 95 V in the OFF state. 4.8.1 FEATURES TTL, DTL, PMOS, or CMOS Compatible Inputs Output Current to 500 mA Output Voltage to 95 V Transient-Protected Outputs Dual In-Line Package or Wide-Body Small-Outline Package
Coil 1a
Coil 2a
Coil 1b
Coil 2b
48
4.9.2 Disadvantages Of Relays Relays are bulkier than transistors for switching small currents. Relays cannot switch rapidly, transistors can switch many times per second . Relays use more power due to the current flowing through their coil. Relays require more current than many chips can provide, so a low power transistor may be needed to switch the current for the relay's coil.
49
The function is same as that of a normal switch but here in relay no need to press the switch to make it on or off manually, rather a +5volts DC or 0 volt( in our case) will perform the function of making switch on or off respectively. When voltage is applied to the pin of the coils, the coil becomes energized making the switch closed and thus completing the circuit which is connected with the pins of the switch.
50
Most digital logic circuits and processors need a 5 volt power supply. To use these parts we need to build a regulated 5 volt source. Usually you start with an unregulated power supply ranging from 9 volts to 24 volts DC (A 12 volt power supply is included with the Beginner Kit and the Microcontroller Beginner Kit.). To make a 5 volt power supply, we use a LM7805 voltage regulator IC (Integrated Circuit). The IC is shown below
51
52
4.13 EEPROM
OVERVIEW The IS24C02 is a low cost 2,048-bit serial EEPROM. It is fabricated using ISSIs advanced CMOS EEPROM technology and operates from a single supply. The IS24C02 is internally organized as a 256 x 8 memory bank. The IS24C02 features a serial interface and software protocol allowing operation on a simple 2-wire bus. Up to eight IS24C02s may be connected to the 2-wire bus by programming the A0, A1, and A2 inputs.
PIN CONFIGURATION
PIN DESCRIPTIONS A0-A2 SDA SCL WC VCC GND Address Inputs Serial Data I/O Serial Clock Input Write Control Input Power Ground
A0, A1, and A2 - The address inputs are used to set the least significant three bits of the slave address. These inputs may be tied HIGH or LOW, or they may be actively driven.
53
These inputs allow up to eight IS24C02 devices to be connected together on the bus. When left floating, A0, A1 and A2 are pulled to ground. The default values are zeros. Serial Data (SDA) - The SDA pin is a bidirectional pin used to transfer data into and out of the device. Data may change only when SCL is LOW. It is an open-drain output, and may be wire ORed with any number of open-drain or open-collector outputs. Serial Clock (SCL) - The SCL input is used to clock all data into and out of the device. In the WRITE mode, data must remain stable when SCL is HIGH. In the READ mode, data is clocked out on the falling edge of SCL.
4.14 APPLICATIONS
The IS24C02 is ideal for high volume applications requiring low power and low density storage. This device uses a low-cost, space-saving 8-pin plastic package. Candidate applications include robotics, alarm devices, electronic locks, meters and instrumentation.
54
To help you get started, several example programs (located in the \C51\Examples, \C251\Examples, \C166\Examples, and \ARM\...\Examples) are provided. HELLO is a simple program that prints the string "Hello World" using the Serial Interface. 5.1.1Building an Application in Vision2 To build (compile, assemble, and link) an application in Vision2, you must: 1. Select Project - (for example, 166\EXAMPLES\HELLO\HELLO.UV2). 2. Select Project - Rebuild all target files or Build target. Vision2 compiles, assembles, and links the files in your project.
5.1.2Creating Your Own Application in Vision2 To create a new project in Vision2, you must 1. Select Project - New Project. 2. Select a directory and enter the name of the project file.
55
3. Select Project - Select Device and select an 8051, 251, or C16x/ST10 device from the Device Database. 4. Create source files to add to the project. 5. Select Project - Targets, Groups, Files, Add/Files, select Source Group1, and add the source files to the project. 6. Select Project - Options and set the tool options. Note when you select the target device from the Device Database all special options are set automatically. You typically only need to configure the memory map of your target hardware. Default memory model settings are optimal for most applications. 7. Select Project - Rebuild all target files or Build target. 5.1.3 Debugging an Application in Vision2 To debug an application created using Vision2, you must: 1. Select Debug - Start/Stop Debug Session. 2. Use the Step toolbar buttons to single-step through your program. You may enter G, main in the Output Window to execute to the main C function. 3. Open the Serial Window using the Serial #1 button on the toolbar. Debug your program using standard options like Step, Go, Break, and so on. 5.1.4 Starting Vision2 and creating a Project
Vision2 is a standard Windows application and started by clicking on the program icon. To create a new project file select from the Vision2 menu Project New Project. This opens a standard Windows dialog that asks you for the new project file name. We suggest that you use a separate folder for each project. You can simply use the icon Create New Folder in this dialog to get a new empty folder. Then select this folder and enter the file name for the new project, i.e. Project1.
56
Vision2 creates a new project file with the name PROJECT1.UV2 which contains a default target and file group name. You can see these names in the Project Window Files. Now use from the menu Project Select Device for Target and select a CPU for your project. The Select Device dialog box shows the Vision2 device database. Just select the microcontroller you use. We are using for our examples the Philips 80C51RD+ CPU. This selection sets necessary tool options for the 80C51RD+ device and simplifies in this way the tool Configuration
57
In addition to memory mapping, the simulator also provides support for the integrated peripherals of the various 8051 derivatives. The on-chip peripherals of the CPU you have selected are configured from the Device
5.2.2 Database selection You have made when you create your project target. Refer to page 58 for more Information about selecting a device. You may select and display the on-chip peripheral components using the Debug menu. You can also change the aspects of each peripheral using the controls in the dialog boxes. 5.2.3 Start Debugging You start the debug mode of Vision2 with the Debug Start/Stop Debug Session command. Depending on the Options for Target Debug Configuration, Vision2 will load the application program and run the startup code Vision2 saves the editor screen layout and restores the screen layout of the last debug session. If the program execution stops, Vision2 opens an editor window with the source text or shows CPU instructions in the disassembly window. The next executable statement is marked with a yellow arrow. During debugging, most editor features are still available. For example, you can use the find command or correct program errors. Program source text of your application is shown in the same windows. The Vision2 debug mode differs from the edit mode in the following aspects: The Debug Menu and Debug Commands described on page 28 are Available. The additional debug windows are discussed in the following. The project structure or tool parameters cannot be modified. All build Commands are disabled. 5.2.4 Disassembly Window The Disassembly window shows your target program as mixed source and assembly program or just assembly code. A trace history of previously executed
58
instructions may be displayed with Debug View Trace Records. To enable the trace history, set Debug Enable/Disable Trace Recording. If you select the Disassembly Window as the active window all program step commands work on CPU instruction level rather than program source lines. You can select a text line and set or modify code breakpoints using toolbar buttons or the context menu commands.
59
1. 2.
Click on the Keil vision Icon on Desktop The following fig will appear
3. 4.
Click on the Project menu from the title bar Then Click on New Project
60
5.
Save the Project by typing suitable project name with no extension in u r own folder sited in either C:\ or D:\
6. 7. 8.
Then Click on save button above. Select the component for u r project. i.e. Atmel Click on the + Symbol beside of Atmel
61
9.
10. 11.
12.
13. 14.
Now your project is ready to USE Now double click on the Target1, you would get another option Source group 1 as shown in next page.
15.
Click on the file option from menu bar and select new
63
16.
The next screen will be as shown in next page, and just maximize it by double clicking on its blue boarder.
17. 18.
Now start writing program in either in C or ASM For a program written in Assembly, then save it with extension . asm and for C based program save it with extension .C
19.
Now right click on Source group 1 and click on Add files to Group Source
64
20.
Now you will get another window, on which by default C files will appear.
Now select as per your file extension given while saving the file Click only one time on option ADD Now Press function key F7 to compile. Any error will appear if so happen.
65
24. 25.
If the file contains no error, then press Control+F5 simultaneously. The new window is as follows
26. 27.
Then Click OK Now Click on the Peripherals from menu bar, and check your required port as shown in fig below
66
28.
29. 30.
Now keep Pressing function key F11 slowly and observe. You are running your program successfully
67
68
CHAPTER- 7 CONCLUSION
A step by step approach in designing the microcontroller based system for securing the transactions of the user and providing the security for the locker system and even more for the PASSPORT verification using a finger print scanner has been followed. The result obtained in providing the security is quite reliable in all the three modes. The system has successfully overcome some of the aspects existing with the present technologies, by the use of finger print Biometric as the authentication Technology.
69
BIBLIOGRAPHY
1. www.atmel.com 2. www.8051projects.com 3. www.microsoftsearch.com 4. www.geocities.com 5. www.alldatasheet.com 6. www.bioenable.com 7. www.final-yearprojects.co.cc
70