HELP NEEDED FOR RFID MFRC522 SPI INTERFACE WITH 8051
Discussion in "8051 Discussion Forum" started by siddique Jul 8, 2014.
Tue Jul 08 2014, 10:15 am
HI,
I'm working on rfid reader mfrc522 with at89s52 controller. Need guidance for implementing this task with SPI protocol.
Thanks in advance.
I'm working on rfid reader mfrc522 with at89s52 controller. Need guidance for implementing this task with SPI protocol.
Thanks in advance.
Thu Jul 10 2014, 05:55 pm
You can write a simple bit-bang SPI code to emulate SPI on 89S52 controller, rest you have to look into datasheet of MFRC522. Can you provide link to its datasheet.
Sat Jul 12 2014, 10:57 am
hi ajay,
i have successfully written data into the registers of mfrc522 by using SPI protocol.
but i have a problem i.e. if suppose i'm writing a data X to a register A and if i read the data of register A in the immediate next step then i'm getting the correct data (X), but if i write 2 or more data in different registers A,B,C and then if i go back to read register A then i get the data which i have written in register C. (i.e. i get the latest written data).
how can i avoid this problem.
i have attached my spi write and read functions for reference.
i have successfully written data into the registers of mfrc522 by using SPI protocol.
but i have a problem i.e. if suppose i'm writing a data X to a register A and if i read the data of register A in the immediate next step then i'm getting the correct data (X), but if i write 2 or more data in different registers A,B,C and then if i go back to read register A then i get the data which i have written in register C. (i.e. i get the latest written data).
how can i avoid this problem.
i have attached my spi write and read functions for reference.
Wed Jul 16 2014, 04:06 pm
i am trying to move the contents of an array to another array. the 1st array is in the internal part of the ram and 2nd array in the external.
but when i print a2 , i'm getting garbage value.
any idea what the problem could be.
unsigned char a1[5]; unsigned char xdata a2[5]; a1[0]=a2[0]; a1[1]=a2[1]; a1[2]=a2[2];
but when i print a2 , i'm getting garbage value.
any idea what the problem could be.
Wed Jul 16 2014, 11:05 pm
i am trying to move the contents of an array to another array. the 1st array is in the internal part of the ram and 2nd array in the external.unsigned char a1[5]; unsigned char xdata a2[5]; a1[0]=a2[0]; a1[1]=a2[1]; a1[2]=a2[2];
but when i print a2 , i'm getting garbage value.
any idea what the problem could be.siddique
You will need to post more of your program to show
how you are initialising the a2 array and how you are printing it.
Powered by e107 Forum System