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.
Hey everyone,
I got myself LCDK OMAP-L138 and XDS100V2 debugger.
I try to run the blinking led project on the ARM processor but I can't seem to make the LEDs blink.
I guess I don't understand the multiplexing process but even when I use the sample as is, it doesn't work.
I tried altering the program to use the user buttons as triggers.
The buttons do trigger but the LEDs still don' turn off.
Here is my code:
int main(void)
{
/* The Local PSC number for GPIO is 3. GPIO belongs to PSC1 module.*/
PSCModuleControl(SOC_PSC_1_REGS, HW_PSC_GPIO, PSC_POWERDOMAIN_ALWAYS_ON,
PSC_MDCTL_NEXT_ENABLE);
/* Pin Multiplexing of pin 12 of GPIO Bank 6.*/
GPIOBank6Pin12PinMuxSetup();
/* Sets the pin 109 (GP6[12]) as input.*/
GPIODirModeSet(SOC_GPIO_0_REGS, 109, GPIO_DIR_OUTPUT);
/* Sets the pin 110 (GP6[13]) as input.*/
GPIODirModeSet(SOC_GPIO_0_REGS, 110, GPIO_DIR_OUTPUT);
GPIODirModeSet(SOC_GPIO_0_REGS, 37, GPIO_DIR_INPUT);
GPIODirModeSet(SOC_GPIO_0_REGS, 38, GPIO_DIR_INPUT);
while(1)
{
if(GPIOPinRead(SOC_GPIO_0_REGS, 37) == GPIO_PIN_LOW)
{
GPIOPinWrite(SOC_GPIO_0_REGS, 109, GPIO_PIN_HIGH);
GPIOPinWrite(SOC_GPIO_0_REGS, 110, GPIO_PIN_HIGH);
}
if(GPIOPinRead(SOC_GPIO_0_REGS, 38) == GPIO_PIN_LOW)
{
GPIOPinWrite(SOC_GPIO_0_REGS, 109, GPIO_PIN_LOW);
GPIOPinWrite(SOC_GPIO_0_REGS, 110, GPIO_PIN_LOW);
}
}
}
Help, anyone?
Thanks,
Joel
One problem is that you haven't set up the pinmux for pin 110. You need to add a function like GPIOBank6Pin13PinMuxSetup()
void GPIOBank6Pin13PinMuxSetup(void)
{
unsigned int savePinmux = 0;
/*
** Clearing the bit in context and retaining the other bit values
** in PINMUX13 register.
*/
savePinmux = (HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(13)) &
~(SYSCFG_PINMUX13_PINMUX13_11_8));
/* Setting the pins corresponding to GP6[13] in PINMUX13 register.*/
HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(13)) =
(PINMUX13_GPIO6_13_ENABLE | savePinmux);
}
Also, you have to be in privileged mode to change the pinmux registers.
I was able to get all the LEDs to work on the LCDK by adding GPIO LED support to the starterware bootloader and using that to load my ARM application.
Hey Aaron,
Thanks for the help.
The problem was the .cmd file that was automaticly used when I changed the device int the project properties, when I changed it back, it worked.
You are right about the muxing part for the other LED.
Joel
Hi
Where is this macro defined:
PINMUX13_GPIO6_13_ENABLE
Where I can similar definition for GPIO2[4]
if can not be found anywhere how to define it.
Thanks
Attached are the files I modified from the root OMAPL138_StarterWare_1_10_03_03 directory. I was running the echoApp demo.
Best regards,
Aaron
Hi Aaron
which libraries are used to link the following symbols:
PSCModuleControl
GPIOBank6Pin12PinMuxSetup
GPIODirModeSet
GPIOPinRead
GPIOPinWrite
Thanks
Hey Hatem,
From the OMAPL138_StarterWare_1_10_03_03 directory you can find "psc.h" and "gpio.h".
Furthermore, to config the pin multiplexing, you can use a small app called: "PinMux" (surprise surprise) 0576.PinMux.zip
and then just change the wanted pinmux registers with the received values, like that:
/* The Local PSC number for GPIO is 3. GPIO belongs to PSC1 module.*/
PSCModuleControl(SOC_PSC_1_REGS, HW_PSC_GPIO, PSC_POWERDOMAIN_ALWAYS_ON,
PSC_MDCTL_NEXT_ENABLE);
// Select GP8[10] (139) and GP8[12] (141) as GPIO's
HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(18)) |= 0x80800000;
Best regards,
Yoel
Hello,
Getting an error "expression must be an modifiable lvalue" at following statement
HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(13)) = 0x00000088;
Thank you in anticipation
Best Regards
Kalyani
Thank you Titus.
Yes you are right. After including "hw_types.h" file the error is resolved but now getting one more error as "unresolved symbol SYSCFG0_PINMUX, first referenced in ./gpioCardDetect.obj". I have imported gpio example from starterware and trying to modify the same code.
Thanks in advance
Regards
Kalyani
Yes,
Program is executed properly but it is also not working on board.
Thanks
Kalyani
Hi,
I am trying to make a small program to blink a led using an OMAP l-138 LCDK board that is running linux kernel 3.3.0.
Could you please me explain me how can i make such a program?
Thanks,