2025-04-11 4:11 PM - edited 2025-04-11 4:37 PM
For my setup, I am using a nucleo-L476RG and a NFC08A1. I am wanting to learn bare metal programming to really grasp micro controller programming. I have programmed some smaller bare metal programs, SPI, I2C, etc on the nucleo. Now, I am trying to interface with the NFC08A1. Looking at the ST25R3916B datasheet,
and reading through the SPI section I was a little confused by the read and write commands in the table 12 SPI operation modes. The other commands are pretty straight forward sending of bits. Can someone help me understand what A5 - A0 represent? I am thinking they are addresses to the different registers or referencing certain pins. For instance, in Table 2 A5 is referencing the SPI enable pin. In other areas of the data sheet for the SPI interface on Figure 16 SPI communication: writing multiple bytes it says write to the sclk falling edge data moved to address <A5-A0>. Thanks in advance.
2025-04-13 12:59 PM
Hi
A bare metal driver of the ST25R3916B is available in the X-CUBE-NFC6 package. It is recommended to use it rather than re-developing a new driver.
Regarding your questions,
Rgds
BT
2025-04-24 7:46 PM
It says in the datasheet for the ST25R3916B that enabling the rx_en bit in the operation control register will put the board in Receiver mode
So if I wanted to do this, there would be two steps in writing to the Operation Control Register and turning the rx_en bit to 1, correct?
First, I would do a write command where A5 - A0 is the address of the Operation Control Register, which is 02h, correct?
So it would be write
M1 M2 C5 C4 C3 C2 C1 C0
0 0 0 0 0 0 1 0
then another write with the hex number 6 which enables shifts a bit (1<<6) to enable the rx_en bit correct?
M1 M2 C5 C4 C3 C2 C1 C0
0 0 0 0 0 1 1 0
Is my thinking correct?
2025-04-25 12:30 AM
Hi,
if you want to write rx_en=1 into the Operation Control Register, just send 0b00000010 followed by 0b0100000. Basically you have to first read the current value, modify the bits you want to change (i.e. rx_en) and write back the value (Read/Modify/Write).
Again, I recommend you have a look into the X-CUBE-NFC6 package. This provides all the bare metal API to read/write register and the NFC communication stack.
Rgds
BT
2025-04-25 7:45 AM
Thanks for the info. I was digging a little in the package listed. Do you know which file or folder I can find the code you speak of?
2025-04-25 8:02 AM
Hi
For the driver part, I would suggest to have look into st25r3916.c and st25r3916_com.c files in \Drivers\BSP\Components\ST25R3916 folder of the X-CUBE-NFC6 package. For the NFC communication stack, this is in Middlewares\ST\rfal folder.
Rgds
BT
2025-04-25 8:24 AM
Thank you so much for the direction.