Unit III ARM Interface and ARM Programming

152
UNIT III Interfacing and Programming Dr. P. H. Zope SSBT’s College of Engineering and Technology Bambhori Jalgaon North Maharashtra University [email protected] 9860631040

Transcript of Unit III ARM Interface and ARM Programming

Page 1: Unit III ARM Interface and ARM Programming

UNIT III

Interfacing and Programming

Dr. P. H. Zope SSBT’s College of Engineering and Technology Bambhori Jalgaon

North Maharashtra University

[email protected]

9860631040

Page 2: Unit III ARM Interface and ARM Programming

1. What is Interfacing and Need of interfacing.

2. Different Interfacing techniques.

3. Basic embedded C programs for on-chip peripherals

studied in system architecture.

4. Interfacing of different displays including Graphic LCD

(320X240), Interfacing of input devices including touch

screen etc,

5. Interfacing of output devices like thermal printer etc.,

6. Embedded communication using CAN and Ethernet,

7. RF modules, GSM modem for AT command study etc.

Topics

Page 3: Unit III ARM Interface and ARM Programming

An interface is the point of interaction with software, or computer

hardware, or with peripheral devices such as a computer monitor or

a keyboard.

Some computer interfaces such as a touch screen can send and

receive data, while others such as a mouse, microphone or joystick

can only send data.

Types of Interfacing

1. Hardware

2. Software

What is Interfacing

Page 4: Unit III ARM Interface and ARM Programming

Hardware interfaces

Hardware interfaces exist in computing systems between many of

the components such as the various buses, storage devices,

other I/O devices, etc.

A hardware interface is described by the mechanical, electrical and

logical signals at the interface and the protocol for sequencing

them (sometimes called signaling).

A standard interface, such as SCSI, decouples the design and

introduction of computing hardware, such as I/O devices, from the

design and introduction of other components of a computing

system, thereby allowing users and manufacturers great flexibility

in the implementation of computing systems.

Hardware interfaces can be parallel where performance is

important or serial where distance is important.

Page 5: Unit III ARM Interface and ARM Programming

Software interfaces

A software interface may refer to a wide range of different types of

interface at different "levels": an operating system may interface

with pieces of hardware.

Applications or programs running on the operating system may need

to interact via streams, and in object oriented programs, objects

within an application may need to interact via methods.

Page 6: Unit III ARM Interface and ARM Programming

Programming to the interface

The use of interfaces allows a programming style

called programming to the interface.

The idea behind this is to base programming logic on the interfaces

of the objects used, rather than on internal implementation details.

Programming to the interface reduces dependency on

implementation specifics and makes code more reusable.

It gives the programmer the ability to later change the behavior of

the system by simply swapping the object used with another

implementing the same interface.

Page 7: Unit III ARM Interface and ARM Programming

Benefits

1.Low cost

2.Easy interfacing & Design

3.Easy Production

4.users choice for interfacing

5.No Maintenance

6.Easier Handling

Disadvantages

1.Compact size is not possible

2.Power consumption is more as compared to SOC

3.Leakage current is more

4.Limited Devices Addressing

5.No Support of Multi/ Master configuration

Page 8: Unit III ARM Interface and ARM Programming

Different Interfacing techniques

Page 9: Unit III ARM Interface and ARM Programming

ROM image creation in an Embedded System

Process of converting C , C ++ -program into ROM image and ready to use

To make the application run independently with the specific board one can follow the steps given below so that the application developed on the host system, after cross compiling the same for specific image and specific board

The step wise process is as follows :

To write your first program, you'll need to have the following

software installed on your system:

• Triton IDE installed

• JRE of version 1.5 or higher ( provided in Triton IDE setup) • Philips Utility ( provided in Triton IDE setup)

Page 10: Unit III ARM Interface and ARM Programming

Setting up the Project To create an IDE project:

• Start Triton IDE. • Select the workspace in which you can create all your projects as shown in the figure below. Click OK.

Triton IDE C/C++ Environment opens as shown in below figure in

which you can create new project, open existing one etc.

Page 11: Unit III ARM Interface and ARM Programming
Page 12: Unit III ARM Interface and ARM Programming

To create new project go to Project menu New C Project.

You will get below figure.

In the Project Name field, type keypad.

o Select the Target as per the board you have.

o Select the Variant from the variant list.

o Select Operating System as per your requirement.

o Select the Port from Port field.

o Select the Baud Rate.

o Select the Build options.

o Select the Download options

o Select the Debug type

o You can also change the location of project.

For that uncheck use default location.

o Check Create Project Using Template.

Page 13: Unit III ARM Interface and ARM Programming

Click Next.

• Belo s ree ill appear. “ele t De ug a d Release configurations.

Page 14: Unit III ARM Interface and ARM Programming

Click Finish.

The project is created and opened in the IDE. You should see the following components:

• The Proje ts i do , hi h o tai s a tree ie of the o po e ts of the project, including

source files and properties file that your code depends on. .

• The “our e Editor i do ith a file alled ke pad_ ai . ope .

Page 15: Unit III ARM Interface and ARM Programming
Page 16: Unit III ARM Interface and ARM Programming

Adding Code to the Generated Source File

Because you have left the Create Project Using Template checkbox selected in the New

Project wizard, the IDE has created a skeleton class for you. You can add your keypad

code to the skeleton code by replacing the line:

//TODO: You can write your code at here

Sample code for Keypad

------------------------------- #include <board.h>

int main(void)

{

char key;

q_keyinit(SPIRIT);

q_lcdinit(SPIRIT); /* initialise the LCD*/

q_printf("%s \r\nkey;","Hello");

q_displaylcd("Hello", 5);

while(1)

{

while((key = q_keyread()) == 0);

key = key + 0x30;

q_clrscreen();

q_printf("%x \n", key);

q_displaylcd(&key, 1);

}

}

Save the change by choosing File > Save.

Page 17: Unit III ARM Interface and ARM Programming

Compiling the Project

To compile project you need to select Debug or Release mode.

• Debug mode: This creates an executable which you after downloading on the target board are able to debug.

• Release mode: This creates an executable which you can download on the target board but you won’t be able to debug. • Right click on the keypad project and point to Active Build Configuration and select Release as shown in the below screen.

Page 18: Unit III ARM Interface and ARM Programming
Page 19: Unit III ARM Interface and ARM Programming

•To build Project right click on keypad project and select Build Project.

• Open the build console view to check for any errors as shown in the below figure.

Page 20: Unit III ARM Interface and ARM Programming

If your project has built successfully *.hex will be created.

• If there are any errors in the project Build Console view will display the error

messages and from Build Output view you can check the location of errors in your

code.

• When you build the project, the keypad.hex is generated. You can see where

the new file is generated by opening the C/C++ Projects view and expanding the

keypad project node as shown in the following figure.

Now that you have built the

project, you download executable

on target board and run the

program.

Page 21: Unit III ARM Interface and ARM Programming

Downloading the Program • I Trito IDE e e uta le a e do loaded three optio s:

ISP Utility, Odyssey JTAG and FTP.

• “ele t the appropriate do load optio a d right li k o the *.he file ge erated

and click Download as shown below.

After successful download of

program you can check the

application by running it

on target board.

Page 22: Unit III ARM Interface and ARM Programming
Page 23: Unit III ARM Interface and ARM Programming
Page 24: Unit III ARM Interface and ARM Programming
Page 25: Unit III ARM Interface and ARM Programming
Page 26: Unit III ARM Interface and ARM Programming
Page 27: Unit III ARM Interface and ARM Programming

Debugging the Program

In Triton IDE you can debug your program by three options:-

Monitor, Odyssey JTAG and Ethernet.

• As per your requirement select appropriate option for debugging and build the

project in debug mode (same step as Release mode)

• After compilation download the generated executable and you can now debug the

project.

• Right click on the project and select Debug As and click Debug Local C/C++

Application.

Page 28: Unit III ARM Interface and ARM Programming
Page 29: Unit III ARM Interface and ARM Programming
Page 30: Unit III ARM Interface and ARM Programming

330_09 30

GPIO - General purpose input/output.

FEATURES

• Direction control of individual bits

• Separate control of output set and clear • All I/O default to inputs after reset

APPLICATIONS

• General purpose I/O

• Driving LEDs, or other indicators

• Controlling off-chip devices

• Sensing digital inputs

Page 31: Unit III ARM Interface and ARM Programming

330_09 31

IOPIN

GPIO Port Pin value register. The current state of the port pins

can always be read from this register, regardless of pin

direction and mode.

IOSET

GPIO Port Output set register. This register controls the state

of output pins in conjunction with the IOCLR register. Writing

ones produces highs at the corresponding port pins. Writing

zeroes has no effect.

IODIR

GPIO Port Direction control register. This register individually

controls the direction of each port pin.

IOCLR

GPIO Port Output clear register. This register controls the state

of output pins. Writing ones produces lows at the

corresponding port pins and clears the corresponding bits in

the IOSET register. Writing zeroes has no effect.

Page 32: Unit III ARM Interface and ARM Programming

LED Interfacing

32 330_09

P0-15

P0-16

P0-17

P0-18

P0-19

P0-20

P0-21

P0-22

P0-23

Page 33: Unit III ARM Interface and ARM Programming

330_09 33

A31302928 A27262524 A23222120 A19181716 A15141312 A111098 A7654 A3210

0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0000 0000 0000

0 0 7 F 8 0 0 0

Prepare code for Pin Declaration

A31302928 A27262524 A23222120 A19181716 A15141312 A111098 A7654 A3210

0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0000 0000 0000

0 0 7 F 8 0 0 0

Prepare code for Data Display on port Lines

Page 34: Unit III ARM Interface and ARM Programming

330_09 34

A31302928 A27262524 A23222120 A19181716 A15141312 A111098 A7654 A3210

0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1 0 0 0 0000 0000 0000

0 0 2 A 8 0 0 0

Prepare code for Data Display on port Lines =55

A31302928 A27262524 A23222120 A19181716 A15141312 A111098 A7654 A3210

0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0000 0000 0000

0 0 5 5 0 0 0 0

Prepare code for Data Display on port Lines = AA

Page 35: Unit III ARM Interface and ARM Programming

330_09 35

#include<LPC21xx.h> void delay(); int main(void) { *IODIR0 = 0x7f8000; while(1) { *IOPIN0 = 0x550000;

delay(); *IOPIN0 = 0x2A8000; delay(); } return 0; } void delay() { unsigned int x=500000;

while( x > 0 ) x--; }

Page 36: Unit III ARM Interface and ARM Programming

Seven-Segment Display

Seven-segment Displays

Used to display BCD digits

0 thru 9

A group of 7 LEDs physically

mounted in the shape of the

number eight

Plus a decimal point

Each LED is called a segment

‘a’ through ‘g’

Two types

Common anode

Common cathode

36 330_09

Page 37: Unit III ARM Interface and ARM Programming

Seven-Segment Display

Common Anode

All anodes are connected together to a power supply

Cathodes are connected to data lines

Logic 0 turns on a segment

Example: To display the digit 1 All segments except b and c should be off

11111001 = F9H

37 330_09

Common Anode

Page 38: Unit III ARM Interface and ARM Programming

Interface Seven-Segment Display

Common Cathode

All cathodes are connected together to ground

Anodes are connected to data lines

Logic 1 turns on a segment

Example: To display digit 1 All segments except b and c should be off

00000110 = 06H

38 330_09

Page 39: Unit III ARM Interface and ARM Programming

39 330_09

Page 40: Unit III ARM Interface and ARM Programming

330_09 40

Serial Number DP G F E D C B A Code

0 0 0 1 1 1 1 1 1 3FH

1 0 0 0 0 0 1 1 0 06H

2 0 1 0 1 1 0 1 1 5BH

3 0 1 0 0 1 1 1 1 4FH

4 0 1 1 0 0 1 1 0 66H

5 0 1 1 0 1 1 0 1 6DH

6 0 1 1 1 1 1 0 1 7DH

7 0 0 0 0 0 1 1 1 07H

8 0 1 1 1 1 1 1 1 7FH

9 0 1 1 0 1 1 1 1 6FH

A 0 1 1 1 0 1 1 1 77H

B 0 1 1 1 1 1 0 0 7DH

C 0 0 1 1 1 0 0 1 39H

D 0 1 0 1 1 1 1 0 5EH

E 0 1 1 1 1 0 0 1 79H

F 0 1 1 1 0 0 0 1 71H

Look-Up Table

Page 41: Unit III ARM Interface and ARM Programming

330_09 41

#include<LPC21xx.h>

void delay();

int main(void)

{ *IODIR1 = 0XFF0000;

while(1)

{

*IOCLR1 = 0Xff0000; *IOSET1 = 0x3f0000; //0

delay();

*IOCLR1 = 0Xff0000;

*IOSET1 = 0x060000; //1

delay(); *IOCLR1 = 0Xff0000;

*IOSET1 = 0x5b0000; //2

delay();

*IOCLR1 = 0Xff0000;

*IOSET1 = 0x4f0000; //3 delay();

*IOCLR1 = 0Xff0000;

*IOSET1 = 0x660000; //4

delay();

Page 42: Unit III ARM Interface and ARM Programming

330_09 42

*IOCLR1 = 0Xff0000; *IOSET1 = 0x6d0000; //5

delay();

*IOCLR1 = 0Xff0000;

*IOSET1 = 0x7d0000; //6 delay();

*IOCLR1 = 0Xff0000;

*IOSET1 = 0x070000; //7

delay();

*IOCLR1 = 0Xff0000; *IOSET1 = 0x7f0000; //8

delay();

*IOCLR1 = 0Xff0000;

*IOSET1 = 0x6f0000; //9

delay(); *IOCLR1 = 0Xff0000;

*IOSET1= 0x770000; //A

delay();

Page 43: Unit III ARM Interface and ARM Programming

330_09 43

*IOCLR1 = 0xff0000;

*IOSET1 = 0x7c0000; //b

delay();

*IOCLR1 = 0xff0000;

*IOSET1 = 0x390000; //C

delay();

*IOCLR1 = 0xff0000;

*IOSET1 = 0x5e0000; //d

delay();

*IOCLR1 = 0xff0000;

*IOSET1 = 0x790000; //E

delay();

*IOCLR1 = 0xff0000; *IOSET1 = 0x710000; //F

delay();

}

return 0;

}

Page 44: Unit III ARM Interface and ARM Programming

330_09 44

void delay()

{

int x=500000;

while( x > 0 )

x--; }

Page 45: Unit III ARM Interface and ARM Programming

330_09 45

Interface Seven-Segment Display using Interrupt signal (IRQ)

Page 46: Unit III ARM Interface and ARM Programming

330_09 46

Page 47: Unit III ARM Interface and ARM Programming

330_09 47

SEVEN-SEGMENT DISPLAY INTERFACE USING INTERRUPT

#include<board.h>

#include<LPC21xx.h>

void ISRHandlerEXTINT3()__attribute__((interrupt("IRQ")));

void delay()

{

int x=500000;

while( x > 0 )

x--;

}

Page 48: Unit III ARM Interface and ARM Programming

330_09 48

void ISRHandlerEXTINT3(void)

{

*EXTINT=0x00000008;

q_printf("External Interrupt\n");

*IOCLR1 = 0Xff0000;

*IOSET1 = 0x3f0000;//0

delay();

*IOCLR1 = 0Xff0000;

*IOSET1 = 0x060000; //1

delay();

*IOCLR1 = 0Xff0000;

*IOSET1 = 0x5b0000; //2

delay();

*IOCLR1 = 0Xff0000;

*IOSET1 = 0x4f0000; //3

delay();

Page 49: Unit III ARM Interface and ARM Programming

330_09 49

*IOCLR1 = 0Xff0000;

*IOSET1 = 0x660000; //4

delay();

*IOCLR1 = 0Xff0000;

*IOSET1 = 0x6d0000; //5

delay();

*IOCLR1 = 0Xff0000;

*IOSET1 = 0x7d0000; //6

delay();

*IOCLR1 = 0Xff0000;

*IOSET1 = 0x070000; //7

delay();

*IOCLR1 = 0Xff0000;

*IOSET1 = 0x7f0000; //8

delay();

*IOCLR1 = 0Xff0000;

*IOSET1 = 0x6f0000; //9

delay();

Page 50: Unit III ARM Interface and ARM Programming

330_09 50

*IOCLR1 = 0Xff0000;

*IOSET1 = 0x770000; //A

delay();

*IOCLR1 = 0xff0000;

*IOSET1 = 0x7c0000; //b

delay();

*IOCLR1 = 0xff0000;

*IOSET1 = 0x390000; //C

delay();

*IOCLR1 = 0xff0000;

*IOSET1 = 0x5e0000; //d

delay();

*IOCLR1 = 0xff0000;

*IOSET1 = 0x790000; //E

delay();

*IOCLR1 = 0xff0000;

*IOSET1 = 0x710000; //F

Page 51: Unit III ARM Interface and ARM Programming

330_09 51

delay();

*IOCLR1 = 0xff0000;

*IOSET1 = 0x760000;//H

delay();

*IOCLR1 = 0xff0000;

*IOSET1 = 0x800000;//DP

delay();

q_printf("Press the switch again\n");

*VICVectAddr=0 ;

}

Page 52: Unit III ARM Interface and ARM Programming

330_09 52

void IRQInit()

{

*PINSEL1=0x20000000;

*EXTMODE=0x8;

*VICVectAddr0=(unsigned int)ISRHandlerEXTINT3;

*VICVectCntl0=0x20|0x11;

*VICIntEnable=0x20000 |*VICIntEnable;

}

int main(void)

{

*IODIR0=0x7F8000;

IRQInit();

q_printf("main\n ");

return 0; }

Page 53: Unit III ARM Interface and ARM Programming

Time Multiplex Scanning

53 330_09

Page 54: Unit III ARM Interface and ARM Programming

Interfacing Push-Button Keys

When a key is pressed (or released), mechanical metal contact bounces momentarily and can be read as multiple inputs

Key debounce

Eliminating reading of one contact as multiple inputs

Hardware or Software

54 330_09

Page 55: Unit III ARM Interface and ARM Programming

Key Debounce Techniques

Hardware technique

Two NAND gates

S-R latch

The output of the latch is a pulse without a bounce

Software technique

Wait for 10 to 20 ms

after detection of a

switch closure

If the reading is still the

same it is accepted

330_09 55

Page 56: Unit III ARM Interface and ARM Programming

Interfacing a Matrix Keypad

Problem statement

Interface a 4 x 4 Hex keypad to ARM-7

Write a program to recognize a key pressed and

encode the key in its binary value

Display binary code on LCD

56 330_09

Page 57: Unit III ARM Interface and ARM Programming

Interfacing a Matrix Keypad

PIC18 Simulator Keypad Matrix

57 330_09

1

4

7

A

2

5

8

0

3

6

9

B

C

D

E

F

Page 58: Unit III ARM Interface and ARM Programming

Time Multiplex Scanning

Software

Codes of the numbers to be displayed are stored in data registers in sequence

The program gets the codes from the data registers by using the pointer (FSR0) and sends them out to the LED segments through PORTB

One display at a time is turned on by sending logic 1 to the corresponding transistor connected to PORTC

After an appropriate delay, the first display is turned off and the next display is turned on

Turning displays on/off is repeated in sequence

58 330_09

Page 59: Unit III ARM Interface and ARM Programming

Interfacing LCD

Problem statement

Interface a 2-line x 16 character LCD module

with the built-in HD44780 controller to I/O ports

of the ARM-7 microcontroller.

Explain the control signals necessary to read

from and write to the LCD.

Write a program to display ASCII characters.

59 330_09

Page 60: Unit III ARM Interface and ARM Programming

Interfacing LCD

Hardware

16 x 2-line LCD display

Two lines with 16 characters per line

LCD has a display Data RAM

Stores data in 8-bit character code

Each register in Data RAM has its own address

60 330_09

Page 61: Unit III ARM Interface and ARM Programming

330_09 61

Page 62: Unit III ARM Interface and ARM Programming

Interfacing LCD

62

GND

ARM -7

P1-16

P1-17

P1-18

P1-19

P1-20

P1-21

P1-22

P1-23

P0-28

GND

P0-29

Page 63: Unit III ARM Interface and ARM Programming

Interfacing LCD

Driver HD44780

8-bit data bus (RD7-RD0)

Three control signals

RS – Register Select

R/W – Read/Write

E – Enable

Three power connections

Power, ground, and variable resistor to control brightness

63 330_09

Page 64: Unit III ARM Interface and ARM Programming

Interfacing LCD

