PN512 selftest

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
1,971件の閲覧回数
slavko_kocjanci
Contributor II

Hello...
I try to make own reader with PN512 and AtXmega. I assume that board is working, and SPI communication is ok.
At least if I read some registers from PN512 (CommandReg, CommIRqReg, WaterLevelReg, ModeReg) I got correct values as should be at poweron. Also if I write WaterLevelReg for example and read back I got correct value.

But if I try to perform selftest I got totally unexpected result.
Here is 'pseudocode' I execute. What are wrong.

//1. Perform a soft reset.
SpiWrite(CommandReg,SoftReset);

//2. Clear the internal buffer by writing 25 bytes of 00h and perform the Config Command.
SpiWrite(FIFODataReg,00*25);
SpiWrite(CommandReg,Configure);

//3. Enable the Selftest by writing the value 09h to the register AutoTestReg.
SpiWrite(AutoTestReg,0x09);

//4. Write 00h to the FIFO.
SpiWrite(FIFODataReg,0x00);

//5. Start the Selftest with the CalcCRC Command.
SpiWrite(CommandReg,CalcCRC);

//6. The Selftest will be performed.
_delay_ms(1000); //do I need to check bussy? for now just wait

//7. When the Selftest is finished, the FIFO contains the following bytes:
SpiRead(FIFODataReg,64 bytes);

And result is:
0x00 0x05 0x09 0x09 0x09 0x09 0x09 0x09
0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09
0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09
0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09
0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09
0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09
0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09
0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09

ラベル(2)
0 件の賞賛
返信
1 解決策
1,827件の閲覧回数
slavko_kocjanci
Contributor II

Indeed was my software bug. Read FIFO routine was faulty as didn't correctly set address for next read.

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
1,828件の閲覧回数
slavko_kocjanci
Contributor II

Indeed was my software bug. Read FIFO routine was faulty as didn't correctly set address for next read.

0 件の賞賛
返信