This is the mail archive of the mailing list for the eCos project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: AT91 GPIO read problem

>> With ecos, I can configure any gpio as an output and set it high or low without any problems, but when it comes to reading a pin's value it seems to always return 0 regardless of the logic level on it.

>> cyg_bool value
>> HAL_ARM_AT91_GPIO_GET(AT91_GPIO_PA29, value);

>> 'value' is always 0. I've tried a couple of different boards in case the first one has been damaged somehow and different pins in case there is a perculiarity with a particular mulifunction pin.
>> Does anybody familiar with the AT91 have any ideas what school boy type error I might be making?

> Did you enable the clock to the GPIO subsystem? Output works without a
> clock, input does not. Look in i think the power management section of
> the manual.

>       Andrew

No, I didn't even know there was a GPIO subsystem that needs a clock, but now I know that fixed it:


Thanks Andrew, there is only brief mention of it in the 757 page AT91SAM7 manual, so it might have taken me awhile to chance upon it.



Before posting, please read the FAQ:
and search the list archive:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]