AnsweredAssumed Answered

FRDM-KL25Z - slow SPI clock

Question asked by Jonas Eriksson on Nov 13, 2012
Latest reply on Nov 19, 2012 by Jonas Eriksson

Hi,

 

I'm working on a project involving SD card writing via SPI bus. The writing itself works well, but it's terribly slow (~10kBps). I believe the reason is the SPI clock which ticks only @ 45 kHz.

 

The environment is as follows:

 

- FRDM-KL25Z board, Itead Studio SD Card breakout module, Samsung 2GB MicroSD card

- FatFS and SDCard components from www.steinerberg.com

- SPI1 bus, 333 kHz and 4 Mhz shift clock speeds

- Clock: 8 Mhz external crystal, 2 MHz bus, MCG is in BLPE mode.

- Codewarrior 10.3, OpenSDA

 

If I change the bus speed to 1 MHz the SPI clock reduces to 23 kHz, eventhough SPI1 shoudn't use bus clock as a reference. The MCG, SIM and SPI registers seem ok and the scope tells me the bus clock is ok (which should mean the OUTDIV1 and OUTDIV4 work as they should). I tried also SPI0 bus but that was slow as well.

 

So the question is: what could be the reason for such a slow clock speed?


Outcomes