PN512 Transceive doesn't start

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PN512 Transceive doesn't start

839 Views
slavko_kocjanci
Contributor II

Hello...

I trying to convert library for my project but something doesn't work. So I stripped the code to see if fundamental work.

the 1'st example work.

Reset(H);_delay_ms(1);
NFC_WriteReg(PNr_TxControlReg, 0x03);
NFC_WriteFifo(32,buff);    //some random data in buffer
NFC_WriteReg(PNr_CommandReg, PNc_Transmit);        

Checking if data goes from fifo shows that level goes down and fifo is empty aprox 2.5ms later (valid for 106 kbit)

But the example 2 doesn't start transmission. It's near the same just instead Transmit command I issue Transceive command. But fifo doesn't goes down. What I miss?

Reset(H);_delay_ms(1);
NFC_WriteReg(PNr_TxControlReg, 0x03);
NFC_WriteFifo(32,buff);    //some random data in buffer
NFC_WriteReg(PNr_CommandReg, PNc_Transceive);        
NFC_WriteReg(PNr_BitFramingReg, 0x80);   

0 Kudos
2 Replies

705 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Please refer to the following Pseudo Code for details.

CLL
//> Mifare Reader:
//> --------------

// reset chip
SR 01 0F    // Softreset

//> IC Configuration:
//> -----------------
SR 14 83    // TxControlReg - InvTx2On=1, Tx2RFEn, Tx1RFEn
SR 15 40    // TxAutoReg - Force100ASK
SR 18 55    // RxThresholdReg - MinLevel, CollLevel
SR 19 4D    // DemodReg
SR 23 6F    // GsNLoadMod
SR 24 26    // Modwidth
SR 25 8F    // TxBitPhase
SR 26 59    // RFCfgReg - RxGain
SR 27 F4    // GsNReg - CWGsN, ModGsN
SR 28 3F    // CWGsP
SR 29 11    // ModGsP

//> Start Transceive:
//> -----------------
SR 01 0c    // CommandReg - transceive

//> Mifare Request:
//> ---------------
SR 0a 80    // flush FIFO
SR 09 26    // FIFO - Request code
RE 0a 01    // Read FIFOLevel

SR 0d 87    // BitframingReg - StartSend, TxLastBits

SLP 10

//> Response ATQ:
//> -------------
GR 06       // Read ErrReg
RE 0a 02    // Read FIFOLevel
GR 09       // ATQ LSB
GR 09       // ATQ MSB

Hope that helps,

Have a great day!

Kan

705 Views
slavko_kocjanci
Contributor II

Works... Thank you..

0 Kudos