STM32F030F4 Quarz Pins

OP #4943058
Lesenswert?

Halli Hallo,

habe folgendes Problem, wo ich aktuell vor einer verschlossenen Tür 
stehe.
Es geht um die Pins PF0 / 1.

Dort habe ich jeweils eine LED dran (alles richtig verdrahtet, leuchten 
tut sie auch!).

Nun steht im Datenblatt das nach einem Reset diese Pins als ganz normale 
GPIO´s verwendet werden können.
Andere Funktionen bzw. andere Pins funktionieren ja. Nur eben diese 
beiden nicht.
Muss ich doch noch was anderes Konfigurieren?

Vielen dank im voraus.
OP #4943136
Lesenswert?

Hallo,

ich hoffe doch das ich das gemacht habe und nichts vergessen habe...
1
int main(void)
2
{
3
    SystemInit();
4

5
    SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK);
6
    SysTick_Config(SystemCoreClock / 100000);
7

8
    Outputs_Init();
9

10
    lcd_init(LCD_DISP_ON_CURSOR_BLINK);
11

12
    lcd_clrscr();
13
    lcd_gotoxy(0,0);
14
    lcd_puts("     STM32x     ");
15

16
    RELAIS_K1_SET;
17

18
  while(1)
19
  {
20
        RELAIS_K1_SET;
21
        _delay(10e3);
22
        RELAIS_K2_SET;
23
        _delay(10e3);
24
        RELAIS_K3_SET;
25
        _delay(10e3);
26
        LED_WHITE_SET;
27
        _delay(10e3);
28

29
        RELAIS_K1_UNSET;
30
        _delay(10e3);
31
        RELAIS_K2_UNSET;
32
        _delay(10e3);
33
        RELAIS_K3_UNSET;
34
        _delay(10e3);
35
        LED_WHITE_UNSET;
36
        _delay(10e3);
37
  }
38
}
39

40
void Outputs_Init(void)
41
{
42
    GPIO_InitTypeDef GPIOx;
43

44
    RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA,ENABLE);
45
    RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB,ENABLE);
46
    RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOF,ENABLE);
47

48
    GPIOx.GPIO_Mode     = GPIO_Mode_OUT;
49
    GPIOx.GPIO_OType    = GPIO_OType_PP;
50
    GPIOx.GPIO_Pin      = (GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 |    GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7);
51
    GPIOx.GPIO_PuPd     = GPIO_PuPd_NOPULL;
52
    GPIOx.GPIO_Speed    = GPIO_Speed_2MHz;
53
    GPIO_Init(GPIOA, &GPIOx);
54

55
    GPIOx.GPIO_Mode     = GPIO_Mode_IN;
56
    GPIOx.GPIO_Pin      = (GPIO_Pin_13 | GPIO_Pin_14);
57
    GPIOx.GPIO_PuPd     = GPIO_PuPd_UP;
58
    GPIOx.GPIO_Speed    = GPIO_Speed_2MHz;
59
    GPIO_Init(GPIOA, &GPIOx);
60

61
    GPIOx.GPIO_Mode     = GPIO_Mode_OUT;
62
    GPIOx.GPIO_OType    = GPIO_OType_PP;
63
    GPIOx.GPIO_Pin      = GPIO_Pin_1;
64
    GPIOx.GPIO_PuPd     = GPIO_PuPd_NOPULL;
65
    GPIOx.GPIO_Speed    = GPIO_Speed_2MHz;
66
    GPIO_Init(GPIOB, &GPIOx);
67

68
    GPIOx.GPIO_Mode     = GPIO_Mode_OUT;
69
    GPIOx.GPIO_OType    = GPIO_OType_PP;
70
    GPIOx.GPIO_Pin      = (GPIO_Pin_0 | GPIO_Pin_1);
71
    GPIOx.GPIO_PuPd     = GPIO_PuPd_NOPULL;
72
    GPIOx.GPIO_Speed    = GPIO_Speed_2MHz;
73
    GPIO_Init(GPIOF, &GPIOx);
74

75
}
Gast #4943175
Lesenswert?

Jan H. schrieb:
> Das bringt mich nicht weiter.
> Die anderen Ausgänge funktionieren doch. Die #defines sind alles OK.

Wenn Du meinst. Ich bin nicht der super-duper STM32-Experte, wollte Dir 
aber helfen und stelle die Fragen, die ich stellen würde, wäre es mein 
Programm.

Aber Du willst nicht, ist schon ok. Dann bin ich halt raus.
(Firma: www.harerod.de) Persönliche Seite #4943261
Lesenswert?

Hast Du einen Brotbrett-Aufbau?
Bitte Schaltplan und Foto vom Aufbau. :D

RM0360 v3 7.2.1
Caution: To switch ON the HSE oscillator, 512 HSE clock pulses need to 
be seen by an internal stabilization counter after the HSEON bit is set. 
Even in the case that no crystal or Resonator is connected to the 
device, excessive external noise on the OSC_IN pin may still lead the
oscillator to start. Once the oscillator is started, it needs another 6 
HSE clock pulses to complete a switching OFF sequence. If for any reason 
the oscillations are no more present on the OSC_IN pin, the oscillator 
cannot be switched OFF, locking the OSC pins from any other use and 
introducing unwanted power consumption. To avoid such situation, it is
strongly recommended to always enable the Clock Security System (CSS) 
which is able to switch OFF the oscillator even in this case.

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