Assuming that the I2C address indicates that you are doing a write to the device, then you should be putting in whatever value you need to send to that device address.
Susan
Hi,
I am doing project on RFID MFRC522. I have done read and write cycle according to datasheet page 20. I have send device address, and Fifo register address(0x09 datasheet page 36) and 8 bit data. I have done according to cycle But I cannot read the data. I dont know where I am getting ERROR. I think I have used right registers address and function are also ok.
I have no experience with your library functions. But from standard I2C communication:
Code:
unsigned char Rfid_get_data
i2c_start(Write_Address+I2c_write);
i2c_write(Register_Address);
_delay_ms(1);
i2c_start(Write_Address+I2C_READ); [COLOR="#FF0000"]--> here I expect I2C_repeated_start instead of I2C_start[/COLOR].
Data = i2c_readAck();[COLOR="#FF0000"]--> here I expect to send a dummy byte 0xFF, then read the I2C_input_data_register[/COLOR].
Maybe your library functions do this correctly --> read the library documentation
Or look for verified code examples. I2C communication is almost independent from I2C_slave type, thus no need to look for a MFRC522 code.