Can be interfaced either in 8-bit mode or 4-bit mode In 8-bit mode, all eight data lines are connected

In 4-bit mode, only four data lines are connected Two transfers per character (or instruction) are needed

Driver has two 8-bit internal registers Instruction Register (IR) to write instructions to set up LCD

Table 9-3

Data Register (DR) to write data (ASCII characters)

64 330_09

Page 65: Unit III ARM Interface and ARM Programming

330_09 65

Pin No Symbol I/O Description

1 Vss - Ground

2 Vcc +5V

3 Vee Contrast Control

4 RS Input Command/Data Register

5 R/W Input Read/Write Register

6 E Input/Output Enable

7 DB0 Input/Output Not Used in 4-Bit Mode

8 DB1 Input/Output Not Used in 4-Bit Mode

9 DB2 Input/Output Not Used in 4-Bit Mode

10 DB3 Input/Output Not Used in 4-Bit Mode

11 DB4 Input/Output Data Bus in 4-Bit Mode

12 DB5 Input/Output Data Bus in 4-Bit Mode

13 DB6 Input/Output Data Bus in 4-Bit Mode

14 DB7 Input/Output Data Bus in 4-Bit Mode

15 Vcc - For LCD Back Light

16 Vss - For LCD Back Light

LCD Pin Description

Page 66: Unit III ARM Interface and ARM Programming

66

LCD Commands

Page 67: Unit III ARM Interface and ARM Programming

Interfacing LCD

LCD Operation

When the MPU writes an instruction to IR or data to DR, the controller:

Sets DB7 high indicating that the controller is busy

Sets DB7 low after the completion of the operation

The MPU should always check whether DB7 is low before sending an instruction or a data byte

67 330_09

Page 68: Unit III ARM Interface and ARM Programming

Interfacing LCD

Writing to or Reading from LCD

The MPU:

Asserts RS low to select IR

Asserts RS high to select DR

Reads from LCD by asserting the R/W signal high

Writes into LCD by asserting the R/W signal low

Asserts the E signal high and then low (toggles) to latch a data byte or an instruction

68 330_09

Page 69: Unit III ARM Interface and ARM Programming

Interfacing LCD

Timing diagram: writing to LCD

69 330_09

Page 70: Unit III ARM Interface and ARM Programming

Interfacing LCD

Software

To write into the LCD

Send the initial instructions to set up the LCD

4-bit or 8-bit mode

Continue to check DB7 until it goes low

Write instructions to IR to set up LCD parameters

Number of display lines and cursor status

Write data to display a message

70 330_09

Page 71: Unit III ARM Interface and ARM Programming

330_09 71

Pin Assignment: LCD display interface

Sr. No. Signal Description

1 Pin 16 (P1.16) Data 0

2 Pin 12 (P1.17) Data 1

3 Pin 8 (P1.18) Data 2

4 Pin 4 (P1.19) Data 3

5 Pin 48 (P1.20) Data 4

6 Pin 44 (P1.21) Data 5

7 Pin 40 (P1.22) Data 6

8 Pin 36 (P1.23) Data 7

9 Pin 13 (P0.28) RS

10 Pin 14 (P0.29) EN

11 GND WR

Page 72: Unit III ARM Interface and ARM Programming

330_09 72

A31302928 A27262524 A23222120 A19181716 A15141312 A111098 A7654 A3210

0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

0 0 F F 0 0 0 0

Prepare code for Data Display on port Lines

Prepare code for interface LCD

A31302928 A27262524 A23222120 A19181716 A15141312 A111098 A7654 A3210

0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

3 0 0 0 0 0 0 0

A31302928 A27262524 A23222120 A19181716 A15141312 A111098 A7654 A3210

0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

2 0 0 0 0 0 0 0

A31302928 A27262524 A23222120 A19181716 A15141312 A111098 A7654 A3210

0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

1 0 0 0 0 0 0 0

Page 73: Unit III ARM Interface and ARM Programming

330_09 73

#include<lpc21xx.h>

void lcddata(int value);

void lcdcmd(int value);

void delay(int itime);

int main()

{

*IODIR1=0x00FF0000;

*IODIR0=0x30000000;

lcdcmd(0x38);

delay(250);

lcdcmd(0x0e);

delay(250);

lcdcmd(0x80);

delay(250);

Page 74: Unit III ARM Interface and ARM Programming

330_09 74

lcddata('h');

delay(250);

lcddata('e');

delay(250);

lcddata('l');

delay(250);

lcddata('l');

delay(250);

lcddata('o');

delay(250);

return 0;

}

Page 75: Unit III ARM Interface and ARM Programming

330_09 75

void lcdcmd(int value) { *IOCLR1=0x00FF0000; *IOCLR0=0x10000000; value<<=16;

*IOSET1=value; *IOCLR0=0x20000000; delay(250); *IOSET0=0x20000000; delay(250); *IOCLR0=0x20000000; delay(250); }

Page 76: Unit III ARM Interface and ARM Programming

330_09 76

void lcddata(int value)

{

*IOCLR1=0x00FF0000;

*IOSET0=0x10000000;

value<<=16;

*IOSET1=value;

*IOCLR0=0x20000000;

delay(250);

*IOSET0=0x20000000;

delay(250);

*IOCLR0=0x20000000;

delay(250);

}

void delay(int itime)

{

int i;

for(i=0;i<itime;i++);

}

Page 77: Unit III ARM Interface and ARM Programming

77

Program to interface keypad and LCD

Page 78: Unit III ARM Interface and ARM Programming

330_09 78

Write a Program to interface keypad and LCD.

#include <board.h> int main(void) { char key; q_keyinit(TITAN); q_lcdinit(TITAN); q_printf("%s \r\nkey;","Hello"); q_displaylcd("Hello", 5); while(1) { while((key = q_keyread()) == 0); key = key + 0x30; q_clrscreen(); q_printf("%x \r\n", key); q_displaylcd(&key, 1); }

}

Page 79: Unit III ARM Interface and ARM Programming

79

ASCII Code Chart

Page 80: Unit III ARM Interface and ARM Programming

80

Interfacing Stepper Motor

P0-11

P0-12

P0-13

P0-14

Page 81: Unit III ARM Interface and ARM Programming

330_09 81

Page 82: Unit III ARM Interface and ARM Programming

330_09 82

STEP SEQUENCE (ONE PHASE ON SEQUNCE)

Page 83: Unit III ARM Interface and ARM Programming

330_09 83

STEPPER MOTOR CHARACTERISTICS

•Stepper motors are constant-power devices (power = angular velocity x torque).

•As motor speed increases, torque decreases.

•The torque curve may be extended by using current limiting drivers and

increasing the driving voltage.

•Steppers exhibit more vibration than other motor types, as the discrete step tends

to snap the rotor from one position to another.

•This vibration can become very bad at some speeds and can cause the motor to

lose torque.

•The effect can be mitigated by accelerating quickly through the problem speed

range, physically damping the system, or using a micro-stepping driver.

