AnsweredAssumed Answered

STM32F030R8T6 Help me to Start

Question asked by Ravi_கோ on Jul 1, 2015
Latest reply on Jul 9, 2015 by Ravi_கோ
Im a newbe to arm family
Im using coocox ide.
I create my 1st project compile n and downloaded to STM32F030-Discovery board.
The project compiled successfully and downloaded but nothing is happening on the board.
What Iam Trying is Just To Turn On The LED.
Below Is My Code Pls Guide Me What Iam Missing.

#include <stm32f0xx_gpio.h>
#include <stm32f0xx_rcc.h>

GPIO_InitTypeDef Gp; //Create GPIO struct

//Define LED pins
#define GreenLED_Pin GPIO_Pin_9
#define BlueLED_Pin GPIO_Pin_8
#define LED_GPIO GPIOC



int main(void)
{
          RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOC, ENABLE);


          Gp.GPIO_Pin = GreenLED_Pin; //My alteration
     
          Gp.GPIO_Mode = GPIO_Mode_OUT; //Set GPIO pins as output
          Gp.GPIO_OType = GPIO_OType_PP; //Ensure output is push-pull vs open drain
          Gp.GPIO_PuPd = GPIO_PuPd_NOPULL; //No internal pullup resistors required
          Gp.GPIO_Speed = GPIO_Speed_Level_1; //Set GPIO speed to lowest
          GPIO_Init(LED_GPIO, &Gp); //Assign struct to LED_GPIO


    while(1)
    {
                   GPIO_SetBits(LED_GPIO, GreenLED_Pin);
    }
}


Thank you

Attachments

Outcomes