Tool/software: Starterware
Hey everyone,
i am facing some difficulties trying to control the gpio pins...
//
#define GPIOP8_04 (GPIO_1_7) //pin:P8_04,mode7:gpio1[7]
#define PINGP1 (7)
#define GPIOP8_07 (GPIO_2_7) //pin:P8_07,mode7:gpio2[7]
#define PINGP1_2 (7)
#define GPIOP8_22 (GPIO_2_22) //pin:P8_26,mode7:gpio2[22]
#define PINGP2 (22)
// the following code is to toggle the pins defined above
//
L3L4_driver_init();
L3L4_clock_domain_open();
GPIO1ModuleClkConfig();
GPIO2ModuleClkConfig();
GpioModuleEnable(SOC_GPIO_1_REGS);
GpioModuleEnable(SOC_GPIO_2_REGS);
//pin mux setup
// P804
GpioPinMuxSetup(GPIOP8_04, 7);
GPIODirModeSet(SOC_GPIO_1_REGS,PINGP1,GPIO_DIR_OUTPUT);
// P807
GpioPinMuxSetup(GPIOP8_07, 7);
GPIODirModeSet(SOC_GPIO_2_REGS,PINGP1_2,GPIO_DIR_OUTPUT);
// P822
GpioPinMuxSetup(GPIOP8_22, 7);
GPIODirModeSet(SOC_GPIO_2_REGS,PINGP2,GPIO_DIR_OUTPUT);
//
while(1)
{
GPIOPinWrite(SOC_GPIO_1_REGS, GPIOP8_04, GPIO_PIN_HIGH);
Delay(0xAFFFF);
GPIOPinWrite(SOC_GPIO_1_REGS, GPIOP8_04, GPIO_PIN_LOW);
Delay(0xAFFFF);
//
GPIOPinWrite(SOC_GPIO_2_REGS, PINGP1_2, GPIO_PIN_HIGH);
Delay(0xAFFFF);
GPIOPinWrite(SOC_GPIO_2_REGS, PINGP1_2, GPIO_PIN_LOW);
Delay(0xAFFFF);
//
GPIOPinWrite(SOC_GPIO_2_REGS, GPIOP8_22, GPIO_PIN_HIGH);
Delay(0xAFFFF);
GPIOPinWrite(SOC_GPIO_2_REGS, GPIOP8_22, GPIO_PIN_LOW);
Delay(0xAFFFF);
//
}
The problem with this code is that the leds i connect to my beaglebone white do NOT turn on and off...instead there seems to be only a very dim light in only one of the leds (the second one, P8_07), which is also constantly on...Now the resistor i use is 470 Ohm and i am pretty sure that is not too much, as if i connect the led with pin 4 in P9 header (3.3V output) instead of the gpio pin, the led turns on just fine..
Could someone help me out? Is the pin mux not done properly? What else shoud i try?
Thanks in advance