EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

LPC2468 GPIO as a Input query

Started by koolhallmark January 2, 2013
Hi,

In my application LPC2468 is interfaced with SD card. SD Card is shared by another data logging device.

I have set all my GPIO as Input and disabled all Pull-up and Pull-down resistor.

Now when My MCU is in programming mode. Data logging device is accessing SD card in proper way. But while MCU is running but it is doing nothing it is just in while loop with all GPIO as input and in this case Data logging device detects some error while accessing SD card.

All the pins shared with logging device are in input mode although it shows error.

Seems something wrong with LPC2468 input configuration.

Is there any way to set it in high impedance mode ?

An Engineer's Guide to the LPC2100 Series

I think you are experiencing a contention input problem depending by
your hw configuration and the way to share the input pin, I suppose they
are in wired-OR configuration so to solve the problem you should use
buffers to isolate the 2 outputs in turn.
Hi,
High impedance mode is not enough.
Connected wires have capacitance which can make signals wrong.
Try to make wires shorter, correct ground connection is important too.

Regards
Vlad
On 02.01.2013 13:41, koolhallmark wrote:
> ...
> Now when My MCU is in programming mode. Data logging device is accessing
> SD card in proper way. But while MCU is running but it is doing nothing
> it is just in while loop with all GPIO as input and in this case Data
> logging device detects some error while accessing SD card.
>
> All the pins shared with logging device are in input mode although it
> shows error.
>
> Seems something wrong with LPC2468 input configuration.

If your logging device works when LPC2468 is in programming mode, it
means that the LPC2468 internal pullups does not disturb it and that
your HW connections should be OK. IIRC, pullups are active in
programming mode.

So, most probably you have made a mistake in initializing the GPIO
configuration or maybe you have configured the pins for SD-interface. If
thats the case, you should be able to get it working equally well by not
initializing anything. Nothing more in main() than 'while (1) ;'

> Is there any way to set it in high impedance mode ?

Fill PINMODE registers with 0xAAAAAAAA and don't touch PINSEL registers.

--

Timo
Thanks for reply Timo,
I have simply written such code.



I have also tried with PINSEL = 0xAAAAAAAA but it shows same result.
@Timo,

I have changed code to



Now Logger device can detect SD Card but it is not able to save on SD card.
Say any how for device SD card is working properly but when it goes to save
on SD card this process is not going to complete.
In Hardware I have made some little change. Logger is using MCIPOWER to SD
card So I have removed +3.3V that was initially supplied by my board.
There is Common ground between Device and my board.
On 03.01.2013 09:28, Harshad (Madhav) wrote:
> @Timo,
>
> I have changed code to
>
> void main()
> {
> while(1);
> }
>
> Now Logger device can detect SD Card but it is not able to save on SD
> card. Say any how for device SD card is working properly but when it
> goes to save on SD card this process is not going to complete.

Is the logger able to save when you keep the LPC2468 in programming
mode? Can you measure the SD-card signals with oscilloscope? Did you
check the connection of write protect signal?

> In Hardware I have made some little change. Logger is using MCIPOWER to
> SD card So I have removed +3.3V that was initially supplied by my board.
> There is Common ground between Device and my board.

Maybe you should show how you have connected all of the signals.

What kind of SD-card are you using? Have you tried different cards?

--

Timo
Hi Timo,

Here I can see some weird behavior.

I have written code simply like this.



Everything works file Device is able to access SD card and store data into.

then I written



Everything is fine..

Now I have just added FIO1DIR or FIO2DIR initialization



In this case Device detects SD card as OK but not able to save on Card.
--------
Here is my Hardware Connection.

I have made a Cable so I can Insert it into SD card socket of device and on
other side at my board I have kept connector for same so I can Insert
another side of cable into SOCKET on my board. while I have designed a PCB
so all the connections I have tapped and I have kept provision to Insert
Original SD card into second socket on my board.

Yes device is saving perfectly when LPC2468 is in Programming mode. :( I
don't have Oscilloscope.
Currently for VCC of SD Card its connected with MCIPWR of Device as Device
is using MCI mode for SD card operation. Seems nothing wrong with write
protect as it is able to write in the case I mentioned.

I am using MicroSD card.

I have soldered one more board on which I haven't mounted MCU and on that
board it is saving perfectly.
On 03.01.2013 12:01, Harshad (Madhav) wrote:
> void main()
> {
> FIO1DIR = 0; // I have also tried with FIO2DIR = 0;
> FIO0DIR = 0;
>
> PINMODE0 = 0; PINMODE1 = 0; PINMODE2 = 0;
> while(1);
> }
>
> In this case Device detects SD card as OK but not able to save on Card.

It shouldn't make any difference, but you should use IOxDIR registers
for ports 0 and 1 because you haven't initialized SCS register for high
speed GPIO (or have you, somewhere in startup code?).

> Here is my Hardware Connection.

I was thinking about a list where we could see exactly which LPC2468,
connector and socket pins are connected together.

--

Timo
@Timo,

No I have initialize nothing kept everything as it is. There is no any
start-up code added this stage.
Let me give it a try with IOxDIR and will report you with the schematic.

The 2024 Embedded Online Conference