Processor Expert config for SD Card - MC9S08AW32

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Processor Expert config for SD Card - MC9S08AW32

2,901件の閲覧回数
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
ラベル(1)
0 件の賞賛
返信
3 返答(返信)

897件の閲覧回数
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 件の賞賛
返信

897件の閲覧回数
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 件の賞賛
返信

897件の閲覧回数
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 件の賞賛
返信