TRF7970A (NFC reader ) with arduino SPI protocol

friends i’m working with trf790A (nfcreader) with arduino by SPI protocol…

Is there any trf7970 library for arduino ?

in the pdf attached there is an algorithm for detecting ISo1443a and ISO 15693

i tried the program for ISO1443a,but its not working can any one help me

#include<SPI.h>

#define enable pins
#define CS pins
#define CS_ENABLED digitalWrite(CS,HIGH)
#define CS_DISABLED digitalWrite(CS,LOW)

void setup()
{
  // put your setup code here, to run once:
  pinMode(CS,OUTPUT);
  pinMode(enable,OUTPUT);
  digitalWrite(enable,HIGH);
  pinMode(interrupt,INPUT);
  SPI.setDataMode(SPI_MODE1);
  SPI.setClockDivider(SPI_CLOCK_DIV8);
  SPI.setBitOrder(MSBFIRST);
  SPI.begin();
  Serial.begin(9600);
}

void loop()
{
  // put your main code here, to run repeatedly:
 

   let();
}
void let(void)
{
  CS_ENABLED;
  Write(0x83);
  CS_DISABLED;
  CS_ENABLED;
  Write(0x09);
   Write(0x31);
  CS_DISABLED;
  CS_ENABLED;
  Read(0x49);
  CS_DISABLED;
  CS_ENABLED;
   Write(0x01);
   Write(0x88);
  CS_DISABLED;
   CS_ENABLED;
  Read(0x41);
  CS_DISABLED;
   CS_ENABLED;
   Write(0x00);
   Write(0x20);
  CS_DISABLED;
  CS_ENABLED; 
  Read(0x40);
  CS_DISABLED;
  CS_ENABLED;
 Write(0x01);
 Write(0x88);
CS_DISABLED;
CS_ENABLED;
 Write(0x8F);
 Write(0x90);
 Write(0x3D);
 Write(0x00);
 Write(0x0F);
 Write(0x26);
CS_DISABLED;
delay(100);
CS_ENABLED;
 Write(0x6C);
Read(0xC0);
Read(0x3E);
CS_DISABLED;
CS_ENABLED;
 Write(0x5C);
Read(0x02);
CS_DISABLED;
CS_ENABLED;
 Write(0x7F);
Read(0x04); 
Read(0x00);
CS_DISABLED;
CS_ENABLED;
 Write(0x8F);
CS_DISABLED;
CS_ENABLED;
SPI.transfer(0x4F);
Read(0x7F);
CS_DISABLED;
delay(20);
CS_ENABLED;
 Write(0x8F);
 Write(0x90);
 Write(0x3D);
 Write(0x00);
 Write(0x20);
 Write(0x93);
 Write(0x20);
CS_DISABLED;
delay(5);
CS_ENABLED;
 Write(0x6C);
Read(0xC0);
Read(0x3E);
CS_DISABLED;
CS_ENABLED;
 Write(0x5C);
Read(0x05);
CS_DISABLED;
CS_ENABLED;
 Write(0x7F);
Read(0xCD); 
Read(0x88); 
Read(0x77); 
Read(0x66); 
Read(0x00);
delay(10);
CS_DISABLED;
CS_ENABLED;
 Write(0x6C);
Read(0x00); 
Read(0x3E);
CS_DISABLED;
CS_ENABLED;
 Write(0x8F);
CS_DISABLED;
CS_ENABLED;
 Write(0x4F);
Read(0x7F);
CS_DISABLED;
}

void Read(byte data )
{
  Serial.print(SPI.transfer(data));
}

void Write(byte data)
{
 SPI.transfer( data);
}

TestTRF7970A_with_BPV3 (1).pdf (217 KB)

Hi Avinashchakravarthi,

I’m not sure where you got that .PDF - but you’re better off working with code that is known to work.

This particular board was originally designed to interface with TI’s Launchpad series and whilst it will work with Arduino (via SPI) - you’ll need to rewrite some of the code in the header files.

http://www.ti.com/tool/DLP-7970ABP

Have a look at the attached…

Let me/us know if you have any issues!

Cheers,
Armen

sloa213.zip (94.6 KB)

Actually, now that I've had a look myself I would be interested in porting this over to Arduino too. It would be a nice little project - not that much code.

If anyone else is interested please post here.

In the meantime, instruction sets for both MCUs can be found in their respective manuals:

http://www.atmel.com/images/atmel-2549-8-bit-avr-microcontroller-atmega640-1280-1281-2560-2561_datasheet.pdf

http://www.ti.com/lit/ug/slau144j/slau144j.pdf

I know this is a very old Post, but i have to ask , " Did any of you guys get it going? And if so were you able to read ISO1443a , ISO1443b and ISO 15693?