Wima2011 sony tt3_nfcpy_dynamic_tag

59
2011 Sony Corporation Beyond Tags: Type 3 Platform for Developers Tips and Tricks, Open Source and the Dynamic Tag Stephen Tiedemann and Frank Dawidowsky, SONY

description

http://blog.felicalauncher.com/en/

Transcript of Wima2011 sony tt3_nfcpy_dynamic_tag

Page 1: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Beyond Tags:

Type 3 Platform for Developers

Tips and Tricks, Open Source and the Dynamic Tag

Stephen Tiedemann and Frank Dawidowsky, SONY

Page 2: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Overview

• The Type 3 Tag Platform• NFC and T3T

• System Codes • Polling for T3T

• Reading further

• The ‘nfcpy’ open source project• Introduction

• Example and Demo• Invitation

• NFC Dynamic Tag • Concepts and Features• Demo

• Open Hardware Evaluation Platform ‚Arduino‘

2

Page 3: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Type 3 Tag Platform

Page 4: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Relationship between NFC & FeliCa

212/424kbps

NFC Device communication modes

P2PR/W Card

FeliCa R/W

FeliCa Card

• NFC includes the FeliCa physical layer(212/424kbps modes of NFCIP1)

• NFC devices can potentially communicate with• FeliCa cards

� NFC Forum Tag Type 3

• FeliCa R/Ws

• Type 3 Tag (T3T) is one of the 4 tag types that are supported by all NFC Forum certified devices

NFC Device communication modes

P2P R/W Card

P2P mode

Page 5: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Relevant NFC Forum specs

Type 3 TagOperation SpecificationDefines basic command set:

check, update, pollMemory structure

NDEF mapping

NFC Forum Device in the role of a

Reader / Writer Card Emulator

Digital Protocol SpecificationDefines the ‚Type 3 Tag Platform‘ based on NFC-F:

Sequence Format, Bit-level coding, Frame Format,Data and Payload Format, Timing Requirements

FeliCa OS(not part of NFC Forum specs)

Page 6: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Full FeliCaCommand Set*

NFC Forum specs

Type 3 TagOperation Specification

Basic Command Set

NFC Forum Device as

Reader / Writer FeliCa Cards / Tags/ Phones

Digital ProtocolSpecification

Type 3 Tag Platform

*Defined in the ‚Card Users Manual‘ available athttp://www.sony.net/Products/felica/business/tech-support

readwrite

(non-secure)

Page 7: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Full FeliCaCommand Set*

Different API levels

NDEF mapping

Type 3 TagOperation Specification

Basic Command Set

Digital ProtocolSpecification

Type 3 Tag Platform

Android API for NFC-F

byte[] transceive(byte[])

JSR257 Nokia Extensionfor Type 3 Tagcheck(), update()

Specification Example of acorresponding API

API of the FeliCa SDK

JSR257 NDEFTagConnectionreadNDEF(), writeNDEF()

Page 8: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Types of FeliCa products

FeliCa lite Dynamic Tag FeliCa Cards Mobile FeliCa

Full FeliCaCommand Set*

Type 3 Tag Operation SpecificationBasic Command Set

Full FeliCa File SystemMultiple ‚Systems‘ on a card/phone

Simple FileSystemSingle ‚System‘on a tag

No non-volatile memory on chipData formats aredevice-dependant

Page 9: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

System

FeliCa ‚System‘ on a card/tag

Area 0 Service 0read only

Service 0read / write

User Memory Block 0

User Memory Block 1

User Memory Block 2

User Memory Block 3

User Memory Block 4

User Memory Block 5

...

System Code (system type) = 12FCh for NDEFManufacture ID (identifier used to address the system)Manufacture Parameter (IC information, timeouts)

Example of a FeliCa file system for protected NDEF(Key required to write data)

Page 10: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Basic Command Set

• Polling/SENSFcheck for devices in the field

• CheckRead data blocks of one or more services

• UpdateWrite data blocks of one or more services

Page 11: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Concepts

• Systems and System Codes• T3T may contain multiple systems. Each System

may be used by multiple applications.• Each System is identified by a ‚System Code‘ and an

identification number (‚Idm‘).• Each System has a set of Manufacturer Parameters

(‚PMm‘)

• Polling• A reader can poll for a specific System Code or a

wildcard.• In case of wild card polling (‚0xFFFF‘), all Type F

devices in range will try to respond• In case the polling is done for a specific system

code, only Type F devices that contain a System with that system code will resond.

11

Page 12: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Polling CMD/RSP (SENSF)

1h IDm/NFCID2 [RD]PMm1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2

IDm Prefix01FEh: NFCIP1 deviceOther: T3T platform

IC Type Examples:F0h: FeliCa liteE0h: Dynamic Tag

Maximum ResponseTimes

Request Data: System Code (if RC=01h)

0h SC

1 2

RC TSN

System Codee.g. 12FCh: NDEF

Request Code0: no request (default for first polling)1: request primary System Code

Remark: A single device mayanswer with multiple responsesin different timeslots toannounce different capabilities.

Page 13: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Polling

• Most APIs provide the NFCID2 and PMm contained in the polling response to the application.

• The data in the polling response provides information about the remote device• NFCID2 prefix of 01FEh: ISO/IEC 18092 compliant device• Other NFCID2 prefix: T3T platform• IC code provides information about IC type

(e.g. FeliCa lite)• Device responds to a poll command with RC=1 indicating a primary

system with SC=12FCh: NDEF capable device

13

Note: To ensure that all NDEF capable devices are detected, an additional polling command with SC=12FCh is required. Otherwisetargets that have a primary system different to 12FCh (but have a secondary system with 12FCh) are missed

Page 14: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Whitepapers

14

http://www.sony.net/Products/felica/business/tech-support

Page 15: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

‘nfcpy’ open source project

15

Page 16: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

What's ahead

16

� an introduction to 'nfcpy'

� a hello world example

� invitation to get involved

Page 17: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

What's this funny name 'nfcpy'

a software module for using near fieldcommunication readers, written for and in thePython programming language

Page 18: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

It's all about “open nfc”

the scope of 'nfcpy' is the publiclydefined functionality of the open NFCForum specifications

Tag OperationSpecifications

LLCP (P2P)Specification

Page 19: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

There's always a history

'nfcpy' was originally developed toprove and verify the LLCP specification

LLCPDraft

LLCPVerification

LLCPPublication

Page 20: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Attempt of an Architecture

Device Drivers (pn53x, ipsim)

Contactless Frontend

DEP Initiator/Target Type N Tag Ops

LLCP NDEF Tag

P2P Examples Tag Examples

SNEP NDEF Parser/Gen

USB User Space Library (libusb)

Linux Windows

Page 21: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Completeness is always a far goal

'nfcpy' should be quite usable alreadyif you get hold of a Sony reader, butthere is still a substantial wish list

� type 1, 2 and 4 tag support

� drivers for other nfc readers

� more example applications

� documentation !!!

� desktop integration

Page 22: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

What's ahead

22

� an introduction to 'nfcpy'

� a hello world example

� invitation to get involved

Page 23: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Say hello to the worldimport nfcimport nfc.ndefimport nfc.ndef.Text

clf = nfc.ContactlessFrontend()

while True:tag = clf.poll()if tag and tag.ndef:

break

text_en = nfc.ndef.Text.TextRecord( ( "en", "Hello World") )text_de = nfc.ndef.Text.TextRecord( ( "de", "Hallo Welt") )text_fr = nfc.ndef.Text.TextRecord( ( "fr", "Bonjour tout le monde") )message = nfc.ndef.Message( [text_en, text_de, text _fr] )

tag.ndef.message = message.tostring()print “Remove tag and touch again”

while tag.is_present:time.sleep(1)

while True:tag = clf.poll()if tag and tag.ndef:

break

message = nfc.ndef.Message( tag.ndef.message )for record in message:

if record.type == "urn:nfc:wkt:T":text = nfc.ndef.Text.TextRecord( record )print text.language + ": " + text.text

Page 24: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Say hello to the worldimport nfcimport nfc.ndefimport nfc.ndef.Text

clf = nfc.ContactlessFrontend()

while True:tag = clf.poll()if tag and tag.ndef:

break

text_en = nfc.ndef.Text.TextRecord( ( "en", "Hello World") )text_de = nfc.ndef.Text.TextRecord( ( "de", "Hallo Welt") )text_fr = nfc.ndef.Text.TextRecord( ( "fr", "Bonjour tout le monde") )message = nfc.ndef.Message( [text_en, text_de, text _fr] )

tag.ndef.message = message.tostring()print “Remove tag and touch again”

while tag.is_present:time.sleep(1)

while True:tag = clf.poll()if tag and tag.ndef:

break

message = nfc.ndef.Message( tag.ndef.message )for record in message:

if record.type == "urn:nfc:wkt:T":text = nfc.ndef.Text.TextRecord( record )print text.language + ": " + text.text

Page 25: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Say hello to the worldimport nfcimport nfc.ndefimport nfc.ndef.Text

clf = nfc.ContactlessFrontend()

while True:tag = clf.poll()if tag and tag.ndef:

break

text_en = nfc.ndef.Text.TextRecord( ( "en", "Hello World") )text_de = nfc.ndef.Text.TextRecord( ( "de", "Hallo Welt") )text_fr = nfc.ndef.Text.TextRecord( ( "fr", "Bonjour tout le monde") )message = nfc.ndef.Message( [text_en, text_de, text _fr] )

tag.ndef.message = message.tostring()print “Remove tag and touch again”

while tag.is_present:time.sleep(1)

while True:tag = clf.poll()if tag and tag.ndef:

break

message = nfc.ndef.Message( tag.ndef.message )for record in message:

if record.type == "urn:nfc:wkt:T":text = nfc.ndef.Text.TextRecord( record )print text.language + ": " + text.text

Page 26: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Say hello to the worldimport nfcimport nfc.ndefimport nfc.ndef.Text

clf = nfc.ContactlessFrontend()

while True:tag = clf.poll()if tag and tag.ndef:

break

text_en = nfc.ndef.Text.TextRecord( ( "en", "Hello World") )text_de = nfc.ndef.Text.TextRecord( ( "de", "Hallo Welt") )text_fr = nfc.ndef.Text.TextRecord( ( "fr", "Bonjour tout le monde") )message = nfc.ndef.Message( [text_en, text_de, text _fr] )

tag.ndef.message = message.tostring()print “Remove tag and touch again”

while tag.is_present:time.sleep(1)

while True:tag = clf.poll()if tag and tag.ndef:

break

message = nfc.ndef.Message( tag.ndef.message )for record in message:

if record.type == "urn:nfc:wkt:T":text = nfc.ndef.Text.TextRecord( record )print text.language + ": " + text.text

Page 27: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Say hello to the worldimport nfcimport nfc.ndefimport nfc.ndef.Text

clf = nfc.ContactlessFrontend()

while True:tag = clf.poll()if tag and tag.ndef:

break

text_en = nfc.ndef.Text.TextRecord( ( "en", "Hello World") )text_de = nfc.ndef.Text.TextRecord( ( "de", "Hallo Welt") )text_fr = nfc.ndef.Text.TextRecord( ( "fr", "Bonjour tout le monde") )message = nfc.ndef.Message( [text_en, text_de, text _fr] )

tag.ndef.message = message.tostring()print “Remove tag and touch again”

while tag.is_present:time.sleep(1)

while True:tag = clf.poll()if tag and tag.ndef:

break

message = nfc.ndef.Message( tag.ndef.message )for record in message:

if record.type == "urn:nfc:wkt:T":text = nfc.ndef.Text.TextRecord( record )print text.language + ": " + text.text

Page 28: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Say hello to the worldimport nfcimport nfc.ndefimport nfc.ndef.Text

clf = nfc.ContactlessFrontend()

while True:tag = clf.poll()if tag and tag.ndef:

break

text_en = nfc.ndef.Text.TextRecord( ( "en", "Hello World") )text_de = nfc.ndef.Text.TextRecord( ( "de", "Hallo Welt") )text_fr = nfc.ndef.Text.TextRecord( ( "fr", "Bonjour tout le monde") )message = nfc.ndef.Message( [text_en, text_de, text _fr] )

tag.ndef.message = message.tostring()print “Remove tag and touch again”

while tag.is_present:time.sleep(1)

while True:tag = clf.poll()if tag and tag.ndef:

break

message = nfc.ndef.Message( tag.ndef.message )for record in message:

if record.type == "urn:nfc:wkt:T":text = nfc.ndef.Text.TextRecord( record )print text.language + ": " + text.text

Page 29: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Say hello to the worldimport nfcimport nfc.ndefimport nfc.ndef.Text

clf = nfc.ContactlessFrontend()

while True:tag = clf.poll()if tag and tag.ndef:

break

text_en = nfc.ndef.Text.TextRecord( ( "en", "Hello World") )text_de = nfc.ndef.Text.TextRecord( ( "de", "Hallo Welt") )text_fr = nfc.ndef.Text.TextRecord( ( "fr", "Bonjour tout le monde") )message = nfc.ndef.Message( [text_en, text_de, text _fr] )

tag.ndef.message = message.tostring()print “Remove tag and touch again”

while tag.is_present:time.sleep(1)

while True:tag = clf.poll()if tag and tag.ndef:

break

message = nfc.ndef.Message( tag.ndef.message )for record in message:

if record.type == "urn:nfc:wkt:T":text = nfc.ndef.Text.TextRecord( record )print text.language + ": " + text.text

Page 30: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Say hello to the worldimport nfcimport nfc.ndefimport nfc.ndef.Text

clf = nfc.ContactlessFrontend()

while True:tag = clf.poll()if tag and tag.ndef:

break

text_en = nfc.ndef.Text.TextRecord( ( "en", "Hello World") )text_de = nfc.ndef.Text.TextRecord( ( "de", "Hallo Welt") )text_fr = nfc.ndef.Text.TextRecord( ( "fr", "Bonjour tout le monde") )message = nfc.ndef.Message( [text_en, text_de, text _fr] )

tag.ndef.message = message.tostring()print “Remove tag and touch again”

while tag.is_present:time.sleep(1)

while True:tag = clf.poll()if tag and tag.ndef:

break

message = nfc.ndef.Message( tag.ndef.message )for record in message:

if record.type == "urn:nfc:wkt:T":text = nfc.ndef.Text.TextRecord( record )print text.language + ": " + text.text

Page 31: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Say hello to the worldimport nfcimport nfc.ndefimport nfc.ndef.Text

clf = nfc.ContactlessFrontend()

while True:tag = clf.poll()if tag and tag.ndef:

break

text_en = nfc.ndef.Text.TextRecord( ( "en", "Hello World") )text_de = nfc.ndef.Text.TextRecord( ( "de", "Hallo Welt") )text_fr = nfc.ndef.Text.TextRecord( ( "fr", "Bonjour tout le monde") )message = nfc.ndef.Message( [text_en, text_de, text _fr] )

tag.ndef.message = message.tostring()print “Remove tag and touch again”

while tag.is_present:time.sleep(1)

while True:tag = clf.poll()if tag and tag.ndef:

break

message = nfc.ndef.Message( tag.ndef.message )for record in message:

if record.type == "urn:nfc:wkt:T":text = nfc.ndef.Text.TextRecord( record )print text.language + ": " + text.text

time for a demo

Page 32: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

What's ahead

32

� an introduction to 'nfcpy'

� a hello world example

� invitation to get involved

Page 33: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Started by Sony engineers but:

• 'nfcpy' is an open collaborationproject that is not restricted to SonyType 3 (FeliCa) technology

We can provide the expertise for type 3 tag stuff and know the Sony readers

We are not the experts for other

tag types and there certainly is a motivation gap

Page 34: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

It's not difficult to get involved