•Motors with greater number of phases also exhibit smoother operation than those

with fewer phases.

Page 84: Unit III ARM Interface and ARM Programming

84

Computer-controlled stepper motors are one of the most versatile

forms of positioning systems . They are typically digitally

controlled as part of an open loop system, and are simpler and

more rugged than closed loop servo systems. Industrial applications

are in high speed pick and place equipment and multi-axis machine

CNC machines often directly driving lead screws or ball screws .

In the field of lasers and optics they are frequently used in precision

positioning equipment such as linear actuators , linear stages ,

rotation stages and mirror mounts . Other uses are in packaging

machinery, and positioning of valve pilot stages for fluid control

systems. Commercially, stepper motors are used in floppy disk

drives , flatbed scanners , computer printers , plotters and many

more devices.

APPLICATIONS

Page 85: Unit III ARM Interface and ARM Programming

85

Prepare code for interface Stepper Motor

A31302928 A27262524 A23222120 A19181716 A15141312 A111098 A7654 A3210

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 7 8 0 0

Step A31302928 A27262524 A23222120 A19181716 A15141312 A111098 A7654 A3210

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 7 8 0 0

1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 2 8 0 0

2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 3 0 0 0

3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 5 0 0 0

4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 4 8 0 0

Page 86: Unit III ARM Interface and ARM Programming

86

#include <LPC21xx.h> #include<board.h>

int main(void) { unsigned long int i,j; *IODIR0 = *IODIR0 | (0X00007800); q_lcdinit(TITAN); while(1) { q_displaylcd("clkwise directxn",16);

Page 87: Unit III ARM Interface and ARM Programming

330_09 87

for(j=0;j<12;j++)

{

*IOSET0 = 0x00002800;

for(i=0;i<25000;i++);

*IOCLR0 = 0x00002800;

for(i=0;i<25000;i++);

*IOSET0 = 0x00003000;

for(i=0;i<25000;i++);

*IOCLR0 = 0x00003000;

for(i=0;i<25000;i++);

*IOSET0 = 0x00005000;

for(i=0;i<25000;i++);

*IOCLR0 = 0x00005000;

for(i=0;i<25000;i++);

*IOSET0 = 0x00004800;

for(i=0;i<25000;i++);

*IOCLR0 = 0x00004800;

for(i=0;i<25000;i++);

}

Page 88: Unit III ARM Interface and ARM Programming

330_09 88

q_clrscreen();

q_displaylcd("anticlk directxn",16);

for(j=0;j<12;j++)

{

*IOSET0 = 0x00002800;

for(i=0;i<25000;i++);

*IOCLR0 = 0x00002800;

for(i=0;i<25000;i++);

*IOSET0 = 0x00004800;

for(i=0;i<25000;i++);

*IOCLR0 = 0x00004800;

for(i=0;i<25000;i++);

*IOSET0 = 0x00005000;

for(i=0;i<25000;i++);

*IOCLR0 = 0x00005000;

for(i=0;i<25000;i++);

*IOSET0 = 0x00003000;

for(i=0;i<25000;i++);

*IOCLR0 = 0x00003000;

for(i=0;i<25000;i++);

}

q_clrscreen();

}

return 0;

}

Page 89: Unit III ARM Interface and ARM Programming

330_09 89

Interfacing GSM with ARM Board

Page 90: Unit III ARM Interface and ARM Programming

What is GSM ?

Global System for Mobile (GSM) is a

second generation cellular standard

developed to cater voice services and

data delivery using digital modulation

Page 91: Unit III ARM Interface and ARM Programming

330_09 91

Page 92: Unit III ARM Interface and ARM Programming

92

Introduction: GSM (Global System for Mobile) / GPRS (General Packet Radio Service)

TTL –Modem is SIM900 Quad-band GSM / GPRS device, works on

frequencies 850 MHZ, 900 MHZ, 1800MHZ and 1900 MHZ. It is very

compact in size and easy to use as plug in GSM Modem. The Modem is

designed with 3V3 and 5V DC TTL interfacing circuitry, which allows

User to directly interface with 5V Microcontrollers (PIC, AVR, Arduino,

8051, etc.) as well as 3V3Microcontrollers (ARM, ARM Cortex XX, etc.).

The baud rate can be configurable from 9600-115200 bps through AT

(Attention) commands. This GSM/GPRS TTL Modem has internal TCP/IP

stack to enable User to connect with internet through GPRS feature. It is

suitable for SMS as well as DATA transfer application in mobile phone to

mobile phone interface.

The modem can be interfaced with a Microcontroller using USART

(Universal Synchronous Asynchronous Receiver and Transmitter) feature

(serial communication).

Page 93: Unit III ARM Interface and ARM Programming

330_09 93

Features: Quad Band GSM/GPRS : 850 / 900 / 1800 / 1900 MHz

Built in RS232 to TTL or viceversa Logic Converter (MAX232)

Configurable Baud Rate

SMA (SubMiniature version A) connector with GSM L Type

Antenna

Built in SIM (Subscriber Identity Module) Card holder

Built in Network Status LED

Inbuilt Powerful TCP / IP (Transfer Control Protocol / Internet

Protocol) stack for internet data transfer through GPRS (General

Packet Radio Service)

Audio Interface Connectors (Audio in and Audio out)

Most Status and Controlling pins are available

Normal Operation Temperature : -20 °C to +55 °C

Input Voltage : 5V to 12V DC

LDB9 connector (Serial Port) provided for easy interfacing

Page 94: Unit III ARM Interface and ARM Programming

330_09 94

Page 95: Unit III ARM Interface and ARM Programming

330_09 95

SIMCom SIM900A GSM Module: This is actual SIM900 GSM module which is manufactured by SIMCom. Designed

for global market, SIM900 is a quad-band GSM/GPRS engine that works on

frequencies GSM 850MHz, EGSM 900MHz, DCS 1800MHz and PCS 1900MHz.

SIM900 features GPRS multislot class 10/ class 8 (optional) and supports the

GPRS coding schemes CS-1, CS-2, CS-3 and CS-4. With a tiny configuration of

24mm x 24mm x 3mm, SIM900 can meet almost all the space requirements in

User’s applications, such as M2M, smart phone, PDA and other mobile devices.

Page 96: Unit III ARM Interface and ARM Programming

330_09 96

MAX232 IC: The MAX232 is an integrated circuit that converts signals from an RS-232 serial

port to signals suitable for use in TTL compatible digital logic circuits, so that

devices works on TTL logic can share the data with devices connected through

Serial port (DB9 Connector).

Page 97: Unit III ARM Interface and ARM Programming

330_09 97

Serial port / DB9 connector:

User just needs to attach RS232 cable here so that it can be connected to devices

which has Serial port / DB9 Connector.

Page 98: Unit III ARM Interface and ARM Programming

330_09 98

Power Supply Socket: This power supply socket which actually named as AC/DC Socket provides the

functionality to user to connect external power supply from Transformer, Battery or

Adapter through DC jack. User can provide maximum of 12V AC/DC power supply

