Discussion in "8051 Discussion Forum" started by    siddique    Jul 8, 2014.
Tue Jul 08 2014, 10:15 am
#1
HI,
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
#2
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
#3
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.
Attachment
Sat Jul 12 2014, 12:28 pm
#4
i have corrected it.
Mon Jul 14 2014, 11:57 am
#5
[Topic moved to 8051 Discussion Forum]
Wed Jul 16 2014, 04:06 pm
#6
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.
Wed Jul 16 2014, 11:05 pm
#7


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.


Get Social

Information

Powered by e107 Forum System

Downloads

Comments

KevinTab
Sun Apr 28 2024, 05:35 am
Tumergix
Sun Apr 28 2024, 12:59 am
StevenDrulk
Sat Apr 27 2024, 08:47 pm
StephenHauct
Sat Apr 27 2024, 09:38 am
Adamsaf
Sat Apr 27 2024, 07:12 am
Robertphype
Sat Apr 27 2024, 12:23 am
ktaletrryp
Fri Apr 26 2024, 10:55 pm
Robertrip
Fri Apr 26 2024, 11:20 am