Strange setting for writing file into SD Card

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Strange setting for writing file into SD Card

376 Views
g_macaluso
Contributor I

Hello everyone,

I'm developing an application which has to save some file to a SD Card.

At the moment I have some problem writing file into the SD Card.

I read some posts which suggested to drecrease the clock of the MCI peripheral.

I tried to decrease the clock and now I can write files into the SD Card.

The strange thingh is that in order to be able to write files into the SD Card I have to set the field PCLKDIV of PCLKSEL register to 8, but 8 is not a supported value.

As specified into the User Manual for LPC408x/407x, permitted value of PCLKDIV are 0, 1, 2, 4.

pastedImage_1.png

Can someone explain me how it it possible, and what I'm doing wrong?

And how can I decrease the clock of the MCI setting the field CLKDIV of CLOCK register?

Thanks a lot in advance.

Giovanni.

0 Kudos
1 Reply

310 Views
soledad
NXP Employee
NXP Employee

Hi,

Unfortunately, we cannot guaranty the behavior using another value. The values supported are 0, 1, 2, 3 and 4.

Did you test setting the value 1 or 4? Could you please try?


I suggest you use the lpcopen SD card demo code, please download lpcopenhttps://www.nxp.com/support/developer-resources/microcontrollers-developer-resources/lpcopen-libraries-and-examples/lpcopen-software-development-platform-lpc40xx:LPCOPEN-SOFTWARE-FOR-LPC40XX
in side package, there is demo app_sdmmc_meas, This example measures the performance of SD/MMC raw read & write operations.


Have a great day,
Sol

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos