EmbeddedRelated.com
Forums

LPC2468 GPIO as a Input query

Started by koolhallmark January 2, 2013
Here is the Pin connection detail.

http://dl.dropbox.com/u/23986639/Schematic.JPG

An Engineer's Guide to the LPC2100 Series

@ Timo,

Using IOxDIR



Device detects SD card properly but saving is not working. Same as previous
one it saves fine again in programming mode.
On 03.01.2013 13:15, Harshad (Madhav) wrote:
> @ Timo,
>
> Using IOxDIR
>
> void main()
> {
> IODIR0 = 0;
> PINMODE0 = 0; PINMODE1 = 0; PINMODE2 = 0;
> while(1);
> }
>
> Device detects SD card properly but saving is not working. Same as
> previous one it saves fine again in programming mode.

So, summing up: this is fine:


but this is not:



If that is true, then there is something very fishy going on somewhere.
'IODIR0 = 0;' should not do any difference because the reset value of
the register is already zero.

I'm running out of ideas but I suggest you to check the definitions of
the register accessor macros against the user manual - definitely in
this case the definition of IODIR0 macro.

BTW, shouldn't IODIR0 be IO0DIR. At least in user manual it is spelled
like that.

BTW2, there is always startup code which gets linked in. It at least
initializes your variables and calls your main() function. Depending on
your tool set it might do something more which may have something to do
with your problem or maybe not.

--

Timo
Hi Timo,

IO0DIR and IODIR0 are same in my KEIL lpc24xx.h they have spelled it IODIR0
and IODIR1.
I will give try to test with some different configurations.

Thanks a lot for your time Timo.