Processor Expert config for SD Card - MC9S08AW32

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

Processor Expert config for SD Card - MC9S08AW32

2,275 Views
marcov
Contributor I
Hi guys,
I'm using the SPI bus on the MC9S08AW32 to access to an SD card.

In CodeWarrior I've added through Processor Expert the SPI bus setup in hardware mode. Using the default configuration for master I have some trouble  interfacing with the card.

So can u please tell me if this configuration is right?

regards,
marco











Message Edited by NLFSJ on 2008-05-08 06:21 AM
Labels (1)
0 Kudos
3 Replies

271 Views
erooll
Contributor II
Hi. marcov, actually I use a SD card like a storage device, even I have implement a FAT file system to store data.
Usually I set all modules of microcontroller writing directly code.
This is my settings that I have used in a GT60, an recently in a QE128
 
 
   SPI1BR = 0x00;       //Baud Rate @ fbus/2   
   SPI1C2 = 0x00;
  
   SPI1C1 = 0b01011100;
    /*        ||||||||-->LSBFE: LSB first
              |||||||--->SSOE: Slave select output enable
              ||||||---->CPHA: Clock Phase
              |||||----->CPOL: Clock Polarity
              ||||------>MSTR: Master/Slave Mode Select
              |||------->SPTIE: SPI Transmit Interrupt Enable
              ||-------->SPE: SPI Sytem Enable
              |--------->SPIE: SPI Interrupt Enable (for SPRF and MODF)
    */           
0 Kudos

271 Views
Roach
Contributor I

I can see that your shift clock idle polarity is High, I think it has to be low to communicate with SD card. Attached is my PE config.

Message Edited by Roach on 2008-05-15 07:18 PM

 

SD_SPI2.jpg

Message Edited by t.dowe on 2009-10-27 12:36 PM
0 Kudos

271 Views
marcov
Contributor I
thanks! i will give it a try....

my problem at the moment is that I randomly read a shifted bit, eg 0x04 instead of 0x01.... maybe your hint will solve this.


0 Kudos