This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Toggling GPIO E Problems

I a using the TM4C1294XL launchpad

i have the need to toggle very fast a 2 GPIO, so i chosed PE3 and PE2.

Problem is if i just toggle PE2, PE3 also toggles, and vice versa.

Is there any limitations that i am no aware or am i doing anytigh rong?

This is how i configure the ports and toggle them:

  //Configure GPIO_E:
  SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
  SysCtlGPIOAHBEnable(SYSCTL_PERIPH_GPIOE);
  //Configure port E2: 
  GPIOPinTypeGPIOOutput(GPIO_PORTE_AHB_BASE, GPIO_PIN_2);
  GPIOPadConfigSet(GPIO_PORTE_AHB_BASE,  GPIO_PIN_2,  GPIO_STRENGTH_8MA,  GPIO_PIN_TYPE_STD); 
  //Configure port E3:
  GPIOPinTypeGPIOOutput(GPIO_PORTE_AHB_BASE , GPIO_PIN_3); 
  GPIOPadConfigSet(GPIO_PORTE_AHB_BASE,  GPIO_PIN_3,  GPIO_STRENGTH_8MA,  GPIO_PIN_TYPE_STD);  
  //
  HWREG(GPIO_PORTE_AHB_BASE + ((GPIO_PIN_2 << 2))) = 0;    
  while(1){
    HWREG(GPIO_PORTE_AHB_BASE + ((GPIO_PIN_3 << 2))) = GPIO_PIN_3;
    HWREG(GPIO_PORTE_AHB_BASE + ((GPIO_PIN_3 << 2))) = 0;     
  }

  if(NewVal[0]-48==0){
    UARTUpdate=0;
    

  • Hello Luis,

    PE3 and PE2 are not connected in the design, they are independent GPIO's. So toggle on one should affect the other.

    Secondly on TM4C129 you do not need to call SysCtlGPIOAHBEnable as all ports are now AHB.

    Regards

    Amit

  • Thank you for the fast response.

    So that means i don't have to use GPIO_PORTE_AHB_BASE?

  • Hello Luis,

    My only point was that the following line is redundant on TM4C129

    SysCtlGPIOAHBEnable(SYSCTL_PERIPH_GPIOE);

    As far as the PE3 and PE2 toggling when ether is toggled, that is not possible unless

    1. There is a short on the board between PE3 and PE2. You can test that with a continuity meter/multimeter

    Regards

    Amit

  • Since you are sure that there is nothing wrong with the code i messed around with the analyzer and found out the problem was the autoset.

    I was in some weird setting in which any value different from GND was 1. Setting it to TTL solved it.

    This actually made me discover that when a port is toggled, there's noise in the rest of the ports of the GPIO 

    Thanks for the info