STM32VLdiscovery: LED funzelt nur traurig

OP #3447061
Lesenswert?

Hallo zusammen,
ich habe mir ein STM32VLdiscovery Eval-Board gekauft und gestern abend 
ausprobiert. Irgendwie bin ich von der Treiberleistung vom STM32F100RB 
total enttäuscht. Die LEDs funzeln nur trübe (will heißen: Ich habe erst 
nich gesehen, daß überhaupt etwas leuchtet bei Dauer-Ein) und bei einem 
ständigen Aus-Ein-Aus in der main-loop ergibt sich nur ein müder 
Dreieckverlauf mit VSS unter 1V am Oszi mit schlappen ca. 400kHz - und 
das bei einer Belastung nur mit einer LED und dem Tastkopf.

Die Pin-Initialisierung ist auf push-pull.

Ist das normal, daß die Pin-Ausgänge nicht in der Lage sind, die LEDs 
zum leuchten zu bringen und/oder ein solides Rechteck zu treiben, oder 
habe ich a) ein Montagsexemplar vom Eval-Board erwischt oder b) 
irgendetwas in der Initialisierung vergessen?

Viele Grüße
W.T.


Hier noch der Test-Code (ARM-GCC, CooCox-IDE):
1
#include "stm32f10x_conf.h"
2
#include "stm32f10x_rcc.h"
3
#include "stm32f10x_gpio.h"
4

5

6
int main(void)
7
{
8
  GPIO_InitTypeDef GPIO_InitStructure;
9

10
  SystemInit();
11

12
  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC,ENABLE);
13

14
  GPIO_InitStructure.GPIO_Speed = GPIO_Mode_Out_PP;
15
  GPIO_InitStructure.GPIO_Pin   = GPIO_Pin_9|GPIO_Pin_8;
16
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
17
  GPIO_Init(GPIOC, &GPIO_InitStructure);
18

19
  GPIO_WriteBit(GPIOC,GPIO_Pin_8,Bit_SET);
20
  while(1) {
21
    //GPIO_WriteBit(GPIOC,GPIO_Pin_9,Bit_SET);
22
    GPIO_SetBits(GPIOC,GPIO_Pin_9);
23
    GPIO_ResetBits(GPIOC,GPIO_Pin_9);
24
  }
25
}
#3447078
Lesenswert?

In dieser Quelle ist die Initialisierung der LED für ein anderes Board 
angegeben. Fehlt im Code die Zeile:
  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;


?
________________________________________________________

GPIO_InitStructure.GPIO_Speed = GPIO_Mode_Out_PP;
________________________________________________
Was heißt das,gehört hier nicht etwas anderes hin???????????_________

Quelle:
/**
  ************************************************************************ 
******
  * @file    stm32f429i_discovery.c
  * @author  MCD Application Team
  * @version V1.0.0
  * @date    20-September-2013
  * @brief   This file provides set of firmware functions to manage Leds 
and
  *          push-button available on STM32F429I-DISCO Kit from 
STMicroelectronics.
  ************************************************************************ 
******
  * @attention
  *
  * <h2><center>&copy; COPYRIGHT 2013 STMicroelectronics</center></h2>
  *
  * Licensed under MCD-ST Liberty SW License Agreement V2, (the 
"License");
  * You may not use this file except in compliance with the License.
  * You may obtain a copy of the License at:
  *
  *        http://www.st.com/software_license_agreement_liberty_v2



void STM_EVAL_LEDInit(Led_TypeDef Led)
{
  GPIO_InitTypeDef  GPIO_InitStructure;

  /* Enable the GPIO_LED Clock */
  RCC_AHB1PeriphClockCmd(GPIO_CLK[Led], ENABLE);

  /* Configure the GPIO_LED pin */
  GPIO_InitStructure.GPIO_Pin = GPIO_PIN[Led];
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
  GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  GPIO_Init(GPIO_PORT[Led], &GPIO_InitStructure);
}
Gast #3447089
Lesenswert?

Walter Tarpan schrieb:
> #include "stm32f10x_conf.h"
> #include "stm32f10x_rcc.h"
> #include "stm32f10x_gpio.h"
>
> int main(void)
> {
>   GPIO_InitTypeDef GPIO_InitStructure;
>
>   SystemInit();
>
>   RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC,ENABLE);
>
>   GPIO_InitStructure.GPIO_Speed = GPIO_Mode_Out_PP;
>   GPIO_InitStructure.GPIO_Pin   = GPIO_Pin_9|GPIO_Pin_8;
>   GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
>   GPIO_Init(GPIOC, &GPIO_InitStructure);
>
>   GPIO_WriteBit(GPIOC,GPIO_Pin_8,Bit_SET);
>   while(1) {
>     //GPIO_WriteBit(GPIOC,GPIO_Pin_9,Bit_SET);
>     GPIO_SetBits(GPIOC,GPIO_Pin_9);
>     GPIO_ResetBits(GPIOC,GPIO_Pin_9);
>   }
> }

versuchs mal mit
1
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren