010 - STM32F1 GPIO OUTPUT SETUP AND LED BLINK

preview_player
Показать описание
The objective of the video is blinking the integrated green LED of the Blue Pill, the steps to for the blinking is as bellow:

1- Have a look into the Board
2- Take a look to the schematics
3- Check the Clock Control Block diagram into the Data sheet
4- Take a look to the Reference manual RCC / GPIO
5- Set up the project
6- Set up the testing envirement
8- Add the easy library
9- start Main
10- Set as low (Check into the debug mode) - Check the Board
11- Set as high (Check into the debug mode) - Check the Board
12- Create the Wait function (Check into the debug mode) - Check the Board

link for the code:

Link for the board:
Link for the debugger:
Рекомендации по теме
Комментарии
Автор

You are just amazing, I learned a lot regarding how to efficiently use User Manuals, Reference Manuals, and Datasheet.

shrijithmjain
Автор

I am a begginer. When I download Keil C, it doesn't have Xtal(Mhz), and ARM compiler version 6 cannot blink led on pin 13. Can you help me for this problem

kythuatphanmem
Автор

Like many here my LED was not blinking. After a couple of days of trying code. I discovered my issue was that in the Debugger on the C/C++ tab, Optimisation was set at O01. Setting Optimisation to O00 worked for me. I still do not know how WeeW arrived at 0x2000 to blink the LED though.

Broxie
Автор

Thanks for the tutorial, explained a lot and really good for begginer!

ciapekg
Автор

God bless you, you are the best, i've never seen any explanation like this before, really u are the best

habibhabibov
Автор

I learned a lot from your video, thank you so much!

zacharyt
Автор

Can anyone explain me the 7th line of the code and why it is used, and how it is removing 4

sayandasgoswami
Автор

Superb Tutorial! It is actually a very effective way of programming!

vigneshwaransaminathan
Автор

Hi thanks for the tutorials, I have question. I am using STM32F103 but C6T6 no C8. I don't see differeces in specifications like timer RC only for the memory and more ports. Should i be aware of something more while taking this tutorial on this board?

shortpapamemes
Автор

very good video! congrats! modifying script with void(volatile int a) worked for me! ..blink.blink!👍🏼

eddw
Автор

Could you tell me please how can i understand that GPIOC->IDR |=0x2000; it’s a pin number 13.

masumchina
Автор

Hi, I have reinstalled the Keil uV5.
Now I am facing following issue.
1. When I type 'RCC->', the rest of the options like 'list' is not appearing. I need to type entire register like RCC->APB2ENR. Could you please tell what has to be updated to get that option and how.
Note : I have included "stm32f10x.h" .

SiddanagowdaBiradar
Автор

Very good tutorial, question: why do we need to reset pin before setting it? takes another cycle. why? thanks

aleXelaMec
Автор

if delay is not working for you (I had this issue, the led was not blinking ) declare de "i" variable as " volatile int i;" i dont know why it did not work just as "int i". If you know, maybe you can tell me why lol. Or modify the optimization for target, instead of O1 use O0

josuemanuelparejacontreras
Автор

I am getting error like this
No Algorithm found for: 00008000H - 00008403H
Erase skipped!
Error: Flash Download failed - "Cortex-M3"
Flash Load finished at 20:32:09

HabibUrRahman-muzf
Автор

Hello, thanks first for the videos. However, I have a problem, I can't get into the while(1) loop and the for loop as well are not working. How can I solve this issue? I have tried to reduce the optimization level, but it doesn't help.

gastonkitambala
Автор

I have written same code. Green LED is always on. But dont getting why green LED is not blinking. I am using STM32F103C8T6 blue pill and trying to flash using USB to TTL

SiddanagowdaBiradar
Автор

HOW CAN I APPLY BLINK WITH OTHER PINS FOR EXAMPLE WITH A3 ?

dogukanbicer
Автор

So if the register odr get High then green led on Pin 13 turn off ?

hiegnouvdz
Автор

Hi, instead of negation, I have used xor gate to toggle. Still the green LED is not blinking. It is always ON. Is delay not suffice ? or something else ?

Please find the code below :

#include "stm32f10x.h" // Device header

void delay(void);
int main(void)
{
RCC->APB2ENR |= 0x10; // Enable clock for Port C

GPIOC->CRH &=
GPIOC->CRH |= // Port C 13 is enabled as output with frequency 2 MHz
GPIOC->ODR = (1<<13);
while(1)
{
GPIOC->ODR ^= (1<<13); // Writing '1' to Port C-13. hence, the green LED will be off
delay();

}
}

void delay(void)
{
int i, j;

{
for(j=0;j<1000;j++)
{

}
}
}

SiddanagowdaBiradar