我上周发布了一个胎面,但很快就被埋没了……
因此,当使用 Arduino 探测或读取 MISO 时,我无法获得任何输出。
和
@Bart Herse(员工)在帖子中问我是否连接了 IRQ 引脚。
阅读数据表后,我仍然不确定如何处理来自 ST25 的 IRQ 信号。目前,当我探测 IRQ 输出保持高电平时...我正在使用 EVAL ST25RU3993
这是我的 Arduino 代码,我只想在默认设置下读取 RSSI 信息。
- #include
- ////////////////////////////////////////////
- //set up pins for arudino due
- //MOSI:ICSP-4
- //MISO:ICSP-1
- //SCK:ICSP-3
- //NCS:52
- //EN:2
- //IRQ:22
- ///////////////////////////////////////////////
- // Set up chip-select pin as NCS and enable pin as EN
- const int NCS = 52;
- const int EN = 2;
- const int IRQ =7;
- //SPI setting
- SPISettings settingsA(100000, MSBFIRST, SPI_MODE0);
- void setup() {
- pinMode (NCS, OUTPUT);
- pinMode(EN, OUTPUT);
- pinMode(IRQ, INPUT);
- digitalWrite(EN, HIGH);//set enable to high
- Serial.begin(9600);
- SPI.begin();
- SPI.beginTransaction(settingsA); //I wrote to the following 2 main control registers, register description is at the data sheet
- // digitalWrite (NCS, LOW);
- // SPI.transfer(0b00000000); // write and register addressL: Device staus register
- // SPI.transfer(0b00000001); // value for this register: Turn RF-On
- // digitalWrite (NCS, HIGH);
- // digitalWrite (NCS, LOW);
- // SPI.transfer(0b00000001); // write and register addressL: Protocal Selection Register
- // SPI.transfer(0b00000000); // value for this register: Choose EPC Gen2
- // digitalWrite (NCS, HIGH);
- Serial.print("written");
- SPI.endTransaction();
- }
- int8_t O;
- void loop() {
- //
- for (int i = 0; i <= 25500; i++) {
- SPI.beginTransaction(settingsA); //read from my RSSI_Display register
- digitalWrite (NCS, LOW);
- O = SPI.transfer16(0b0110101100000000);
- // SPI.transfer(0b0100000);
- digitalWrite (NCS, HIGH);
- SPI.endTransaction();
- // delay(50);
- }
- Serial.print(O);
- }