Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

STM32 PORT D pin 15 led problem

Status
Not open for further replies.

yefj

Advanced Member level 4
Joined
Sep 12, 2019
Messages
1,208
Helped
1
Reputation
2
Reaction score
3
Trophy points
38
Activity points
7,254
Hello,I am trying to turn on a LED for STM32F407 descovery which is PORT D pin 15 as shown in the diagram bellow and the link attached to it.
I am using keil an ST-link debuger setting as shown bellow.
My STM32 descovery is connected as shown in the photo bellow.
I have written a simple code by the registers table shown bellow to put VDD on PD15 ,but nothing happens when i flash the program.
Where did i go wrong?
Thanks.



Code:
#include "stm32f407xx.h"

int main()
{ //RCC_AHB1ENR_GPIODEN
    RCC->AHB1ENR|=(1uL<<3); //set third bit to enable AHB1 BUS
    GPIOD->MODER&=~(1uL<<31);//reset 0 on 31 01 to gpio_moder 31,30 bits in register 
    GPIOD->MODER|=(1uL<<30);//set 1 on 30 output mode for pin 15 port D
    
    GPIOD->OTYPER=0; //all register is push pull
    GPIOD->OSPEEDR=0;//speed low
    GPIOD->ODR|=(1<<15); //Sets pin 15 as high
    
    
}
1612295915993.png

1612295978355.png

1612297738791.png


1612298043816.png
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top