through AC/DC socket. This is power supply designed into maximum protection

consideration so that it can even prevent reverse polarity DC power supply as well

as DC conversion from AC power Supply. It also includes LM317 Voltage Regulator

which provides an output voltage adjustable over a1.2V to 37V.

Page 99: Unit III ARM Interface and ARM Programming

330_09 99

Power On/Off and GSM On Switch: Power On/Off switch is type of push-on push-off DPDT switch which is used for

only make power supply on/off provided through AC/DC Socket indicated by

‘Power LED’. GSM On Switch is type of Push on DPST tactile switch which is

used for only to make GSM module ‘On’ indicated by ‘Module On/Off LED’ while initiating with Network indicated by ‘Network Indication LED’.

Page 100: Unit III ARM Interface and ARM Programming

330_09 100

SIM (Subscriber Identity Module) Card Slot: This onboard SIM card slot provide User functionality of insert a SIM (GSM

only) card of any service provider. Process of inserting and locking SIM card into

SIM card slot is given in this manual. While inserting in and removing out SIM

card from SIM card slot, User needs to take precaution that power supply should

be OFF so that after making Power supply ON it will be easy to reinitialize with

SIM for this module.

Page 101: Unit III ARM Interface and ARM Programming

330_09 101

Indicator LEDs: Indicator LEDs just used to indicate status accordingly. These are three LEDs

represents Power On/Off Status, Network Status and Module On/Off Status

respectively. Power LED will keep on until the power supply is enable to this board

by using push-on push-off switch. Network Status LED will show whether inserted

SIM card successfully connected to service provider’s Network or not, in short signal strength. Module On/Off indicator LED will show status of GSM

module’s power on/off.

Page 102: Unit III ARM Interface and ARM Programming

330_09 102

RXD, TXD and GND pins (JP2):

These pins are used to connect devices which needs to be connected to GSM

module through USART (Universal Synchronous Asynchronous Receiver and

Transmitter) communication. Devices may be like Desktop or Laptop Computer

System, Microcontrollers, etc. RXD (Receive Data) should be connected to TXD

(Transmit Data) of other device and viceversa, whereas GND (Ground) should be

connected to other device’s GND pin to make ground common for both systems.

Page 103: Unit III ARM Interface and ARM Programming

330_09 103

Audio Connectors:

Audio Connectors deals with Audio related operations. These pins already shown

in hardware description diagram. These are eight pins in a group of two each

denoted by SV4.

GND (0V Supply) and VCC (+5V Supply) are used to have source for external

device. MIC+ and MICused to connect Microphone (abbr. as Mic) through which

user can give audio input while calling. SP- and SP+ used to connect Speaker (can

be connected to amplifier circuit if necessary) through which User can hear audio

output. LN-L and LN-R used to connect Line in to GSM module.

Page 104: Unit III ARM Interface and ARM Programming

330_09 104

Debugger (DBG-R and DBG-T) Connectors (J2): These connectors are 2-wire null modem interface DBG_TXD and DBG_RXD.

These pins can be used for debugging and upgrading firmware. User generally no

need to deal with these pins.

Page 105: Unit III ARM Interface and ARM Programming

330_09 105

Inserting SIM card into SIM card Slot/Holder: Here is the process how to insert SIM card into SIM card slot. User just need to

unlock SIM card cover by sliding back. Then user need to open this cover and

insert SIM card according to slot. Put down cover on SIM card and then lock by

sliding forward.

Page 106: Unit III ARM Interface and ARM Programming

330_09 106

Power On/Off and Module On/Off process: Here is the process how User should make power supply on/off and module on/off.

First of all User need to connect external power supply by using Battery / Adapter /

Transformer. Now User needs to press Power On/Off switch (It is push-on push-off

switch, thus User need to push it to make power on and push it again to make power

supply off). Two LEDs will glow, one is Power On/Off indicator LED and another

one is Network Status LED (which glows continuous to indicate no network or

searching for network). After this User needs to press Module on switch (denoted as

PWR) for at least 2 seconds. As soon as Module On/Off LED will glow User can

release this switch, Network LED will blink to indicate signal strength.

Page 107: Unit III ARM Interface and ARM Programming

330_09 107

Connecting GSM module with RS232 (SB9-DB9) Serial Cable: User can connect GSM interfacing board either through Serial port or

through Serial to USB converter. Here is process to connect RS232 cable to GSM

interfacing board.

Page 108: Unit III ARM Interface and ARM Programming

330_09 108

Connecting GSM Module with Serial to USB converter through

RXD, TXD and GND: This module is designed in a way so that User can connect this module without

Serial cable, this module can be connected to any of Serial to USB converter

module or cable. Here we have shown demo how to connect this interfacing board

with CP2102 Serial to USB converter Module through RXD, TXD and GND.

Connect CP2102 Serial to USB converter module to PC through USB cable,

connect one end of USB cable to PC’s USB connector and connect another end of USB to CP2102 module’s USB connector.

Page 109: Unit III ARM Interface and ARM Programming

330_09 109

Connect three Single Berg Wires to CP2102 modules’s RXD, TXD and GND pin.

Then connect RXD wire to TXD of GSM module and TXD wire to RXD of GSM

module. Make GND common by connecting GND wire to GND pin of GSM

module.

Page 110: Unit III ARM Interface and ARM Programming

330_09 110

Various AT commands for GSM modem

Call command:-

•For dialing number

Step 1 – ATD (enter the number)

Step 2 - ;

Step 3 - < Press Enter >

•For answering the call when the RING text appear

continuously on hyper terminal

Step 1 – ATA

Step 2 - <Press Enter>

Page 111: Unit III ARM Interface and ARM Programming

330_09 111

•For terminating call

Step 1 – ATH

Step 2 - <Press Enter>

•For enables caller number

Step 1 – AT + CLIP = 1

Step 2 - <Press Enter>

CLIP- Calling Line Identification Presentation

Page 112: Unit III ARM Interface and ARM Programming

330_09 112

SMS Command:-

1. To read SMS automatic to terminal Step 1 – AT + CMGF = 1 // for text mode operator Step 2 – AT + CNMI = 1 // automatic sensing CMGF –Message Format

CNMI - New Message Indication to Terminal Equipment

2. To send SMS Step 1 – AT + CMGS = Enter mobile number

Step 2 - <Press Enter> Step 3 – Enter Text Step 4 – Press ctrl + Z CMGS – Send Message

3. For acknowledge SMS (if not acknowledge the SMS, SMS server

will resend SMS) Step 1 – AT + CNMA CNMA – Message Acknowledge

Page 113: Unit III ARM Interface and ARM Programming

330_09 113

COM 1

DB9-

Female

data 2

GND-3

GPIO (CN/4) 2-9, 49, 50

(With CNB) 13-22, 47 GND

