2022-01-10 09:58 AM
My setup is as follows:
After 8 days of trying, I've not been able to get any communication out of the IC. I purchased 3 of these and have swapped out a fresh IC in case the 1st was fried.
My script setups the GPIO pins of the Raspberry Pi as well as the SPI interface. When power is supplied, the script::
The documentation is confusing in that it says 0x00 is required to send a command. However, none of the examples show this. An IDN request should be 0x00, 0x01, 0x00 according to the written instructions. I never get any response on the IRQ_OUT pin, so I also tried polling. Even after a second between each poll request, I still could not get any response from the chip.
The examples are more confusing than helpful. The IDN command examples says to issue "0x0100" That is 256 , but I did try that as well. I also tried 0x00 and this command. And as I said, I also tried 0x00, 0x01, and 0x00.
I would like to see some form of output from the IC. What am I doing wrong? I would assume the crystal osc is not required just for communication testing, but I did also try with this.
I am more than willing to send pictures of the setup and my script. Please help.
Solved! Go to Solution.
2022-01-13 02:28 AM
Hi,
the digital part of the IC needs a proper clocking. If the crystal is not properly providing a 27.12 MHz clock, the IC will not be able to answer on the SPI.
After power on, the IC enters the Power-Up state: in this state the 27.12 MHz High Frequency Oscillator (HFO) is off. The HFO will be enabled during the startup sequence thanks to the IRQ_IN pulse. Once the HFO is ready, the IC can reply to the various commands on the selected interface (SPI).
I would suggest to check that:
Regarding the X-NUCLEO-NFC03A1, it can be used without a STM32 Nucleo board. You just need to connect some wire jumpers between the X-NUCLEO-NFC03A1 and your RPi board (power supply, SPI, IRQ, etc.). You can also use an ARPI600 Raspberry Pi to Arduino adapter (see UM2548 explaining a similar setup with X-NUCLEO-NFC06A1 but that can be use as well or X-NUCLEO-NFC03A1). I believe that RPI4+ARPI600 interposer+X-NUCLEO-NFC03A1 will provide you a more stable prototyping environment that a QFN chip holder.
Rgds
BT
P.-S. if you want to use an STM32 Nucleo (to see our various NFC demos), I would recommend the NUCLEO-L476RG. For the FW (C source code and binary), I would recommend the STSW-ST25R-LIB (then select STSW-ST25R017 package for ST25R95).
2022-01-10 02:58 PM
Hi,
the chapter 4 of the ST25R95 Datasheet describes the SPI communication protocol layer between a host MCU and the ST25R95. This communication protocol is used to convey the various commands such IDN, ProtocolSelect, SendReceived, etc. The command layer is described in the chapter 5. When those commands are sent over SPI, they are encapsulated as described in chapter 4.
The various commands follow the syntax: Cmd_id, Length, Data1..DataN where Cmd_id identifies the command (e.g. 01=IDN) and where Length is the length of the data related this command (Length = 0 when the command does not have data).
For example, the IDN command is 01 00 (01 = identifier of the command, 00 = length of the data)
When sending this command on SPI, it has to be prefixed by the 00 "Send command to the ST25R95" control byte. In order to read the reply from the ST25R95, a 02 "Read data from the ST25R95" has to be sent.
The various SPI frames (send command, poll, read data from the ST25R95) must be separated by a high level on the SPI SS line (see § 4.1.1).
Regarding your issue, I would recommend to check that
Also, I would suggest to connect a logic analyzer on IRQ_IN, IRQ_OUT, SPI_CLK/MOSI/MISO/SS, SSI_0, SSI_1 and to send me the trace of the initialization sequence and SPI communication
Example of commands
First frame: 03 XX SPI Poll. Answer is XX 06 ==> bit #2 =1: data can be sent to the device
2nd frame: 00 55 : Send Echo command
IRQ_OUT goes low
3rd frame 02 XX XX XX read Echo response
4th frame 00 01 00: send IDN command
Rgds
BT
2022-01-11 01:09 AM
Hi EHugh.2,
I see you are using a socket for the ST25R95. This should work for digital experiments/bring-up however I would like to warn that this may get difficult when moving to actual RF communication (additional resistance induced by socket, trace lengths to matching network and supply buffer structures, impedance control, etc.).
Maybe an X-NUCLEO-NFC03A1 would be an alternative / additional option for you.
Best Regards, Ulysses
2022-01-12 01:55 PM
Thanks for the very thorough response. I have attached my logic analyzer tests as well as a screen shot of my Python test Script. As you see from the script, I've created code to buttons so I know what is sent and when.
I'd like to respond here to some of your suggestions:
(1) Clock probe. I do not see the response with my oscilloscope when I probe the clock as shown in Figure 3 of your link. Its mostly noise.
(2) I never see anything on IRQ_OUT. The logic analyzer shows that it is always low.
(3) Section 4.1.1 of the datasheet says that CPOL=CPHA=1 or CPOL=CPHA=0. I tried both of those. Based on your suggestion, I also tried CPHA = 1 and CPOL = 0. I saw no change in performance (or lack thereof).
(4) MISO and MOSI are properly connected (see attachments)
(5) SS is being set high between commands (see attachments)
(6) The chip is not responding to the any command, including the echo command.
So I'm still not able to talk to this at all. This is not the first time I've communicated to something with SPI, so I'm quite confused as to what could be the issue. I have confirmed power is getting to the IC holder. I loaded my 3rd IC into the holder for these tests (just in case I fried the previous 2 IC's.) I ordered another 3 just in case I have damaged these 3, but I am at a lost right now as to what to try.
2022-01-12 01:56 PM
2022-01-12 01:57 PM
2022-01-12 01:57 PM
2022-01-12 01:58 PM
2022-01-12 02:29 PM
I had purchased one of these from Mouser, but it came with a type A to type B USB cable. There is no type b (or any other USB type) connector on the board. It took me a while to figure out that it didn't go with the board supplied. The link for software that is supplied on the card inside goes to a general page for all Nucleo devices. If you drill down, you can finally get to the -NFC03A1 product page. I downloaded the Getting Started document, and it said needed a STM32 nucleo board for my board to attach. I see that has type b connector, so I assume that cable is for this. Its weird they included a cable for a board that isn't included. I have yet to find all the software required to run this.
So it seemed to me to be much easier going with my approach. I had the software written in a hour and the initial hookup in about 30 minutes. Of course, I haven't had any luck with my approach yet. Maybe I will have to go back to this. If you have a link for all the software I am suppose to use, I'd appreciate it. If there is also a preferred STM32 Nucleo board I should buy, please let me know.
I do agree with you about the potential of having different resistance, impedance, capacitance, etc with my setup and an external antenna. But I have a vector network analyzer, and I use it to help tune the antenna. I don't plan for this to be the final deliverable -- I''m just trying to make sure I am properly talking to the IC first.
Thanks for your help.
2022-01-13 02:28 AM
Hi,
the digital part of the IC needs a proper clocking. If the crystal is not properly providing a 27.12 MHz clock, the IC will not be able to answer on the SPI.
After power on, the IC enters the Power-Up state: in this state the 27.12 MHz High Frequency Oscillator (HFO) is off. The HFO will be enabled during the startup sequence thanks to the IRQ_IN pulse. Once the HFO is ready, the IC can reply to the various commands on the selected interface (SPI).
I would suggest to check that:
Regarding the X-NUCLEO-NFC03A1, it can be used without a STM32 Nucleo board. You just need to connect some wire jumpers between the X-NUCLEO-NFC03A1 and your RPi board (power supply, SPI, IRQ, etc.). You can also use an ARPI600 Raspberry Pi to Arduino adapter (see UM2548 explaining a similar setup with X-NUCLEO-NFC06A1 but that can be use as well or X-NUCLEO-NFC03A1). I believe that RPI4+ARPI600 interposer+X-NUCLEO-NFC03A1 will provide you a more stable prototyping environment that a QFN chip holder.
Rgds
BT
P.-S. if you want to use an STM32 Nucleo (to see our various NFC demos), I would recommend the NUCLEO-L476RG. For the FW (C source code and binary), I would recommend the STSW-ST25R-LIB (then select STSW-ST25R017 package for ST25R95).