� visit https://launchpad.net/nfcpy

� browse the code or get a branch

� make your changes and propose for merge

or use 'bzr send' to e-mail me a patch

Page 35: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

NFC Dynamic Tag

35

Page 36: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Concept: From Static to Dynamic

36

HOSTCPU

Serial interface

1Mbps(Max)

Power Supply

RF detection

HOST I/F

Power Switch

All NFC devices that implement the Type 3 Tag Operation specification can communicate with our NFC Dynamic Tag.

NFC Dynamic Tag

NFC Static TagConventional NFC Tag

NFC Dynamic Tag and Host CPU

Fixed data onlyFixed data only

Dynamic dataDynamic data

Page 37: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Dynamic Tag Hardware Module

37

Ⓒ Sony Corporation

NFC ForumDevice, orNFC RW

S801S802

RC-S801RC-S802

HOSTCPU

NFC-F RF interfaceSerial interface

212kbps 1Mbps(Max)

Polling, R/W w/o enc.

Controller(e.g. PC)

NFC-enabled product

Power Supply

RF detection

HOST I/F

Power Switch

• The module consists of an IC chip and an antenna. The module operates from a low power supply sourced from the electronic device in which it is embedded.

• A magnetic field detection function enables the device to respond when a R/W is present. This can enable very power-efficient designs where the device is in deep standby until a field is detected.

• The Dynamic Tag supports Polling / Read / Write commands in 212kbps

RC-S801

RC-S802

Page 38: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

System layout for Development

38

Embedded System

Power supply

PC connected to Embedded System

PC connected to NFC R/W

Control application

Controlapplication

RC-S801RC-S802

socket

USB3.3V

Page 39: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Features

• Emulation of NFC Forum Type 3 TagThe NFC Dynamic Tag can emulate an NFC Forum Type 3 Tag. The device host needs to assure that any commands sent to the RW follow the specifications of the NFC Forum. The emulated device can communicate with any RW that implements the NFC Forum Tag Type 3 Operation Specification.

• Cable and wireless (RF) InterfaceA simple, triple-line, half-duplex cable interface allows the use even with low-speed host CPUs. For application development on the RW side, it is possible to use existing products, such as SDK for FeliCa, which are able to access the wireless interface of the NFC Dynamic Tag.

• Magnetic field detectionThe NFC Dynamic Tag includes a function by which the magnetic field generated by the RW can be detected to trigger the host CPU.

• Low current consumptionThe current consumption during standby is kept at 0.1uA or less to provide power supply conditions suitable for battery-operated devices.

39

Page 40: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

NFC Dynamic Tag Choices

40

Page 41: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Modes

• FB mode/ FeliCa Buffering modeFor pedometers, digital toys or similar devices with a low performance Host CPU

• FT mode / FeliCa Thru modeType 3 Tag compliant operation

41

Page 42: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Application Example: Healthcare Use Case

42

• Touch the NFC-enabled healthcare device with your NFC phone to easily send measured data to a server of e.g. your wellness support service.

• The data then can be used for healthcare or diet control service

Pedometer with Dynamic Tag measures daily work-out count

Touch the pedometer on the mobile phone and transfer measured data

Send measured data to Wellness Support Server via mobile phone network

Count Touch Data Transfer

Show Graph

Healthcare Service

Page 43: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Personal Healthcare made easy

43

Touch the Healthcare Deviceto an NFC Device

Corresponding application launched automatically

Healthcare device with NFC Dynamic Tag make it possible to transfer measured data to the NFC phone just by tapping on to it.

NFC Dynamic TagPedometer Thermometer

PillcaseBlood pressure monitor

Page 44: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Personal Health Devices with Dynamic Tag

44

Manufacturer Device Sample Image

A&D

Pedometer

Blood PressureMonitor

Composition Scale

ACOSPedometer Module

ESTERAPedometer

OMRON Healthcare Composition Scale

TANITAPedometer

YAMASAPedometer

other supporting companies

Page 45: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Low cost Eval Platform:

Arduino with Sony‘s NFC Dynamic Tag

