Wow man I can't appreciate and thank you enough. You have excellent communication and teaching skills. I have been looking for this kind of tutorial but couldn't find any, they all just start complicated whereas you went from the basics and explained it really well. Now ARM/STM32 doesn't seem very difficult to me.
Few tutorials actually show how to write directly to registers which is what high performance embedded controllers need (to be fast and predictable). I don't want to abstract any more than this. Operations like the -> operator are poorly understood by most C programmers but are used extensively in header files. Thanks for showing how it's done. Great job. Do more.
A bigh thank you for these videos. These are the kind of videos I have been looking for. I'm gonna finish your series on STM32 during lockdown haha.. Keep it up :)
was looking for such a detail tutorial on STM32, after arduino there are no advance tutorial on such controllers if one want to learn. I am using stm32cubeide environment,works really well for me. I think I will be using hal for gpio and wont do it baremetal but still watching all videos in series so I can learn more. One of the main thing I want to learn is how to write I2c,SPI drivers for any device to interface it with stm32.
Sir i am running this code with your PLL clock code but it is not blinking the LED, LED is constantly turned ON. what is the possible issue? how can i share my code with you?
Thank you very much for this tutorial. Now I am able to program my STM32 with uVision Keil environment. Only one thing - it did not worked at first, because Boot jumper remains in positin '1', and it should be in position '0'. Out there are many people like me, who had no or little experience with this board.
hello sir, the link that you putted on the description for your personnal page is not working, do you have another one that's working ?!! thank you in advance
hi there i'm watching you'r videos and it's great ,nice work ......:p i just want to know you prefer to use CMSIS standard libraries that we can download it from st site or create our lib like what you have done i want to know you'r work experience . danke
This is for learning purposes for you to learn how to use the chip. If you just use libraries and never learn how to program the registers you will always just call functions to do everything and never know how to really use the chip. Once you learn you can use any library you want.
Hey Eddie, nice tutorials, do you have a link of this datasheet for the board, it seems like i can find only one for the mcu with 117 pages. Also, do you have any discord or any other way to interact with ppl and help us out when u are free?
Can u kindly help me in this- How the delay got triggered using just the for loop without using any delay function?.. is it something that goes on default? I see the for loop being statementwise at semicolon.. but I m dumb at it.. 🤔🙄
An interesting technique I discovered you 'can't' do on the an STM32, at least easily. Assign a bi-directional GPIO to an EXT interrupt controller. Yes you can make a GPIO an external interrupt and the exterior line can be pulled high/low and trigger the interrupt. What you can't then do is hold that GPIO low to signal something. Writing to BSRR, BRR, DRR has no effect. :( My timing is tight, so I don't think reconfiguring the port mode etc is viable. So I need 2 GPIOs.
Thank You @Eddie Amaya! These videos had really helped me to understand how the STM32F1 works. But my BluePill doesn't blink, it just stays on all the time! The final of the "Build Output" is: "[...] -> Error: Not a genuine ST Device! Abort connection. Erase Done. -> Programming Done.-> Verify OK. -> Application running ... Flash Load finished at XX:XX:XX".Can u give me some tips? I'm posting the hope!!! :(
Hi!, I wanted to do a question... What would be the beneffit of making your own driver instead of using HAL driver?, isn't HAL good enough?, thanks a lot! Nice video
Hal is very very bloated , in other words to do something simple like setting a pin high, you can write your own function and do it in like 4 lines. But HAL will do it in like 100 lines and call 5 different functions, because it uses so much abstraction. So your code size becomes A LOT bigger and wasting so much memory . Also when something goes wrong you don't know how to fix it because you did not write HAL . Also using HAL you don't learn anything about the chip , you just using someone else's code. Do what you feel is better for you. Personally my videos are for people who like to write their own code and really understand how to use the chip
@@EdwinFairchild nice! Im the kind of person that reads the whole datasheet to get to know the registers and use them aswell!, I will keep track on your videos, I am more used to PIC 8Bit MCUs, i will be learning stm32 from you! Thanks a lot for the great answer!
Yeah I never used stdPeriph by the time I got to Stm32 products it was already dead. ST does have the LL library which in my opinion is the way to go. Less bloated than cube HAL, in fact deep inside HAL it uses LL so it's definitely less bloat. I'll make a video on it soon
Hello Eddie, Great help with this tutorial! Have you ever considered choosing another IDE for your projects like AC6 SW4stm32 which can be combined with STM32 CubeX software to define automatically your peripheral firmware for you. What's actually your preference? Thanks I'm actually learning with SW4stm32 but still it seems that your typing by deference the structure of the periph are preatty handy on your IDE!
I have not heard of AC6 but i will look into it, i do use Cube Mx to get things done quickly , my purpose for writing the drivers myself is simply for learning purposes. Unfortunately Cube Mx is too good, in the sence that you can set up the clocks and peripheral and not know anything about how they work. SO by writing my own drivers i am forced to learn how the peripherals work. But yes for fast prototyping i use Cube Mx.. thanks i will look into this AC6
Keil is showing me a warning when I set " ~ " in CRH configuration bits (line 13 in your code), it says "main.c(8): warning: implicit conversion changes signedness: 'int' to 'unsigned int' [-Wsign-conversion]" any solution?
havent watched this yet but ive added it to my watch later. i can tell this is gonna be useful as F. and in case you're wondering - that F stands for FUN! ..nah actually it stands for fuck.
hey, where can I download the datasheet of stm32f103c8t6, wherever I search on the internet I get a 117-page datasheet and there is no information about pins in detail
Wouldn't have found it if not for your videos.... Please continue the great work and spreading the wealth of knowledge.... Especially the understanding of the Datasheet
all this code is done using data sheet, there is no STDPeriph and CubeMX in this its all register manipulation.. and you would do the same to read an input, just set the pin to input with or without pullups/pulldown and wire it up to a switch and read the state
stm32f103c8t6...well to understand the processor im started learning about processor and assembly language... but i got only failure...i dont want to quit. please sir guide me...
SO you want to use a GPIO pin as input to read when a button is pressed? Coded in C. correct? I can show you how to do that ... but not in assembly.. waste of time using assembly
The blink code did not work for me weirdly , I though the problem is with the board , but I tried a blink example on MikroC Pro for ARM and it worked. I am not using STLink for programming i just upload hex file to flash. could that be the problem?
No, did you follow the Keil setup that I did there is a check box about uploading to flash or something that should not be checked. Aside from that everything else is fine. Sometimes you need to restart the board right after an upload with Keil and St Link
@@EdwinFairchild Yeah I did all your instructions , but I do not use STLink for programming , I use the STMflash Loader, so i enabled creation of hex file and I upload it using the STMFlash Loader , but the led is only on all the time.
because volatile tells the compiler to not delete a variable that is not really used for anything, compiler tends to delete dead or useless code, so a loop that does nothing will be deleted
Fixed! Here's how: Click on menu bar ‘Project’ Options for Target, this will bring up ‘Options for Target’ window Click on ‘Debug’ tab In the debugger device selection, click on ‘Settings’, this will bring up ‘Cortex-M Target Driver Setup’ Click on ‘Flash Download’ tab In ‘Download Function’, select ‘Erase Full Chip’
Hi, Thanks for your great video :) , Is there any chance that you could send me this data sheet that you are using in this video ? I couldn't find it any where ! and I really need it:(.
Sara Golestani www.st.com/content/ccc/resource/technical/document/reference_manual/59/b9/ba/7f/11/af/43/d5/CD00171190.pdf/files/CD00171190.pdf/jcr:content/translations/en.CD00171190.pdf
yeah ive been meaning to keep making videos i am just always trying to learn other things that i dont make time to make videos, Ive been working on trying to learn ROS and Linux and Python... while also taking classes at school and Work and personal projects... need more hours in a day!!!
you probably need to download the st-link driver if you have not done that....or else it might be connections... plug in the st-link by itself and check your device manager in windows to see if it shows up
No that is just silly, it's just defines provided by the manufactures, but if you want to type hundreds of addresses by hand please do so and tell me how that works better than the header file ...and also don't forget to type the arm cortex core header files too. And when you move to big boy mcu not just the f1 let me know how typing 10000 addresses from scratch goes, then compare your file with STM file and you realize you wasted your time to arrive at the same thing. Be smartter than that. From scratch means no library is used. But please type it all from scratch for every microcontroller you ever use. Enjoy.
@@EdwinFairchild Of course you are right! It is a bunch of work, but if you want to know about every base addresses of every port and every offset address of every register, than it is better to do this work^^ Such as: temp = ( pGPIOHandle->GPIO_PinConfig.GPIO_PinMode GPIO_PinConfig.GPIO_PinNumber) ); pGPIOHandle->pGPIOx->MODER &= ~(0x3 GPIO_PinConfig.GPIO_PinNumber); pGPIOHandle->pGPIOx->MODER |= temp; and every preprocessor^^
Before someone else bangs their head angainst their desk for 30 minutes... If you got yourself a cheap Blue Pill board and want to use PB4 as input you not only need to set AFIOEN but also RESET bit 1 in CNF4. RCC->APB2ENR |= (RCC_APB2ENR_AFIOEN); // WHY? Alternate function I/O clock enable GPIOB->CRL &= ~(GPIO_CRL_MODE4); GPIOB->CRL &= ~(GPIO_CRL_CNF4_1); //CRL |= (GPIO_CRL_CNF4_0);
technically speaking pins are input by default so nothing needs to be done unless you want a pull up or pull down. AF is not needed, not sure why i did it here... and what was the head banging in reference to? I mean the intent of this video was to write an abstracted driver , hence the title, and not simply to set a single pin solely as input...
@@EdwinFairchild Nothing to do with your video :-) My guess is that everyone who buys an stm32f103 board sees PB3/4 and thinks they work just like every onther pin.
they start from IDE installation and even before that they start specifying which exact microcontroller and programmervis used, the tongue thing I dont know why, watch it on mute
Thanks I found your blog and now it is clear. Not a big prob.. If I mute it then I miss important explanations. I left a request for help on your blog. Please help if you can.
I would look at my timers video to better understand how to make a delay. The delay here is for testing purposes and you should make the variables volatile to not get optimized out by the compiler
c programming is unnecessary these days... i have already develop a new general purpose compiler which enables the programmer to use VB.NET to write code and program their devices...
Even that is unnecessary, companies like Tesla use matlab and other model based code generators, why leave code to error prone programmers. But I would take C over VB any day and I absolutely love VB.
Wow man I can't appreciate and thank you enough. You have excellent communication and teaching skills. I have been looking for this kind of tutorial but couldn't find any, they all just start complicated whereas you went from the basics and explained it really well. Now ARM/STM32 doesn't seem very difficult to me.
Few tutorials actually show how to write directly to registers which is what high performance embedded controllers need (to be fast and predictable). I don't want to abstract any more
than this. Operations like the -> operator are poorly understood by most C programmers but are used extensively in header files. Thanks for showing how it's done. Great job. Do more.
Those who don’t understand basic concepts like pointers and dereferencing may be ‘programmers’ but definitely not C-programmers.
A bigh thank you for these videos. These are the kind of videos I have been looking for. I'm gonna finish your series on STM32 during lockdown haha.. Keep it up :)
Thanks man
Have you finished
was looking for such a detail tutorial on STM32, after arduino there are no advance tutorial on such controllers if one want to learn. I am using stm32cubeide environment,works really well for me. I think I will be using hal for gpio and wont do it baremetal but still watching all videos in series so I can learn more. One of the main thing I want to learn is how to write I2c,SPI drivers for any device to interface it with stm32.
Thank you! Just found your videos now(thanks, youtube search) helps a lot, your way of explaining things is great
Wow , you save my life .. a very very very thanks you bro god bless you bro
Sir i am running this code with your PLL clock code but it is not blinking the LED, LED is constantly turned ON. what is the possible issue? how can i share my code with you?
In my BluePill is happening the same. :(
2:45 Why did you leave it as 0x00010000?
Thank you very much for this tutorial. Now I am able to program my STM32 with uVision Keil environment. Only one thing - it did not worked at first, because Boot jumper remains in positin '1', and it should be in position '0'. Out there are many people like me, who had no or little experience with this board.
you are welcome!
this video was very useful for me thanks!!!
glad it helped
hello sir, the link that you putted on the description for your personnal page is not working, do you have another one that's working ?!! thank you in advance
thank you soooo much. most tutorials either use a lot of libraries or start off mapping pins using GUI instead of code. again thanks
hi there i'm watching you'r videos and it's great ,nice work ......:p
i just want to know you prefer to use CMSIS standard libraries that we can download it from st site or create our lib like what you have done i want to know you'r work experience . danke
This is for learning purposes for you to learn how to use the chip. If you just use libraries and never learn how to program the registers you will always just call functions to do everything and never know how to really use the chip. Once you learn you can use any library you want.
@@EdwinFairchild yeah i agree 100%
Hey Eddie, nice tutorials, do you have a link of this datasheet for the board, it seems like i can find only one for the mcu with 117 pages. Also, do you have any discord or any other way to interact with ppl and help us out when u are free?
It's called a reference manual, datasheet is like you said a shorter document. Google "RM0008" that is the document you want
@@EdwinFairchild I also need it, thanks a lot.
Can u kindly help me in this-
How the delay got triggered using just the for loop without using any delay function?.. is it something that goes on default? I see the for loop being statementwise at semicolon.. but I m dumb at it.. 🤔🙄
An interesting technique I discovered you 'can't' do on the an STM32, at least easily. Assign a bi-directional GPIO to an EXT interrupt controller. Yes you can make a GPIO an external interrupt and the exterior line can be pulled high/low and trigger the interrupt. What you can't then do is hold that GPIO low to signal something. Writing to BSRR, BRR, DRR has no effect. :( My timing is tight, so I don't think reconfiguring the port mode etc is viable. So I need 2 GPIOs.
Did you have some written tutorial ? It seems the link is obsolete
EdwinFairchild.com but not for these videos
Thank You @Eddie Amaya! These videos had really helped me to understand how the STM32F1 works. But my BluePill doesn't blink, it just stays on all the time! The final of the "Build Output" is: "[...] -> Error: Not a genuine ST Device! Abort connection.
Erase Done. -> Programming Done.-> Verify OK. -> Application running ... Flash Load finished at XX:XX:XX".Can u give me some tips? I'm posting the hope!!! :(
Are you using STM32 or GD32, or even CKS32?
Hello Eddie, can you provide a tutorial to configure inbulit comparator of stm32f3 discovery board?
Hi!, I wanted to do a question... What would be the beneffit of making your own driver instead of using HAL driver?, isn't HAL good enough?, thanks a lot! Nice video
Hal is very very bloated , in other words to do something simple like setting a pin high, you can write your own function and do it in like 4 lines. But HAL will do it in like 100 lines and call 5 different functions, because it uses so much abstraction. So your code size becomes A LOT bigger and wasting so much memory . Also when something goes wrong you don't know how to fix it because you did not write HAL . Also using HAL you don't learn anything about the chip , you just using someone else's code. Do what you feel is better for you. Personally my videos are for people who like to write their own code and really understand how to use the chip
@@EdwinFairchild nice! Im the kind of person that reads the whole datasheet to get to know the registers and use them aswell!, I will keep track on your videos, I am more used to PIC 8Bit MCUs, i will be learning stm32 from you! Thanks a lot for the great answer!
Hi Eddie, can you please explain why you used (1
Did you understand why I used those numbers?
i have RCC->APB2ENR |= (1
Unfortunately, the STDPeriph library is dead.The STMicroelectronics hasn`t produced any upgrade of this library for some years.
Yeah I never used stdPeriph by the time I got to Stm32 products it was already dead. ST does have the LL library which in my opinion is the way to go. Less bloated than cube HAL, in fact deep inside HAL it uses LL so it's definitely less bloat. I'll make a video on it soon
Hello Eddie, Great help with this tutorial!
Have you ever considered choosing another IDE for your projects like AC6 SW4stm32 which can be combined with STM32 CubeX software to define automatically your peripheral firmware for you. What's actually your preference? Thanks
I'm actually learning with SW4stm32 but still it seems that your typing by deference the structure of the periph are preatty handy on your IDE!
I have not heard of AC6 but i will look into it, i do use Cube Mx to get things done quickly , my purpose for writing the drivers myself is simply for learning purposes. Unfortunately Cube Mx is too good, in the sence that you can set up the clocks and peripheral and not know anything about how they work. SO by writing my own drivers i am forced to learn how the peripherals work. But yes for fast prototyping i use Cube Mx.. thanks i will look into this AC6
I was looking for a real bro that tells it in English
Here is the real bro...
hello eddie thank you man. but is there any possiblity that you can upload high res vids?
This is 720p . And recorded a while ago. I am not going to remake anything anytime soon sorry.
If it doesn't work for someone - use volatile for your delay variable since compiler dislikes silly delays as well
Thanks
thanks
Keil is showing me a warning when I set " ~ " in CRH configuration bits (line 13 in your code), it says "main.c(8): warning: implicit conversion changes signedness: 'int' to 'unsigned int' [-Wsign-conversion]"
any solution?
Yeah it's just a warning, either way it's an unsigned int , set it as you please
We have already wrote set for pin 13 to be high why to write reset and make it low?
Thank You, I was searching this
Can you make video how to do same stuff with EmBitz? What is best and free for stm32F development anyway?
Hi! If I set MCU in the input mode, how can I do to set it in the pull up mode? Thanks.
Simply set the pin high like if it was a regular output
havent watched this yet but ive added it to my watch later. i can tell this is gonna be useful as F. and in case you're wondering - that F stands for FUN! ..nah actually it stands for fuck.
hey, where can I download the datasheet of stm32f103c8t6, wherever I search on the internet I get a 117-page datasheet and there is no information about pins in detail
It's called "reference manual" so Google stm32f103 RM0008
@@EdwinFairchild ohh thanks, just got that
😇
Thank you, very useful. Hello from Russia
i did not get ok option in manage run time environment?
help me
// GPIOC->BSRR |= GPIOC->ODR & (0b1
Wouldn't have found it if not for your videos.... Please continue the great work and spreading the wealth of knowledge.... Especially the understanding of the Datasheet
you want an even faster toggle , use the bit banding region... ive done tests on an oscilloscope...its almost 1MHz faster
Thank you very much , by the way for loop 5000000, is it millisecond ? or what
No, I have another video on delays and timeers
hello sir can we do the programming for reading switch input without using drivers code..like normal coding by refering refernce sheet
all this code is done using data sheet, there is no STDPeriph and CubeMX in this its all register manipulation.. and you would do the same to read an input, just set the pin to input with or without pullups/pulldown and wire it up to a switch and read the state
i am trying sir but failing all the time.. can we see the simulation of progrm like 8051in kiel...
please guide///
what microcontroller are you using?
stm32f103c8t6...well to understand the processor im started learning about processor and assembly language... but i got only failure...i dont want to quit. please sir guide me...
SO you want to use a GPIO pin as input to read when a button is pressed? Coded in C. correct? I can show you how to do that ... but not in assembly.. waste of time using assembly
The blink code did not work for me weirdly , I though the problem is with the board , but I tried a blink example on MikroC Pro for ARM and it worked. I am not using STLink for programming i just upload hex file to flash. could that be the problem?
No, did you follow the Keil setup that I did there is a check box about uploading to flash or something that should not be checked. Aside from that everything else is fine. Sometimes you need to restart the board right after an upload with Keil and St Link
@@EdwinFairchild Yeah I did all your instructions , but I do not use STLink for programming , I use the STMflash Loader, so i enabled creation of hex file and I upload it using the STMFlash Loader , but the led is only on all the time.
@@omaressam7610 show me your code
eddie@edwinfairchild.com
@@omaressam7610 better yet post it on github
@@EdwinFairchild same code you wrote sir , copy and paste 😄 , I dont know what is wrong.
GPIO is explained in an amazing manner...However, in stm32 the led did not blink after flash load finished
Did you try and reset after uploading
Why don't you do any clock initialization for the processor itself
i have other videos on that on my channel , this is GPIO specific. cant do it all in one video
does anyone know why led is blinking only when i use volatile int in for loop ,it wont blink just ON if volatile not used ??
because volatile tells the compiler to not delete a variable that is not really used for anything, compiler tends to delete dead or useless code, so a loop that does nothing will be deleted
@@EdwinFairchild Oh ok got it and thanks a lot for the vedios
+Eddie Amaya Hi, I got Flash Download failed - "Cortex-M3" error
Josh3292 the part where you go into settings of the programmer, uncheck the “download to flash” option that I previously said to check
Fixed!
Here's how:
Click on menu bar ‘Project’
Options for Target, this will bring up ‘Options for Target’ window
Click on ‘Debug’ tab
In the debugger device selection, click on ‘Settings’, this will bring up ‘Cortex-M Target Driver Setup’
Click on ‘Flash Download’ tab
In ‘Download Function’, select ‘Erase Full Chip’
Josh3292 glad you fixed it
Hi, Thanks for your great video :) , Is there any chance that you could send me this data sheet that you are using in this video ? I couldn't find it any where ! and I really need it:(.
Sara Golestani www.st.com/content/ccc/resource/technical/document/reference_manual/59/b9/ba/7f/11/af/43/d5/CD00171190.pdf/files/CD00171190.pdf/jcr:content/translations/en.CD00171190.pdf
I'm really thankful for your fast responding to my request. :)
Hi sir gd morning... I'm starting my career in embedded systems.. plz help me... Sir
Thanks a lot for this wonderful explainaton.
you're welcome
can you spread a light on communication protocol like i2c and usart and it's use in iot .
does circular buffer is used to send message .
yeah ive been meaning to keep making videos i am just always trying to learn other things that i dont make time to make videos, Ive been working on trying to learn ROS and Linux and Python... while also taking classes at school and Work and personal projects... need more hours in a day!!!
waw
Thanks bro, Can you give me the above pdf file?
www.edwinfairchild.com/2020/03/stm32-documents-every-programmer-needs.html
after downloading it is showing no ST link detected.what to do?
you probably need to download the st-link driver if you have not done that....or else it might be connections... plug in the st-link by itself and check your device manager in windows to see if it shows up
Very good, thank you!
You are using a before defined header file "stm32f10x.h"... What's there "from scratch"?
typedef struct {
__vo uint32_t MODER; // 8.4.1 GPIO port mode register (GPIOx_MODER) Address offset: 0x00
__vo uint32_t OTYPER; // 8.4.2 GPIO port output type register (GPIOx_OTYPER) Address offset: 0x04
__vo uint32_t OSPEEDR; // 8.4.3 GPIO port output speed register (GPIOx_OSPEEDR) Address offset: 0x08
__vo uint32_t PUPDR; // 8.4.4 GPIO port pull-up/pull-down register (GPIOx_PUPDR) Address offset: 0x0C
__vo uint32_t IDR; // 8.4.5 GPIO port input data register (GPIOx_IDR) Address offset: 0x10
__vo uint32_t ODR; // 8.4.6 GPIO port output data register (GPIOx_ODR) Address offset: 0x14
__vo uint32_t BSRR; // 8.4.7 GPIO port bit set/reset register (GPIOx_BSRR) Address offset: 0x18
__vo uint32_t LCKR; // 8.4.8 GPIO port configuration lock register (GPIOx_LCKR) Address offset: 0x1C
__vo uint32_t AFR[2]; // 8.4.9 GPIO alternate function low/high register (GPIOx_AFRL/AFRH) Address offset: 0x20/0x24
} GPIO_RegDef_t;
to write own typedef struct's is from scratch...^^
No that is just silly, it's just defines provided by the manufactures, but if you want to type hundreds of addresses by hand please do so and tell me how that works better than the header file ...and also don't forget to type the arm cortex core header files too. And when you move to big boy mcu not just the f1 let me know how typing 10000 addresses from scratch goes, then compare your file with STM file and you realize you wasted your time to arrive at the same thing. Be smartter than that. From scratch means no library is used. But please type it all from scratch for every microcontroller you ever use. Enjoy.
And don't forget to write your own _vo and uint32 because those are also predefine , where's the from scratch 🤣
@@EdwinFairchild #define _vo volatile^^
@@EdwinFairchild Of course you are right! It is a bunch of work, but if you want to know about every base addresses of every port and every offset address of every register, than it is better to do this work^^ Such as:
temp = ( pGPIOHandle->GPIO_PinConfig.GPIO_PinMode GPIO_PinConfig.GPIO_PinNumber) );
pGPIOHandle->pGPIOx->MODER &= ~(0x3 GPIO_PinConfig.GPIO_PinNumber);
pGPIOHandle->pGPIOx->MODER |= temp;
and every preprocessor^^
@@EdwinFairchild Anyway, I will download you whole playlist and I want to learn with you, thank you so much for your work :)
u didnt have noticed but you have written scartch in the title not scratch
😅
thanks I love it
Before someone else bangs their head angainst their desk for 30 minutes... If you got yourself a cheap Blue Pill board and want to use PB4 as input you not only need to set AFIOEN but also RESET bit 1 in CNF4.
RCC->APB2ENR |= (RCC_APB2ENR_AFIOEN); // WHY? Alternate function I/O clock enable
GPIOB->CRL &= ~(GPIO_CRL_MODE4);
GPIOB->CRL &= ~(GPIO_CRL_CNF4_1); //CRL |= (GPIO_CRL_CNF4_0);
technically speaking pins are input by default so nothing needs to be done unless you want a pull up or pull down. AF is not needed, not sure why i did it here... and what was the head banging in reference to? I mean the intent of this video was to write an abstracted driver , hence the title, and not simply to set a single pin solely as input...
@@EdwinFairchild Nothing to do with your video :-) My guess is that everyone who buys an stm32f103 board sees PB3/4 and thinks they work just like every onther pin.
Thankyou💪🏽
💪💪🏻💪🏼💪🏽💪🏾💪🏿
*Why do you keep clicking your tongue? Where do your tutorials start . this is number one and is already in the pond*
they start from IDE installation and even before that they start specifying which exact microcontroller and programmervis used, the tongue thing I dont know why, watch it on mute
Thanks I found your blog and now it is clear.
Not a big prob.. If I mute it then I miss important explanations.
I left a request for help on your blog. Please help if you can.
This code is not working, not blinking only high standing. I think delay logic is not working anymore.
I would look at my timers video to better understand how to make a delay. The delay here is for testing purposes and you should make the variables volatile to not get optimized out by the compiler
@@EdwinFairchild Thanks for your reply
THANK MAN
Oh, and the focus could be better.
Ken Wallace yeah I needed to zoom in more to make the text more accessible
at least a sendible intro ... to someone who does not want java like abstractions what are in the stdlib
56/5000
You can send me the document you are using or link download . Thanks
Google STM32F1 reference manual or www.edwinfairchild.com/2020/03/stm32-documents-every-programmer-needs.html?m=1
c programming is unnecessary these days... i have already develop a new general purpose compiler which enables the programmer to use VB.NET to write code and program their devices...
Even that is unnecessary, companies like Tesla use matlab and other model based code generators, why leave code to error prone programmers. But I would take C over VB any day and I absolutely love VB.