Reply by "Harshad (Madhav)" January 3, 20132013-01-03
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.

An Engineer's Guide to the LPC2100 Series

Reply by Timo January 3, 20132013-01-03
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
Reply by "Harshad (Madhav)" January 3, 20132013-01-03
@ Timo,

Using IOxDIR



Device detects SD card properly but saving is not working. Same as previous
one it saves fine again in programming mode.
Reply by "Harshad (Madhav)" January 3, 20132013-01-03
Here is the Pin connection detail.

http://dl.dropbox.com/u/23986639/Schematic.JPG
Reply by "Harshad (Madhav)" January 3, 20132013-01-03
@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.
Reply by Timo January 3, 20132013-01-03
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
Reply by "Harshad (Madhav)" January 3, 20132013-01-03
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.
Reply by Timo January 3, 20132013-01-03
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
Reply by "Harshad (Madhav)" January 3, 20132013-01-03
@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.
Reply by "Harshad (Madhav)" January 3, 20132013-01-03
Thanks for reply Timo,
I have simply written such code.



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