Sign in

username:

password:



Not a member?

Search lpc2000



Search tips

Subscribe to lpc2000



lpc2000 by Keywords

2106 | ADC | ARM7 | Atmel | Bootloader | CAN | CrossStudio | CrossWorks | DDS | ECos | Ethernet | ETM | FIFO | FLASH | FPGA | GCC | GDB | GNU | GNUARM | GPIO | I2C | IAP | IAR | JTAG | Kickstart | LCD | Linux | LPC | LPC-E2294 | LPC2000 | LPC2100 | LPC2104 | Lpc2106 | Lpc210x | LPC2114 | LPC2119 | LPC2124 | LPC2129 | Lpc2138 | LPC213x | LPC21xx | LPC2210 | LPC2212 | LPC2214 | LPC2292 | LPC2294 | LPC2xxx | LPC3128 | MCB2100 | Olimex | Philips | PWM | Rowley | RTC | RTOS | SPI | SSP | UART | UART0 | UART1 | ULINK | USB | Watchdog | Wiggler

Ads

Discussion Groups

Discussion Groups | LPC2000 | Re: reading SanDisk 512MB SD card on LPC2888, Crossworks

Discussion group dedicated to the Philips LPC2000 family of ARM MCUs

reading SanDisk 512MB SD card on LPC2888, Crossworks - Jan Vanek - Oct 7 17:57:52 2008

Hallo forum,

when reading a block (512B) from this card I receive only 452 bytes. Then no more data is available and a MCIStatus_DataEnd flag is set in MCIStatus. I tried to setup different base clock, 20MHz instead of 25MHz, and different MCICLK (via divider in MCIClock register), also try to use/not-use wide-bus, stream-mode or block-mode in the MCIDataCtrl, still the same result. I used the LPC2888 SampleSoftware 1.30 as a starting point, the main difference is that I use no TX/RX interrupts when reading/writing the SD card. Any ideas?

With regards,
Jan

[Non-text portions of this message have been removed]
------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )


Re: reading SanDisk 512MB SD card on LPC2888, Crossworks - Jan Vanek - Oct 8 7:27:13 2008

Hallo again,

I found the problem(s). The LPC2888 errata sheet says the RX FIFO is not functional. It says when reading a 32b word from the RX FIFO, it reads also a second 32b word, which will be lost. The described workaround basically says "read fast before the 2nd word arrives". Unfortunatelly it says one should use the RxDataAvlbl condition to recognize when a new word comes to the FIFO. This is not correct. When the RxDataAvlbl flag is detected for the first time in the receive-loop, the FIFO queue is actually full (16 32b words), which I can see when I read the MCIDataCnt and MCIFifoCnt registers. Those registers say how many bytes is to be received resp. how many 32b words is expected yet to come to the FIFO. When the RxDataAvlbl is detected for the first time and the word is read from the FIFO, the MCIDataCnt is 448 and MCIFifoCnt is 112. Correct would be 508 and 127. There is another flag called RxFifoEmpty, the docu says "receive FIFO empty". This is wrong again. The flag is
set to 1 when there is a word in the FIFO, which means the flag should actually be called RxFifoNotEmpty. When I use this flag (in the meaning of RxFifoNotEmpty) I can correctly read all 512 bytes of the block.

With regards,
Jan

----- Original Message -----
From: Jan Vanek
To: l...@yahoogroups.com
Sent: Tuesday, October 07, 2008 11:56 PM
Subject: [lpc2000] reading SanDisk 512MB SD card on LPC2888, Crossworks

Hallo forum,

when reading a block (512B) from this card I receive only 452 bytes. Then no more data is available and a MCIStatus_DataEnd flag is set in MCIStatus. I tried to setup different base clock, 20MHz instead of 25MHz, and different MCICLK (via divider in MCIClock register), also try to use/not-use wide-bus, stream-mode or block-mode in the MCIDataCtrl, still the same result. I used the LPC2888 SampleSoftware 1.30 as a starting point, the main difference is that I use no TX/RX interrupts when reading/writing the SD card. Any ideas?

With regards,
Jan

[Non-text portions of this message have been removed]

#ygrp-mkp { BORDER-RIGHT: #d8d8d8 1px solid; PADDING-RIGHT: 14px; BORDER-TOP: #d8d8d8 1px solid; PADDING-LEFT: 14px; PADDING-BOTTOM: 0px; MARGIN: 14px 0px; BORDER-LEFT: #d8d8d8 1px solid; PADDING-TOP: 0px; BORDER-BOTTOM: #d8d8d8 1px solid; FONT-FAMILY: Arial}#ygrp-mkp HR { BORDER-RIGHT: #d8d8d8 1px solid; BORDER-TOP: #d8d8d8 1px solid; BORDER-LEFT: #d8d8d8 1px solid; BORDER-BOTTOM: #d8d8d8 1px solid}#ygrp-mkp #hd { FONT-WEIGHT: bold; FONT-SIZE: 85%; MARGIN: 10px 0px; COLOR: #628c2a; LINE-HEIGHT: 122%}#ygrp-mkp #ads { MARGIN-BOTTOM: 10px}#ygrp-mkp .ad { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px}#ygrp-mkp .ad A { COLOR: #0000ff; TEXT-DECORATION: none}

[Non-text portions of this message have been removed]
------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

RE: reading SanDisk 512MB SD card on LPC2888, Crossworks - Paul Curtis - Oct 8 7:31:00 2008

Jan,

> I found the problem(s). The LPC2888 errata sheet says the RX FIFO is not
> functional. It says when reading a 32b word from the RX FIFO, it reads
also a
> second 32b word, which will be lost. The described workaround basically
says
> "read fast before the 2nd word arrives". Unfortunatelly it says one should
use
> the RxDataAvlbl condition to recognize when a new word comes to the FIFO.
This
> is not correct. When the RxDataAvlbl flag is detected for the first time
in
> the receive-loop, the FIFO queue is actually full (16 32b words), which I
can
> see when I read the MCIDataCnt and MCIFifoCnt registers. Those registers
say
> how many bytes is to be received resp. how many 32b words is expected yet
to
> come to the FIFO. When the RxDataAvlbl is detected for the first time and
the
> word is read from the FIFO, the MCIDataCnt is 448 and MCIFifoCnt is 112.
> Correct would be 508 and 127. There is another flag called RxFifoEmpty,
the
> docu says "receive FIFO empty". This is wrong again. The flag is
> set to 1 when there is a word in the FIFO, which means the flag should
> actually be called RxFifoNotEmpty. When I use this flag (in the meaning of
> RxFifoNotEmpty) I can correctly read all 512 bytes of the block.

The LPC2800 can only be described as the unloved black sheep of the LPC2000
family. The new LPC32xx devices look a lot more interesting.

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: reading SanDisk 512MB SD card on LPC2888, Crossworks - Jan Vanek - Oct 8 8:04:03 2008

Hi Paul,

looks interesting, but little too mighty for our current project. It has 3 variants, all of them based on LPC2888, two of them have LCD and use USB, the third one has no LCD and has a SD card. The project has such a delay, that it would be very bad if the SD card can't be read. Yet in the final version, we will probably not use LPC2888 for this board with SD card, because we need 2 UARTs and the LPC288x has only one. So there is extra UART via I2C which makes it more expensive. This is the biggest disadvantage, apart from it I somehow started to like that chip :-)

With regards,
Jan

----- Original Message -----
From: Paul Curtis
To: l...@yahoogroups.com
Sent: Wednesday, October 08, 2008 1:30 PM
Subject: RE: [lpc2000] reading SanDisk 512MB SD card on LPC2888, Crossworks

Jan,

> I found the problem(s). The LPC2888 errata sheet says the RX FIFO is not
> functional. It says when reading a 32b word from the RX FIFO, it reads
also a
> second 32b word, which will be lost. The described workaround basically
says
> "read fast before the 2nd word arrives". Unfortunatelly it says one should
use
> the RxDataAvlbl condition to recognize when a new word comes to the FIFO.
This
> is not correct. When the RxDataAvlbl flag is detected for the first time
in
> the receive-loop, the FIFO queue is actually full (16 32b words), which I
can
> see when I read the MCIDataCnt and MCIFifoCnt registers. Those registers
say
> how many bytes is to be received resp. how many 32b words is expected yet
to
> come to the FIFO. When the RxDataAvlbl is detected for the first time and
the
> word is read from the FIFO, the MCIDataCnt is 448 and MCIFifoCnt is 112.
> Correct would be 508 and 127. There is another flag called RxFifoEmpty,
the
> docu says "receive FIFO empty". This is wrong again. The flag is
> set to 1 when there is a word in the FIFO, which means the flag should
> actually be called RxFifoNotEmpty. When I use this flag (in the meaning of
> RxFifoNotEmpty) I can correctly read all 512 bytes of the block.

The LPC2800 can only be described as the unloved black sheep of the LPC2000
family. The new LPC32xx devices look a lot more interesting.

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors

#ygrp-mkp { BORDER-RIGHT: #d8d8d8 1px solid; PADDING-RIGHT: 14px; BORDER-TOP: #d8d8d8 1px solid; PADDING-LEFT: 14px; PADDING-BOTTOM: 0px; MARGIN: 14px 0px; BORDER-LEFT: #d8d8d8 1px solid; PADDING-TOP: 0px; BORDER-BOTTOM: #d8d8d8 1px solid; FONT-FAMILY: Arial}#ygrp-mkp HR { BORDER-RIGHT: #d8d8d8 1px solid; BORDER-TOP: #d8d8d8 1px solid; BORDER-LEFT: #d8d8d8 1px solid; BORDER-BOTTOM: #d8d8d8 1px solid}#ygrp-mkp #hd { FONT-WEIGHT: bold; FONT-SIZE: 85%; MARGIN: 10px 0px; COLOR: #628c2a; LINE-HEIGHT: 122%}#ygrp-mkp #ads { MARGIN-BOTTOM: 10px}#ygrp-mkp .ad { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px}#ygrp-mkp .ad A { COLOR: #0000ff; TEXT-DECORATION: none}

[Non-text portions of this message have been removed]
------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: reading SanDisk 512MB SD card on LPC2888, Crossworks - tarun_112 - Oct 14 3:22:28 2008

--- In l...@yahoogroups.com, Jan Vanek wrote:
>
> Hi Paul,
i am tarun i also doing the sd card to interface with
lpc2148
i am able to reset intialize set the block length of sd card but i am
unable to write the data on sd card please give solution if u have .

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )