Good day! I have done a lot of research and there is no real answer to this. I managed to find the closest answer which is use the following command:
mfrc522.PCD_WriteRegister(CommandReg, 1, 0x10); // Set the power down bit to reduce power consumption.
The problem is that CommandReg is not declared.
According to the datasheet on page 33, this is the correct approach as the command register controls the soft powerdown mode. Can someone please make it clear how to enter the sleep mode and exit it, also what will be the power consumption during this sleep mode. I am using nodeMCU v2/ v3 and the arduino IDE 1.8.12. I am also using the internet library from here:
Datasheet source: https://www.nxp.com/docs/en/data-sheet/MFRC522.pdf
Datasheet partial information block:
MFRC522All information provided in this document is subject to legal disclaimers.© NXP Semiconductors N.V. 2016. All rights reserved.Product data sheetCOMPANY PUBLICRev. 3.9 — 27 April 2016112139 33 of 95NXP SemiconductorsMFRC522Standard performance MIFARE and NTAG frontend8.6 Power reduction modes8.6.1 Hard power-downHard power-down is enabled when pin NRSTPD is LOW. This turns off all internal current sinks including the oscillator. All digital input buffers are separated from the input pins and clamped internally (except pin NRSTPD). The output pins are frozen at either a HIGH or LOW level.8.6.2 Soft power-down modeSoft Power-down mode is entered immediately after the CommandReg register’s PowerDown bit is set to logic 1. All internal current sinks are switched off, including the oscillator buffer. However, the digital input buffers are not separated from the input pins and keep their functionality. The digital output pins do not change their state.During soft power-down, all register values, the FIFO buffer content and the configuration keep their current contents.After setting the PowerDown bit to logic 0, it takes 1024 clocks until the Soft power-down mode is exited indicated by the PowerDown bit. Setting it to logic 0 does not immediately clear it. It is cleared automatically by the MFRC522 when Soft power-down mode is exited.Remark: If the internal oscillator is used, you must take into account that it is supplied by pin AVDD and it will take a certain time (tosc) until the oscillator is stable and the clock cycles can be detected by the internal logic. It is recommended for the serial UART, to first send the value 55h to the MFRC522. The oscillator must be stable for further access to the registers. To ensure this, perform a read access to address 0 until the MFRC522 answers to the last read command with the register content of address 0. This indicates that the MFRC522 is ready. [code]