Forum: Compiler & IDEs Output Input Pin


von Samet (Gast)


Lesenswert?

Hallo leute ich brauche dringend hilfe von euch.

ich versuche gerade von einem port etwas zu schicken und von einem 
anderen Port etwas zu empfangen am Primer2. Port 13 sendet bei mir die 
Bits und Port 11 empfängt die Signale. Das Problem bei mir ist das der 
Interrupt für Pin 11 GARNICHT ZUM EINSATZ kommt und ich bin gerade 
extrem verzweifelt! ich schicke euch mal den code... wiese kommt er in 
die Methode EXTI15_10_IRQHandler (Interrupt) nicht hinein... ich 
verwende freeRtos.
1
GPIO KONFIGURIEREN:
2
3
void BUSPins_Init( void )
4
{
5
   GPIO_InitTypeDef GPIO_InitStructureRX;
6
   GPIO_InitTypeDef GPIO_InitStructureTX;
7
8
   /* Enable the GPIO clock for the RX/TX Pins*/
9
   RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOB, ENABLE );
10
   RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOC, ENABLE );
11
12
   /* Configure the GPIO Pins for Transmitting/Receiving */
13
   GPIO_InitStructureTX.GPIO_Pin = GPIO_Pin_13;
14
   GPIO_InitStructureRX.GPIO_Pin = GPIO_Pin_11;
15
16
   /* Set the operation mode */
17
   GPIO_InitStructureTX.GPIO_Mode = GPIO_Mode_Out_OD;
18
   GPIO_InitStructureRX.GPIO_Mode = GPIO_Mode_IN_FLOATING;
19
20
   GPIO_InitStructureTX.GPIO_Speed = GPIO_Speed_50MHz;
21
   GPIO_InitStructureRX.GPIO_Speed = GPIO_Speed_50MHz;
22
23
   GPIO_Init( GPIOB, &GPIO_InitStructureTX );
24
   GPIO_Init( GPIOC, &GPIO_InitStructureRX );
25
  
26
}
27
28
------------------------------------------------------------------------------------------------------
29
30
EXTI KONFIGURIEREN:
31
32
33
GPIO_EXTILineConfig(GPIO_PortSourceGPIOC, GPIO_PinSource11);
34
    // Configure EXTI Line15 to generate an interrupt on falling edge
35
    EXTI_InitStructure.EXTI_Line = EXTI_Line11;
36
    EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
37
    EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling;
38
    EXTI_InitStructure.EXTI_LineCmd = ENABLE;
39
    EXTI_Init(&EXTI_InitStructure);
40
41
--------------------------------------------------------------------------------------------------------
42
43
NTVI KONFIGURIEREN (WAR SCHON DABEI):
44
45
46
NVIC_InitStructure.NVIC_IRQChannel = EXTI15_10_IRQChannel;
47
    NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
48
    NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1;
49
      NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
50
    NVIC_Init(&NVIC_InitStructure);
51
52
--------------------------------------------------------------------------------------------------------
53
54
IRQHANDLER:
55
56
57
void EXTI15_10_IRQHandler(void)
58
{
59
   
60
  
61
    if(EXTI_GetITStatus(EXTI_Line11) != RESET)
62
   {
63
      GPIO_WriteBit(GPIOE, GPIO_Pin_0, (BitAction)((1-GPIO_ReadOutputDataBit(GPIOE, GPIO_Pin_0))));
64
  
65
  
66
      EXTI_ClearITPendingBit(EXTI_Line11);
67
   }
68
69
}
70
71
-----------------------------------------------------------------------------------------------------
72
73
TASK WELCHER 13 einmal auf 1 und einmal auf 0 setzt:
74
75
void prvSendTask ( void *params )
76
{
77
   for(;;) {       
78
        GPIO_SetBits( GPIOB, GPIO_Pin_13 );
79
        vTaskDelay(1000);  
80
        GPIO_ResetBits( GPIOB, GPIO_Pin_13 );
81
        vTaskDelay(1000);
82
   }
83
}

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.