Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
Here,after sending register address of Mfrc522 what data bytes are send (I mean are they random values or they are specified) and what is upto n bytes..does it mean I have 2 send 2 8 bytes because the rc522 card consists of 12 bit number.
It means there are three or more bytes:
Byte 1: is the device ID according to the I2C spec, it selects the device in case there are other I2C devices on the same bus.
Byte 2: having selected the device with byte 1, this selects which register inside that device the following data is to go to.
Byte 3 and onwards: the actual data to be written to the selected register in the selected device.
Some registers need a single byte, some need several bytes so after byte 1 and 2, you send as many as required.
I Know 1 and 2..The device is MFRC522 with address 0x50 and I want to write to FiFO register of address 0x09 now what byte I should send It is not given in datasheet..My purpose is to read the card data through rfid..and the data consist of 12 number..So are the data bytes just random or are the specified. here is the write and read function.
I do not understand your question. If the number could be random what would be the point in using it?
When writing ANY data to something you need to know two basic things: where to write it and what to write. Where to write it is defines in Bytes 1 and 2, what to write depends on the register, its purpose and what you want it to do. The data sheet should tell you what the bits in the registers do and what values they should hold to configure the device for writing or reading.
I2C start
I2C Write device address
I2C Write Register address (Register address will be mentioned in datasheet of MFRC522)
I2C Write (byte 1) (the value that is to be written to register, (to the register that you selected in second I2C Write())
//If you need to write more data (bytes) to the same selected register) then send more bytes as below.
I2C Write (byte 2)
I2C Write (byte 3)
I2C Write (byte 4)
I2C Write (byte 5)
//Also while using I2C Write() many times in sequence you might need to issue I2C_Repeated_Start()
I2C Stop
Post datasheet of MFRC522.
I guess your for(j = 0... loop is wrong. It is incrementing i and not j. Is it intentional or a mistake? Also why RFID instead of RFID[j] in the loop?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.