Compatible with NFC Forum Tag Type 3

Dynamic Tag Arduino driver available as source

6 wires connecting

RC-S801 with

Digital GPIO Pins

3.3 V power supply

Touch!

Update data on tag through USBReceive data from phone and store on PCLog data transfer information

Touch NFC phone to Dynamic Tag to read data from tag or write new data on tag

Based on Arduino® open-source electronics prototyping platform (http://arduino.cc/)

USB

45

Page 46: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Low cost Eval Platform:

Arduino with Sony‘s NFC Dynamic Tag

Compatible with NFC Forum Tag Type 3

Dynamic Tag Arduino driver available as source

6 wires connecting

RC-S801 with

Digital GPIO Pins

3.3 V power supply

Touch!

Update data on tag through USBReceive data from phone and store on PCLog data transfer information

Touch NFC phone to Dynamic Tag to read data from tag or write new data on tag

Based on Arduino® open-source electronics prototyping platform (http://arduino.cc/)

USB

46

Let‘s see this live!

Time for a demo

Page 47: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Arduino prototyping platform

Page 48: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

About Arduino

• Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software.

• The boards can be built by hand or purchased preassembled

• the software can be downloaded for free. • The hardware reference designs (CAD files) are

available under an open-source license, you are free to adapt them to your needs.

• Many ‘shields’ and ‘breakouts’ are available that add features like Wi-Fi, GPS or Bluetooth to the platform

• More @ http://www.arduino.cc/

48

Page 49: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Arduino Choices

49

Arduino Uno- ‚Default‘ model- USB Port- ATMega328

- 5V- 32KB Flash- 2KB SRAM- 1KB EEPROM- 16MHz Clock

Arduino Pro 328- ‚Lean‘ model- Breakout boards- ATMega328

- 3.3V / 5V versions- 32KB Flash- 2KB SRAM- 1KB EEPROM- 8MHz / 16MHz Clock

Arduino Mega2560- ‚Power‘ model- USB Port- ATMega2560

- 5V- 256KB Flash- 8KB SRAM- 4KB EEPROM- 16MHz Clock

Arduino Pro Mini 328- ‚Tiny‘ model- Like ‚Pro 328‘, but small

Lilypad- ‚E-Clothing‘ model- Optimized for wearable

electronics

More info at http://arduino.cc/en/Main/Hardware and http://www.sparkfun.com/tutorials/148

Page 50: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Arduino Choices

50

Arduino Uno- ‚Default‘ model- USB Port- ATMega328

- 5V- 32KB Flash- 2KB SRAM- 1KB EEPROM- 16MHz Clock

Arduino Pro 328- ‚Lean‘ model- Breakout boards- ATMega328

- 3.3V / 5V versions- 32KB Flash- 2KB SRAM- 1KB EEPROM- 8MHz / 16MHz Clock

Arduino Mega2560- ‚Power‘ model- USB Port- ATMega2560

- 5V- 256KB Flash- 8KB SRAM- 4KB EEPROM- 16MHz Clock

Arduino Pro Mini 328- ‚Tiny‘ model- Like ‚Pro 328‘, but small

Lilypad- ‚E-Clothing‘ model- Optimized for wearable

electronics

More info at http://arduino.cc/en/Main/Hardware and http://www.sparkfun.com/tutorials/148

Page 51: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Arduino Choices

51

Arduino Uno- ‚Default‘ model- USB Port- ATMega328

- 5V- 32KB Flash- 2KB SRAM- 1KB EEPROM- 16MHz Clock

Arduino Pro 328- ‚Lean‘ model- Breakout boards- ATMega328

- 3.3V / 5V versions- 32KB Flash- 2KB SRAM- 1KB EEPROM- 8MHz / 16MHz Clock

Arduino Mega2560- ‚Power‘ model- USB Port- ATMega2560

- 5V- 256KB Flash- 8KB SRAM- 4KB EEPROM- 16MHz Clock

Arduino Pro Mini 328- ‚Tiny‘ model- Like ‚Pro 328‘, but small

Lilypad- ‚E-Clothing‘ model- Optimized for wearable

electronics

More info at http://arduino.cc/en/Main/Hardware and http://www.sparkfun.com/tutorials/148

Page 52: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Arduino Choices

52

Arduino Uno- ‚Default‘ model- USB Port- ATMega328

- 5V- 32KB Flash- 2KB SRAM- 1KB EEPROM- 16MHz Clock

Arduino Pro 328- ‚Lean‘ model- Breakout boards- ATMega328

- 3.3V / 5V versions- 32KB Flash- 2KB SRAM- 1KB EEPROM- 8MHz / 16MHz Clock

Arduino Mega2560- ‚Power‘ model- USB Port- ATMega2560

- 5V- 256KB Flash- 8KB SRAM- 4KB EEPROM- 16MHz Clock

Arduino Pro Mini 328- ‚Tiny‘ model- Like ‚Pro 328‘, but small

Lilypad- ‚E-Clothing‘ model- Optimized for wearable

electronics

More info at http://arduino.cc/en/Main/Hardware and http://www.sparkfun.com/tutorials/148

Page 53: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Arduino Choices

53

Arduino Uno- ‚Default‘ model- USB Port- ATMega328

- 5V- 32KB Flash- 2KB SRAM- 1KB EEPROM- 16MHz Clock

Arduino Pro 328- ‚Lean‘ model- Breakout boards- ATMega328

- 3.3V / 5V versions- 32KB Flash- 2KB SRAM- 1KB EEPROM- 8MHz / 16MHz Clock

Arduino Mega2560- ‚Power‘ model- USB Port- ATMega2560

- 5V- 256KB Flash- 8KB SRAM- 4KB EEPROM- 16MHz Clock

Arduino Pro Mini 328- ‚Tiny‘ model- Like ‚Pro 328‘, but small

Lilypad- ‚E-Clothing‘ model- Optimized for wearable

electronics

More info at http://arduino.cc/en/Main/Hardware and http://www.sparkfun.com/tutorials/148

Page 54: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Arduino Pro 328 Platform

54

Page 55: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

DynamicTag/FeliCaPlug Shield

55

Page 56: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Connecting the NFC DynamicTag

with the Arduino Pro

56

NFC Dynamic Tag Arduino Pro 328 3.3V

Page 57: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Arduino IDE with Example Sketch

57

This sketch implements

two predefined ‘SmartPosters’ that are toggled by pressing a

button

This sketch implements

two predefined ‘SmartPosters’ that are toggled by pressing a

button

Page 58: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Sample Code to implement an NFC SmartPoster

#include <EEPROM.h>

#include <FeliCaPlug.h>

#include <inttypes.h>

FeliCaPlug plug;

/* TT3 Attribute block + NDEF Message with SmartPoster http://www.stuttgart.sony.de */

uint8_t blockData[48] ={ \

0x10, 0x01, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x30,\

0xd1, 0x02, 0x16, 0x53, 0x70, 0xd1, 0x01, 0x12, 0x55, 0x01, 0x73, 0x74, 0x75, 0x74, 0x74, 0x67,\

0x61, 0x72, 0x74, 0x2e, 0x73, 0x6f, 0x6e, 0x79, 0x2e, 0x64, 0x65, 0x00, 0x00, 0x00, 0x00,0x00};

uint16_t numOfBlocks = 3;

int readOnly = 0x00;

void setup()

{

uint8_t dfc[2] = {0xff, 0xe0};

uint8_t userParam[4] = {0x01, 0x23, 0x45, 0x67};

plug.initPort();

plug.setParam(FELICA_PLUG_MODE_TYPE3, dfc, userParam);

plug.setLEDPin(FELICA_PLUG_LED_PIN);

plug.setBlockData(blockData, numOfBlocks, readOnly);

}

void loop()

{

plug.doLoop();

}

58

Page 59: Wima2011 sony tt3_nfcpy_dynamic_tag

Ⓒ 2011 Sony Corporation

Questions?

[email protected]

[email protected]

59