Тёмный

88. STM32CubeIDE RFID RC522 Module with STM32F103C8T6 

MicroPeta by Nizar Mohideen
Подписаться 7 тыс.
Просмотров 4,5 тыс.
50% 1

Опубликовано:

 

28 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 52   
@mertoguzhan8814
@mertoguzhan8814 5 месяцев назад
Thank you so much such a helpful tutorial.
@soranfatah1033
@soranfatah1033 6 месяцев назад
Thanks nice project ...🎉🎉🎉
@NizarMohideen
@NizarMohideen 6 месяцев назад
Thanks to you
@devagyabudhiraja1150
@devagyabudhiraja1150 3 месяца назад
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??
@NizarMohideen
@NizarMohideen 3 месяца назад
Thanks for trying my codes. I hope you have figured out the reason Please make sure the rfid cards are good
@giuseppemazzocca9813
@giuseppemazzocca9813 3 месяца назад
i have the same problem, do you have find a solution?🙏
@devagyabudhiraja1150
@devagyabudhiraja1150 2 месяца назад
@@giuseppemazzocca9813 I had fixed the problem using HAL, I restructured the code and wrote it again in the main file and it started working!!
@devagyabudhiraja1150
@devagyabudhiraja1150 2 месяца назад
@@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-seojihye71
@user-seojihye71 2 месяца назад
​@@devagyabudhiraja1150 Thank you so much. Thanks to you, I was able to finish the work for a long time. Thank you so much
@jaiakash4416
@jaiakash4416 5 месяцев назад
It shows error reading variable how to fix? Please help
@lamiaemaghfoul1238
@lamiaemaghfoul1238 5 месяцев назад
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
@NizarMohideen
@NizarMohideen 5 месяцев назад
Not yet
@lamiaemaghfoul1238
@lamiaemaghfoul1238 5 месяцев назад
oh okay ,can you do it please i realy need this tutorial@@NizarMohideen
@truongtrongnhan8808
@truongtrongnhan8808 4 месяца назад
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.
@NizarMohideen
@NizarMohideen 4 месяца назад
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
@Hisham171
@Hisham171 5 месяцев назад
My status variable sometimes is 2 and sometimes is 1. It never be 0. How to fix this issue? I am using STM32F0.
@lamiaemaghfoul1238
@lamiaemaghfoul1238 5 месяцев назад
When I click on 'resume,' the values do not change. How can I solve this?
@NizarMohideen
@NizarMohideen 5 месяцев назад
In the debugger Enable live expressions (Tick)
@lamiaemaghfoul1238
@lamiaemaghfoul1238 5 месяцев назад
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
@lamiaemaghfoul1238
@lamiaemaghfoul1238 5 месяцев назад
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
@NizarMohideen
@NizarMohideen 5 месяцев назад
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
@lamiaemaghfoul1238
@lamiaemaghfoul1238 5 месяцев назад
"I don't understand your response. They still show as 147 32 0 0." @@NizarMohideen
@amizitu
@amizitu 5 месяцев назад
Would you please make a video to connect STM32 with a RFID Wiegand Reader. Or share some resource. Thanks.
@user-lr6gl9fq7j
@user-lr6gl9fq7j 5 месяцев назад
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?
@NizarMohideen
@NizarMohideen 5 месяцев назад
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
@_NguyenQuangTrung
@_NguyenQuangTrung 5 месяцев назад
why did we need to setting the clock from 8 to 72kHZ ? i dont understand why. Can someone explain for me
@NizarMohideen
@NizarMohideen 5 месяцев назад
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
@_NguyenQuangTrung
@_NguyenQuangTrung 5 месяцев назад
thanks to @@NizarMohideen, I appreciated about this
@jashanrai8190
@jashanrai8190 5 месяцев назад
Hello sir, I am currently getting "Target Not Available" when on the debug step, any part of the code or circuit I should check?
@NizarMohideen
@NizarMohideen 5 месяцев назад
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
@jashanrai8190
@jashanrai8190 4 месяца назад
@@NizarMohideen Thank you, I got that fixed, however I am getting value of 0 after resume when the pill is touched.
@hpw5897
@hpw5897 4 месяца назад
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-seojihye71
@user-seojihye71 3 месяца назад
I am using the Nucleo F103RB board. I'm having the same problem as you, can you tell me how to fix it?
@hpw5897
@hpw5897 3 месяца назад
@@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-seojihye71
@user-seojihye71 3 месяца назад
@@hpw5897 I see. Thank you for the information🥲
@benmahmoudramla9121
@benmahmoudramla9121 5 месяцев назад
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 ?
@NizarMohideen
@NizarMohideen 5 месяцев назад
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
@benmahmoudramla9121
@benmahmoudramla9121 5 месяцев назад
hey do you think it essential that i configure the reset of thr rfid even tho that im not gonna use it ?
@NizarMohideen
@NizarMohideen 5 месяцев назад
We have to use the reset pin.
@benmahmoudramla9121
@benmahmoudramla9121 5 месяцев назад
@@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 ?
@NizarMohideen
@NizarMohideen 5 месяцев назад
You can use the same code. It will read all rfid cards
@benmahmoudramla9121
@benmahmoudramla9121 5 месяцев назад
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;
@NizarMohideen
@NizarMohideen 5 месяцев назад
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
@benmahmoudramla9121
@benmahmoudramla9121 5 месяцев назад
@@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 ?
@NizarMohideen
@NizarMohideen 5 месяцев назад
Baud rate 6 will be ok
@benmahmoudramla9121
@benmahmoudramla9121 5 месяцев назад
@@NizarMohideen can i email you my project maybe you´ll have an idea about the problem?
Далее
RC522 module with STM32
29:12
Просмотров 11 тыс.
131. STM32CubeIDE Camera. OV7670 with STM32
14:49
Просмотров 1,1 тыс.
I forced EVERYONE to use Linux
22:59
Просмотров 472 тыс.
Solo Climbing Grossglockner in a Day
15:20
Просмотров 23 тыс.
Data Logger using STM32 || ESP8266 || Thingspeak
10:07
119. STM32CubeIDE Camera. OV7670 with STM32F407VET6
14:36