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.

[SOLVED] how i can create function LED on and delay function from scratch in STM32F407??

Status
Not open for further replies.

stackprogramer

Full Member level 3
Joined
Jul 22, 2015
Messages
181
Helped
0
Reputation
0
Reaction score
1
Trophy points
1,298
Activity points
2,668
hi,i had a micro stm32f407.
i in project pure keil i had below files:
Listings startup_stm32f40_41xxx.s stm32f407.uvproj system_stm32f4xx.h
Objects stm32f407.uvgui.root stm32f4xx.h
main.c stm32f407.uvopt system_stm32f4xx.c
my question is how i can start for create a function led on and off and delay function???:-|
i didn't used library for board-discovery stm or other board.

please guide me thanks
 

For switching GPIO you need only header file with registers definitions. Bacicaly, it is just a changing value or register.
For delay you can use simple cycle counter, timer or system timer systick. For that purpose you can download and use standart perephireal library from ST.
 
can you talk for example for port GPIOA is as input ,and is on:
witch value i should assigned to it? 1 or 0x01 or x02 or others??????
typedef struct
{
__IO uint32_t MODER; /*!< GPIO port mode register, Address offset: 0x00 */
__IO uint32_t OTYPER; /*!< GPIO port output type register, Address offset: 0x04 */
__IO uint32_t OSPEEDR; /*!< GPIO port output speed register, Address offset: 0x08 */
__IO uint32_t PUPDR; /*!< GPIO port pull-up/pull-down register, Address offset: 0x0C */
__IO uint32_t IDR; /*!< GPIO port input data register, Address offset: 0x10 */
__IO uint32_t ODR; /*!< GPIO port output data register, Address offset: 0x14 */
__IO uint16_t BSRRL; /*!< GPIO port bit set/reset low register, Address offset: 0x18 */
__IO uint16_t BSRRH; /*!< GPIO port bit set/reset high register, Address offset: 0x1A */
__IO uint32_t LCKR; /*!< GPIO port configuration lock register, Address offset: 0x1C */
__IO uint32_t AFR[2]; /*!< GPIO alternate function registers, Address offset: 0x20-0x24 */
} GPIO_TypeDef;
 

My advice is - if you are starting to learn Cortex uC - start from "bare metal". Leave those ridiculous HAL or SPL "libraries".

All you need is CMSIS
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top