NFC在porting完成之後,後續會需要進行RF相關測試,執行這些測試需要輸入指令讓NFCC進到對應的測試階段,本篇將介紹PN7160常用到的兩個測試指令"Measure Antenna current"與"PRBS",
- Measure Antenna current
『This command is used to execute the antenna self-test measurements, which allow to check that all the discrete components connected between PN7160 and the contactless antenna are properly soldered on the PCB.』(from PN7160 user manual, 14.2 TEST_ANTENNA_CMD/RSP)
需要輸入的指令串如下:
send 20000101
send 2001020000
send 2F0200
send 2F000100
send 20020501A0400100
send 20025B01A00B57101090720F4E003F95B7AA3F9FA799529F97995B9F97995D9F9700669F0700689F0700729F0700759F07007D9F07007F9F0700889F04008A9F0400939F0400959F04009E9F0200A69F0000AB1F0000B51F0000BE1F0000
send 20020F01A00E0B310101310000001100D00C
=> 更動黃框處(0xA00E的byte[7])來調整TVDD的電壓值(請參照圖一)
send 2F3D022001
sleep 100
send 2F3D020180
=> 由此指令的回傳值判斷電流(後續說明)
sleep 100
send 2F3D0402C86003
send 2F3D022000
圖一 0xA00E byte[7] 電壓調整說明
判斷電流:
這邊以回傳值”4F3D050008030000”為例子說明。
需要分析的部分是0008030000:
00 => 指令順利執行;如果不是00,表示執行有問題
08030000 => 要看的就只有第1 & 2 個byte(最後兩個byte 0x0000不看)
0x08 => RawVal, 8mA
0x03 => RawVal + 160 [mA] = 8 + 160 = 168 mA
電流的判讀就是168 mA。
byte詳細說明可參考下圖:
指令串實際執行狀況:
- PRBS
『This command is used to start PRBS infinite stream generation. Both PRBS generation done by the FW or by a specific HW block can be used, depending on what fits the needs the best. A 511-bit pseudo-random test sequence (PRBS9) or a 32 767-bit pseudo-random test sequence (PRBS15) can be selected.』(from PN7160 user manual, 14.3 TEST_PRBS_CMD/RSP)
需要輸入的指令串如下:
send 20000101
send 2001020000
send 2F0200
//PRBS
send 2F3006010000000101
確認輸入PRBS指令收到之RSP是4F300100, 表示指令有正常輸入;
此時NFCC已經持續打出相對應的場強了.
可參考下圖調整PRBS輸出的格式
如果想了解指令之詳細意義,請參閱PN7160的user manual(UM11495)與NCI 2.0指令文件,
※此篇指令只能用在PN7160,請勿混用於其他NFC chip,
參考來源