About 2440 SPI

Boyee 2010-09-08 09:24:55 Link
Hi all,
    I configure SPI and connect MISO and MOSI directly, then try to
read,but always get 0xFF,why?
   Codes:
        init:
        *CLKCON |= (1<<18);
  *GPECON |= (1<<27) | (1<<25) | (1<<23);
  *GPECON &= !(  (1<<26) | (1<<24) | (1<<22)  );
  *GPEUP &= !(  (1<<13) | (1<<12) | (1<<11)  );
  *GPEDAT |= (1<<13) | (1<<12) | (1<<11);  //pin 13,12,11
  *GPGCON |= (1<<4);  //pin 2
  *GPGCON &= !(1<<5);
  *GPGUP &= (1<<2);
  *GPGDAT |= (1<<2);
  *SPPRE0 = 0x18;
  *SPCON0 = 0x38;
  *SPPIN0 = 0x00;
        write:
        *SPTDAT0 = (char)arg;

        int:
        sprintf( getMMem(100) , "wirelessl: spi irp request,reg
status:%x\n", *SPSTA0 );   //Always get 0xFF

thanks,
Boyee

mouha 2010-09-08 17:22:57 Link
look at my thread,

Marek nandra did a nice job about it.

Reply

Name
eMail (not visible)
Subject (no text only in upper case; no HELP, URGENT...)
Text
HTML tags are not supported and links are generated automatically if they start with http or ftp.
Please submit long source code or log files as attachment (only registered users).
Please enter the number 3505