(with (N/4)

CN 13, 1-,

14 7,8,19,20 CN 13, 1-,

10 19,20

Keypad

(4 × 4) LCD DISPLAY

GSM

RS – 238

Cable

Null male-male

connector

FRC

Cable

GSM antenna

Power supply

ARM

PROCESSOR

/BOARD

Interfacing GSM with ARM

Board

Page 114: Unit III ARM Interface and ARM Programming

GSM Applications

Mobile telephony

GSM-R

Telemetry System

- Fleet management

- Automatic meter reading

- Toll Collection

- Remote control and fault reporting of DG sets

Value Added Services

Page 115: Unit III ARM Interface and ARM Programming

330_09 115

Interfacing FIM (BIOMETRICS) with ARM / ARM Board

Page 116: Unit III ARM Interface and ARM Programming

330_09 116

FIM:- Fingerprint Identification Module

FIM is a stand – alone Fingerprint Identification Device with many excellent

features.

It provides benefits such as high identification performance, low power

consumption and RS – 232 serial interface with the various commands for easy

integration a wide range of applications.

It is a durable and compact device with fingerprint identification module

containing NITGEN® optics – based fingerprint sensor inside.

Page 117: Unit III ARM Interface and ARM Programming

117

Interface: FBI-compliant scanners often have analogue output and a frame grabber is

necessary to digitize the images. This introduces an extra cost and usually requires an internal

board to be mounted in the host. In non-AFIS devices, the analogue-to-digital conversion is

performed by the scanner itself and the interface to the host is usually through a simple

Parallel Port or USB connection.

Frames per second: This is the number of images the scanner is able to acquire and send to

the host in a second.

Automatic finger detection: Some scanners automatically detect the presence of a finger on

the acquisition surface, without requiring the host to continually grab and process frames; this

allows the acquisition process to be automatically initiated as soon as the user’s finger touches

the sensor.

Encryption: This is the securing of the communication channel between the scanner and the

host.

Supported operating systems: Compatibility with more operating systems is an important

requirement.

Fingerprint Scanners and their Features

Page 118: Unit III ARM Interface and ARM Programming

118

Resolution: This indicates the number of dots or pixels per inch (dpi).

Area: The size of the rectangular area sensed by a fingerprint scanner is a fundamental parameter. The larger the area, the more ridges and valleys are captured and the more distinctive the fingerprint becomes.

Number of Pixels: This can be derived from the resolution and the fingerprint area. A scanner working at r dpi over an area of height (h) X width (w) inch2 has rh X rw pixels.

Dynamic range (or depth): This denotes the number of bits used to encode the intensity value of each pixel.

Geometric accuracy: This is specified by the maximum geometric distortion introduced by the acquisition device, and expressed as a percentage with respect to x and y directions.

Image quality: The image quality depends on the quality of scanner and also on the intrinsic finger status. When the ridge prominence is very low (for manual workers, elderly people), or fingers are too moist or too dry, most scanners produce poor quality images.

Characteristics of Fingerprint Images

Page 119: Unit III ARM Interface and ARM Programming

119

The general structure of fingerprint scanner is shown in figure

Page 120: Unit III ARM Interface and ARM Programming

330_09 120

Page 121: Unit III ARM Interface and ARM Programming

330_09 121

COM 1

DB9-

Female

data 2

GND-3

GPIO (CN/4) 2-9, 49, 50

(With CNB) 13-22, 47 GND

(with (N/4)

CN 13, 1-,

14 7,8,19,20 CN 13, 1-,

10 19,20

Keypad

(4 × 4) LCD DISPLAY

FIM

RS – 323

Cable

Null male-male

connector

FRC

Cable

Power supply

ARM

PROCESSOR

/BOARD

Page 122: Unit III ARM Interface and ARM Programming

330_09 122

Communication:- FIM has RS – serial communication port through that FIM communicates at the

same time. These ports support 6 baud rate modes such as 9600, 14400, 19200, 38400, 57600

and 115200 bps.

User Data Area:-

FIM provides 64 bytes flash memory. Using this memory, host can save

private data for specific usage.

The caution is needed because the responsibility for reading, writing and

erasing user data area is given to the best.

Key Function:-

FIM supports 3 function key input such as Enroll _ Key, Delete _ Key, and

Identify _ Key.

Using these keys without serial communication, enrollment, deletion, all

deletion and identification operating can be executed.

Page 123: Unit III ARM Interface and ARM Programming

123

Applications

•Print on scale device

•Ticket generation

•Bill printing •ATM machines

Page 124: Unit III ARM Interface and ARM Programming

124

Fingerprint sensing

Based on the mode of acquisition, a fingerprint image is classified

as

Off line image

Live-scan image

There are a number of live-scan sensing mechanisms that can detect the ridges and valleys present in the fingertip

Examples are

Optical FTIR

Capacitive

Pressure-based

Ultrasound

Page 125: Unit III ARM Interface and ARM Programming

125

Scanning and Digitizing

Page 126: Unit III ARM Interface and ARM Programming

126

Fingerprint images

Optical scanner Capacitive scanner Piezoelectric scanner

Thermal scanner Inked impression Latent fingerprint

Page 127: Unit III ARM Interface and ARM Programming

127

Interface: FBI-compliant scanners often have analogue output and a frame grabber is

necessary to digitize the images. This introduces an extra cost and usually requires an internal

board to be mounted in the host. In non-AFIS devices, the analogue-to-digital conversion is

performed by the scanner itself and the interface to the host is usually through a simple

Parallel Port or USB connection.

Frames per second: This is the number of images the scanner is able to acquire and send to

the host in a second.

Automatic finger detection: Some scanners automatically detect the presence of a finger on

the acquisition surface, without requiring the host to continually grab and process frames; this

allows the acquisition process to be automatically initiated as soon as the user’s finger touches

the sensor.

Encryption: This is the securing of the communication channel between the scanner and the

host.

Supported operating systems: Compatibility with more operating systems is an important

requirement.

Fingerprint Scanners and their Features

Page 128: Unit III ARM Interface and ARM Programming

128

The most important part of a fingerprint scanner is the sensor.

Sensors belong to one of the three families:

Optical sensors • Frustrated Total Internal Reflection (FTIR)

• FTIR with a sheet prism

• Optical fibers

• Electro-Optical

Solid-state sensors • Thermal

• Electric field

• Piezoelectric

Ultrasound sensors

Fingerprint Sensing

Page 129: Unit III ARM Interface and ARM Programming

129

Frustered Total Internal Reflection (FTIR):

The oldest and most used livescan technique. The finger touches the top side of a glass prism, but while the ridges enter in contact with the prism surface, the valleys remain at a certain distance. The left side of the prism is illuminated through a diffused light which is reflected at the valleys and randomly scattered (absorbed) at the ridges. The lack of reflection allows the ridges (appear dark) to be discriminated from the valleys (appear bright). The light rays exit from the right side of the prism and are focused through a lens onto a CCD or CMOS image sensor. Because FTIR devises sense a 3D surface, they cannot be easily deceived by a photograph or printed image of a fingerprint.

Fingerprint Sensing: optical FTIR

Page 130: Unit III ARM Interface and ARM Programming

130

FTIR with a sheet prism: Using a sheet prism made of a number of “prismlets” adjacent to each other, instead of a single large prism, allows the size of the

mechanical assembly to be reduced to some extent. However, the quality of the

acquired images is generally lower than the traditional FTIR techniques using glass

prisms.

Fingerprint Sensing: FTIR with a sheet prism

Page 131: Unit III ARM Interface and ARM Programming

131

A significant reduction of the packaging size can be achieved by substituting prism and

lens with a fiber-optic platen. The finger is in direct contact with the upper side of

the platen; on the opposite side, a CCD or CMOS, tightly coupled with the platen,

receives the finger residual light conveyed through the glass fibers. Unlike the FTIR

devices, the CCD/CMOS is in direct contact with the platen and therefore its size

has to cover the whole sensing area. This may result in a high cost for producing

large area sensors.

Optical Fibers

Page 132: Unit III ARM Interface and ARM Programming

132

Electro-Optical

Electro-optical sensors contain light-emitting

polymer instead of a prism that activates the

photodiode array embedded in glass to obtain

fingerprint image.

Page 133: Unit III ARM Interface and ARM Programming

133

Optical Sensors

Page 134: Unit III ARM Interface and ARM Programming

134

Thermal: These sensors are made of pyro-electric material that generates current based

on temperature differentials. The fingerprint ridges, being in contact with the sensor

surface, produce a different temperature differential than the valleys, which are

away from the sensor surface. The sensors are typically maintained at a high

temperatures.

Electric Field: The sensor consists of a drive ring that generates a sinusoidal signal and

a matrix of active antennas that receives a very small amplitude signal transmitted

by the drive ring and modulated by the derma structure (subsurface of the finger

skin). The finger must be simultaneously in contact with the sensor and the drive

ring. To image a fingerprint, the analogue response of each element in the sensor

matrix is amplified and digitized.

Piezoelectric: Pressure-sensitive sensors produce an electrical signal when mechanical

stress is applied to them. The sensor surface is made of a non-conducting dielectric

material which generates a small amount of current. Since ridges and valleys are

present at different distances from the sensor surface, result in different currents.

Solid State Sensing

Page 135: Unit III ARM Interface and ARM Programming

135

Ultrasound sensing is based on sending acoustic signals toward the fingertip and

capturing the echo signal. The echo signal is used to compute the range

image of the fingerprint and subsequently, the ridge structure itself. This

method images the subsurface of the finger skin (even through thin gloves).

Therefore, it is resilient to dirt and oil accumulations that may visually mar

the fingerprint. However, the scanner is large with mechanical parts and

quite expensive. Moreover, it takes a few seconds to acquire an image.

Ultrasound sensors

Page 136: Unit III ARM Interface and ARM Programming

136

Fingerprint Sensing: sweep systems

Sweep systems

Touch systems

Page 137: Unit III ARM Interface and ARM Programming

137

The touch method is most commonly used with sensors wherein the finger is

simply put on the scanner, without moving it.

To reduce costs, especially in silicon sensors, another sensing method has been

proposed: to sweep the finger over the sensor. Since the sweeping consists

of a vertical movement only, the chip must be as wide as a finger; on the

other hand, in principle, the height could be as low as one pixel. At the end

of the sweep, a single fingerprint image is reconstructed from the slices.

Image reconstruction from slices

Page 138: Unit III ARM Interface and ARM Programming

138

The sweep method allows the cost of a sensor to be significantly reduced, but requires

reliable reconstruction to be performed. The main stages of the reconstruction are:

Slice quality computation: For each slice, a single global quality measure and several local measures are compared by using an image contrast estimator.

Slice pair registration: For each pair of consecutive slices, the only possible transformation is assumed to be a global translation [∆x, ∆y], where the ∆y component is dominant, but a limited ∆x is also allowed to cope with lateral movements of the finger during sweeping.

Relaxation: When the quality of slices is low, the registration may fail and give incorrect translation vectors. Assuming a certain continuity of the finger speed during sweeping allows analogous hypotheses to be generated on the continuity of the translation vectors. The translation vectors’ continuity may be obtained through a method called relaxation which has the nice property of smoothing the samples without affecting the correct measurements too much.

Mosaicking: The enhanced translation vectors produced by the relaxation stage are used to register and superimpose the slices. Finally, each pixel of the reconstructed output image is generated by performing a weighted sum of the intensities of the corresponding pixels in the slices.

Image reconstruction from slices

Page 139: Unit III ARM Interface and ARM Programming

139

Image reconstruction from slices

Page 140: Unit III ARM Interface and ARM Programming

140

The cost of a sensor increases with increase in size of sensing area.

With smaller areas, the identification accuracy may deteriorate.

Sensing Area vs. Accuracy

Page 141: Unit III ARM Interface and ARM Programming

141

Quality of images

Good quality

fingerprint

Dry finger

Wet finger

Intrinsically

bad fingerprint

Page 142: Unit III ARM Interface and ARM Programming

142

Different scanners – ideal conditions

Page 143: Unit III ARM Interface and ARM Programming

143

Different scanners – bad conditions

Page 144: Unit III ARM Interface and ARM Programming

144

The Wavelet Scalar Quantization (WSQ) is an effective compression

technique (achieves compression ratio of 10 to 25).

The WSQ encoder performs the following steps:

1. The fingerprint image is decomposed into a number of spatial frequency sub-bands (typically 64) using a Discrete Wavelet Transform (DWT).

2. The resulting DWT coefficients are quantized into discrete values; results in some loss of information.

3. The quantized sub-bands are concatenated into several blocks (typically three to eight) and compressed using an adaptive Huffman run-length encoding.

Compressing Fingerprint Images

Page 145: Unit III ARM Interface and ARM Programming

330_09 145

Interfacing Graphics LCD (320 X 240) with ARM board

Page 146: Unit III ARM Interface and ARM Programming

330_09 146

Page 147: Unit III ARM Interface and ARM Programming

330_09 147

Page 148: Unit III ARM Interface and ARM Programming

330_09 148

Page 149: Unit III ARM Interface and ARM Programming

330_09 149

Page 150: Unit III ARM Interface and ARM Programming

330_09 150

Page 151: Unit III ARM Interface and ARM Programming

330_09 151

#include <LPC214x.H>

#include "GLCD.H"

#include "GLCDBMP.H"

#define RST 7

void main()

{

PINSEL0 = 0;

PINSEL1 = 0;

IODIR0 = 0x0000FFFF;

GLCD_Init (&IO0PIN, 8);

while(1)

{

Delay();

Delay();

Delay();

Delay();

Page 152: Unit III ARM Interface and ARM Programming

330_09 152

GLCD_Draw (&IO0PIN, 8, PAN_LOGO);

Delay();

Delay();

Delay();

Delay();

GLCD_Draw(&IO0PIN, 8, BMP_IMG);

}

}

void Delay()

{

unsigned int i,j;

for(i=0;i<25;i++)

for(j=0;j<300;j++);

}