Swipe card reader w liquid crystal display
This presentation is the property of its rightful owner.
Sponsored Links
1 / 20

Swipe Card Reader w/ Liquid Crystal Display PowerPoint PPT Presentation


  • 90 Views
  • Uploaded on
  • Presentation posted in: General

Swipe Card Reader w/ Liquid Crystal Display. Embedded Systems Interfacing Laboratory. Overview. Background Task 0 – Clean Up Motor Feedback Lab Task 1 -- Understand Data Stream w/ MSO Task 2 -- Basic ISR w/ Strobe Count and Ones Count Task 3 -- Capture Data with ISR

Download Presentation

Swipe Card Reader w/ Liquid Crystal Display

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Swipe card reader w liquid crystal display

Swipe Card Reader w/ Liquid Crystal Display

Embedded Systems Interfacing Laboratory


Overview

Overview

  • Background

  • Task 0 – Clean Up Motor Feedback Lab

  • Task 1 -- Understand Data Stream w/ MSO

  • Task 2 -- Basic ISR w/ Strobe Count and Ones Count

  • Task 3 -- Capture Data with ISR

  • Task 4 -- Decode, check, and display data/errors


Financial transaction swipe card

Financial Transaction Swipe Card


Magnetic stripe encoding

Magnetic Stripe Encoding


Track 2 data format

Track 2 Data Format


Track 2 character set

Track 2 Character Set


Mcr 175 1r swipe card reader

MCR-175-1R Swipe Card Reader

ColorSignalExplorer-16

BLACKGROUNDVss

RED+5VVdd

YELLOW/CARD DETECTRD14

BLUE/DATARE9

GREEN/STROBERE8


Task 1 entire swipe

Task 1 -- Entire Swipe


Task 1 start sentinel

Task 1 -- Start Sentinel

RTZ

Encoding

1 2 4 8 P 1 2 4 8 P 1 2 4 8 P 1 2 4 8 P 1 2 4 8 P

1

2

‘6’

2

‘B’

Remember data comes in one bit at a time (per interrupt).


Task 1 end sentinel

Task 1 -- End Sentinel

1 2 4 8 P 1 2 4 8 P 1 2 4 8 P

No Ones

CHAR

LRC

‘F’


Task 1 encoded data

Task 1 -- Encoded Data

6221100…52


Task 2 basic interrupt service routine template

Task 2 -- Basic Interrupt Service Routine Template

void __attribute__((interrupt,no_auto_psv)) _INT1Interrupt(void) {

 INT1IF=0;

// insert code here

}

void main(void){

//Initialize ports & interrupt enable bits

endless:

// Process

// Display stb_cnt on bargraph;

goto endless;

}


Task 2 initswipe

Task 2 -- initSwipe

  • Card detect as input

  • Data as input

  • INTCON2bits.INT1EP=?

  • IFS1bits.INT1IF=0

  • IEC1bits.INT1IE=1

  • Optional IPL

    • _IPL < _INT1IP


Task 3 capture data

Task 3 -- Capture Data

ERROR

LEAD-

ING

First One

CHARAC-

TER

CD

default

“00000”

NEW

STROBE

Conversion

Complete

TRAIL-

ING

DECODE


Task 3 state type

Task 3 – STATE_TYPE

enum STATE_TYPE {NEW,LEADING,CHARACTER,TRAILING,DECODE,ERROR};

enum STATE_TYPE state=NEW;

unsigned char bit_cnt=0;

unsigned char char_cnt=0;

unsigned char one_cnt=0;

unsigned char character;

unsigned char buffer[40];


Task 3 switch statement

Task 3 -- Switch Statement

•••••

switch(state){

case NEW: •••••

break;

case LEADING: •••••••

default:

state = ERROR;

}

You write CHARACTER state code


Task 4 parity lrc

Task 4 -- Parity & LRC

HexBinay

ValueValue

WithoutWithout

P 8 4 2 1 ParityParity



Start Sentinel:B 0 1 0 1 1 B  1 0 1 1

1 0 0 0 0 1 1  0 0 0 1

2 0 0 0 1 0 2  0 0 1 0

3 1 0 0 1 1 3  0 0 1 1

End Sentinel:F 1 1 1 1 1F 1 1 1 1

LRC 4 0 0 1 0 0 4 0 1 0 0

0 0 0 0 0

Odd Parity

Even

Parity

Easier yet bitwise “exclusive-or” all including LRC = 0


Track 2 character set1

Track 2 Character Set


Task 4 mainline

Task 4 -- Mainline

  • Display the message “Swipe card…” on first line of LCD

  • Wait for state to go to DECODE.

  • Clear display

  • Display data buffer on first and second line of LCD

  • Display one of the following on the bargraph

    • “No errors…”

    • “Start error…”

    • “Parity error…”


Task 4 mainline continued

Task 4 -- Mainline Continued

  • “Stop error…”

  • “LRC error…”

  • Prepare for next card swipe by setting state to NEW.

  • You can do the four error checks in main or the interrupt service routine.


  • Login