Thanks, very concise and precessional! Only, spent 1 hour, figuring out the problem and it started to work only @500 kHz SPI :(, looks like sdi line load at RC522 side is not strong enough.
@soranfatah10339 ай бұрын
Thanks nice project ...🎉🎉🎉
@NizarMohideen9 ай бұрын
Thanks to you
@lamiaemaghfoul12389 ай бұрын
When I click on 'resume,' the values do not change. How can I solve this?
@NizarMohideen9 ай бұрын
In the debugger Enable live expressions (Tick)
@lamiaemaghfoul12389 ай бұрын
Yeah, I've already fixed it, but the value still shows as 147 32 0 0. I don't know what the problem is because the values were appearing yesterday, but today, nothing. Even when I change the RFID, it's still the same problem @@NizarMohideen
@lamiaemaghfoul12389 ай бұрын
Could I have your email or something similar to send you a screenshot? Maybe you could help me identify the problem. It's really important for my project. Would you be able to do me this favor, please
@NizarMohideen9 ай бұрын
If your project progressed this much far, you are very close to the completion. check the status variable in the live expression and make sure you are getting 0. // Success or error code is returned when communication #define MI_OK 0 #define MI_NOTAGERR 1 #define MI_ERR 2
@lamiaemaghfoul12389 ай бұрын
"I don't understand your response. They still show as 147 32 0 0." @@NizarMohideen
@josuegarcia402814 күн бұрын
If I am using an STM32 F303k8, do I have ti change anything from the code? What specifically. I tried changing the 32f1 values to my SPI and SS values but it didnt work. Thanks!
@lamiaemaghfoul12389 ай бұрын
I am working on a project for an airport with STM32 Nucleo. I have created many systems, each in a separate file, but I don't know how to make them work simultaneously. It is the last step, but I don't know how to do that. Have you already done that in your channel
@NizarMohideen9 ай бұрын
Not yet
@lamiaemaghfoul12389 ай бұрын
oh okay ,can you do it please i realy need this tutorial@@NizarMohideen
@amizitu9 ай бұрын
Would you please make a video to connect STM32 with a RFID Wiegand Reader. Or share some resource. Thanks.
@jaiakash44168 ай бұрын
It shows error reading variable how to fix? Please help
@devagyabudhiraja11507 ай бұрын
Hello! I am using STM32F303VCT6 discovery board, I want to use the RFID sensor and on following your steps and since I am using the STM32f3 version, on changing the include files and fixing up some minor errors when I run it, on Live Expressions I cant see the sNum string I can only see the first two that are fixed (147, 32) but the rest 3 numbers are 0 and are not updating when I bring another card? Could you help me what I can do to make this work??
@NizarMohideen7 ай бұрын
Thanks for trying my codes. I hope you have figured out the reason Please make sure the rfid cards are good
@giuseppemazzocca98137 ай бұрын
i have the same problem, do you have find a solution?🙏
@devagyabudhiraja11506 ай бұрын
@@giuseppemazzocca9813 I had fixed the problem using HAL, I restructured the code and wrote it again in the main file and it started working!!
@devagyabudhiraja11506 ай бұрын
@@user-seojihye71 The way I am doing it is that the main function enters in a while loop where it continually checks for the presence of an RFID card using the MFRC522_Request function. When a card is detected, it reads the card's UID using the MFRC522_Anticoll function and compares it with a pre-stored UID. If the UID matches, an LED connected to GPIO that I included as pin PA8 is turned on; otherwise, the LED is turned off. The LED connected to GPIO pin PC13 toggles state to provide feedback each time a card is detected. If no card is detected within a specified period, I am setting it to reset after a second or two. Make sure that you don't change anything in the h and c file that was provided in the video but on changing the main file like above it started working!
@user-seojihye716 ай бұрын
@@devagyabudhiraja1150 Thank you so much. Thanks to you, I was able to finish the work for a long time. Thank you so much
@truongtrongnhan88088 ай бұрын
Hello sir, I have a problem that need your help. The library is great but it i found that the first and the second of str[] is not fixed. My first and second of str[] is 0x70 and 0xB1 (this is the correct code), but sometime it shows 0x93 and 0x20, and then repeat with 0x70 and 0xB1 then repeat 0x93 and 0x20. I saw that your video have met the same error with me. Did you fix that or can you help me fix the bug. Btw, thanks for your tutorial and wish you all the best.
@NizarMohideen8 ай бұрын
Thanks for trying my setups and codes and making it work. As for the first two values 0x93 and 0x20, they are showing up even if no cards are present. Of course, it is a bug. I am also looking for the fix I think we can get away with this for simple projects, avoiding (147) 0x93 and (32) 0x20
@Hisham1719 ай бұрын
My status variable sometimes is 2 and sometimes is 1. It never be 0. How to fix this issue? I am using STM32F0.
@Akash-m2c9 ай бұрын
In clock configuration, you have set the prescaler as 2. Does it work on other prescaler? If so, should I need to make any changes in the .c and .h files?
@NizarMohideen9 ай бұрын
If you have different clock speed, you can change the prescaler in SPI but the baud rate should be around 9MBit. No need to change .c and .h files
@jashanrai81908 ай бұрын
Hello sir, I am currently getting "Target Not Available" when on the debug step, any part of the code or circuit I should check?
@NizarMohideen8 ай бұрын
This only works with global variables, i.e. declared outside of main() community.st.com/t5/stm32cubeide-mcus/getting-quot-error-target-not-available-quot-in-value-column-in/td-p/170240
@jashanrai81908 ай бұрын
@@NizarMohideen Thank you, I got that fixed, however I am getting value of 0 after resume when the pill is touched.
@benmahmoudramla91219 ай бұрын
hello , im working on stm32MP157f-K2 and i need the rfid reader library but im not sure that the library you have provided in the video would work in my project ? any help please ?
@NizarMohideen9 ай бұрын
It should work I tested this library with STM32F446RE Nucleo and STM32F411CE also, it worked! All I had to change was to edit rc522.h line1 #include "stm32f1xx_hal.h" to #include "stm32f4xx_hal.h" Lines 10-15 (According to pins settings) #define HSPI_INSTANCE &hspi1 #define MFRC522_CS_PORT GPIOA #define MFRC522_CS_PIN GPIO_PIN_4 #define MFRC522_RST_PORT GPIOB #define MFRC522_RST_PIN GPIO_PIN_0 Clock configurations does not effect but I had to set the Prescalor in SPI so that the baud rate is around 9MBit Wish you all the best
@benmahmoudramla91219 ай бұрын
hey do you think it essential that i configure the reset of thr rfid even tho that im not gonna use it ?
@NizarMohideen9 ай бұрын
We have to use the reset pin.
@benmahmoudramla91219 ай бұрын
@@NizarMohideen hey i want to know what i need to change in the main code if i want him to read any rfid card not specific ones ?
@NizarMohideen9 ай бұрын
You can use the same code. It will read all rfid cards
@hpw58977 ай бұрын
Hello,I face the problem (status only display 2/sNum display 147 32 0 0) ,may I know u how to fix this problem? I use stm32f103vet6 and follow the video coding, but I use mini-rc522,is code not suitable for mini-one? The project is stuck here,hope for help
@user-seojihye717 ай бұрын
I am using the Nucleo F103RB board. I'm having the same problem as you, can you tell me how to fix it?
@hpw58977 ай бұрын
@@user-seojihye71i didn’t fix this problem as well,even i change the code and use normal rc522😢 I think problem is come from board type is not compatible
@user-seojihye717 ай бұрын
@@hpw5897 I see. Thank you for the information🥲
@alniju129 күн бұрын
That is strange, I had the same problem - made lower SPI speed then played with clock phase and polarity. It started to work. Then I returned all the parameters back - set the parameters that didn't work initialy, and it works now. I think it could be QUBE glitch, who knows...
@alniju129 күн бұрын
It works for mini-rc522, just got it working. Your problem could be with cube ide. Try to play with spi clock phase and polarity, try to lower spi speed, mine started to work only at 500 khz, which is fully sufficient.
@_NguyenQuangTrung9 ай бұрын
why did we need to setting the clock from 8 to 72kHZ ? i dont understand why. Can someone explain for me
@NizarMohideen9 ай бұрын
You can keep 8MHz. It will be fine 72MHz is better because it is faster If you keep at 8MHz, you need to change the prescaler in SPI for the baud rate to be around 9MBit
@_NguyenQuangTrung9 ай бұрын
thanks to @@NizarMohideen, I appreciated about this
@benmahmoudramla91219 ай бұрын
this is the clock config of my stm32mp157f-k2 what do nu think should i change to make it work ? void SystemClock_Config(void) { RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; /** Initializes the RCC Oscillators according to the specified parameters * in the RCC_OscInitTypeDef structure. */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_CSI|RCC_OSCILLATORTYPE_LSI |RCC_OSCILLATORTYPE_HSE; RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.LSIState = RCC_LSI_ON; RCC_OscInitStruct.CSIState = RCC_CSI_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; RCC_OscInitStruct.PLL2.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL2.PLLSource = RCC_PLL12SOURCE_HSE; RCC_OscInitStruct.PLL2.PLLM = 1; RCC_OscInitStruct.PLL2.PLLN = 50; RCC_OscInitStruct.PLL2.PLLP = 2; RCC_OscInitStruct.PLL2.PLLQ = 1; RCC_OscInitStruct.PLL2.PLLR = 1; RCC_OscInitStruct.PLL2.PLLFRACV = 0; RCC_OscInitStruct.PLL2.PLLMODE = RCC_PLL_INTEGER; RCC_OscInitStruct.PLL3.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL3.PLLSource = RCC_PLL3SOURCE_HSE; RCC_OscInitStruct.PLL3.PLLM = 1; RCC_OscInitStruct.PLL3.PLLN = 61; RCC_OscInitStruct.PLL3.PLLP = 27; RCC_OscInitStruct.PLL3.PLLQ = 17; RCC_OscInitStruct.PLL3.PLLR = 37; RCC_OscInitStruct.PLL3.PLLRGE = RCC_PLL3IFRANGE_1; RCC_OscInitStruct.PLL3.PLLFRACV = 6660; RCC_OscInitStruct.PLL3.PLLMODE = RCC_PLL_FRACTIONAL; RCC_OscInitStruct.PLL4.PLLState = RCC_PLL_NONE; if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { Error_Handler(); } /** RCC Clock Config */ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_ACLK |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2 |RCC_CLOCKTYPE_PCLK3|RCC_CLOCKTYPE_PCLK4 |RCC_CLOCKTYPE_PCLK5; RCC_ClkInitStruct.AXISSInit.AXI_Clock = RCC_AXISSOURCE_PLL2; RCC_ClkInitStruct.AXISSInit.AXI_Div = RCC_AXI_DIV1; RCC_ClkInitStruct.MCUInit.MCU_Clock = RCC_MCUSSOURCE_PLL3; RCC_ClkInitStruct.MCUInit.MCU_Div = RCC_MCU_DIV1; RCC_ClkInitStruct.APB4_Div = RCC_APB4_DIV2; RCC_ClkInitStruct.APB5_Div = RCC_APB5_DIV4; RCC_ClkInitStruct.APB1_Div = RCC_APB1_DIV2; RCC_ClkInitStruct.APB2_Div = RCC_APB2_DIV2; RCC_ClkInitStruct.APB3_Div = RCC_APB3_DIV2;
@NizarMohideen9 ай бұрын
If this code is generated by CubeIDE GUI, keep as it is. No need to change But You need to change the SPI Prescalor in GUI and see the the baud rate. When the baud rate in is around 9MBit, keep that corresponding Prescalor
@benmahmoudramla91219 ай бұрын
@@NizarMohideenwhat are the factors that involves baud rate cause in my case in the mx either i get 6 or 13 as baud rates ( prescalor either 8 or 16) how can i put to 9 ?
@NizarMohideen9 ай бұрын
Baud rate 6 will be ok
@benmahmoudramla91218 ай бұрын
@@NizarMohideen can i email you my project maybe you´ll have an idea about the problem?