Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLRC663 #7

Closed
arunsss123 opened this issue Apr 12, 2019 · 7 comments
Closed

CLRC663 #7

arunsss123 opened this issue Apr 12, 2019 · 7 comments

Comments

@arunsss123
Copy link

We are using the custom board with the Reader ic is CLRC663 and SPI is used for the interfacing with microcontroller. SPI is configured as mentioned in the Datasheet of the clrc663 reader.The issue is there is no response from the reader.SiPI is working FIne.

**need help for the communication

@iwanders
Copy link
Owner

If it's a custom board and the SPI communication looks fine with a logic analyzer it's likely a hardware problem. It can be a lot of things, from incorrect interface selection to the crystal not providing a stable clock. There's little I can do besides saying double-check the circuitry, check if the pins are at the appropriate logic levels. In particular check that the IFSEL pins are set up correctly for SPI, check all the power pins and the PDOWN pin.

I used the mfrc630_read_fifo, mfrc630_fifo_length and mfrc630_write_fifo functions to confirm that the chip was responding to my SPI signals when I worked on this. If you can write data and read the same back you've confirmed the chip works and your communication works.

@arunsss123
Copy link
Author

arunsss123 commented Apr 14, 2019 via email

@iwanders
Copy link
Owner

I think 0x7f is correct, you should be able to rely on the functions from this library and do:

const uint8_t ic_version = mfrc630_read_reg(MFRC630_REG_VERSION);

If the SPI communication is setup correctly this should be all you need to do.

@arunsss123
Copy link
Author

Sir,i am done the following method to get the data about version and sub version register,

  • i am taken Temp as variable in code,i am attaching the code
    spi_cmd_send(0x7f);//sending the command 7f
    Temp=0;//restting the variable
    while (!SPI_GetFlagStatus(HT_SPI0, SPI_FLAG_RXBNE));
    Temp=SPI_ReceiveData(HT_SPI0);//receving the data through the spi recieve function
    spi_cmd_send(0x01);
    Temp=0;
    while (!SPI_GetFlagStatus(HT_SPI0, SPI_FLAG_RXBNE));
    Temp=SPI_ReceiveData(HT_SPI0);
    spi_cmd_send(0x00);
    Temp=0;
    while (!SPI_GetFlagStatus(HT_SPI0, SPI_FLAG_RXBNE));
    Temp=SPI_ReceiveData(HT_SPI0);

  • each time i am checking the temp variable.

@arunsss123
Copy link
Author

Still not getting the version and subversion ID through the SPI, please provide any examples.

  • i am making any wrong in the code????please guide me sir

@arunsss123
Copy link
Author

arunsss123 commented Apr 15, 2019

i have checked following method also sir,still i am getting oxff only
spi_active();
spi_cmd_send(0xFF);
while (!SPI_GetFlagStatus(HT_SPI0, SPI_FLAG_RXBNE));
Temp=SPI_ReceiveData(HT_SPI0);
spi_inactive();
spi_active();
spi_cmd_send(0x00);
while (!SPI_GetFlagStatus(HT_SPI0, SPI_FLAG_RXBNE));
Temp=SPI_ReceiveData(HT_SPI0);
spi_inactive();

@iwanders
Copy link
Owner

I presume spi_cmd_send is a raw SPI command, in that case it is wrong. You have to set the bit to read the register. See the read_reg implementation. Read the datasheet to understand how to talk to this chip.

You are not using this library, neither do you take the effort to format your posts such that they are conveniently readable. I'm closing this issue as it is off-topic as it does not pertain to this library. I don't want to provide general help in how to talk to an IC over SPI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants