Dear Sir, I am trying to make communication with flash memory AT45DB321D with LPC 2378 every register get modified except data register, here is the code given below,
#define Cclk 12000000 //Processor clock #define Pclk Cclk //Periferals clock void InitCPU (void) { PCLKSEL0 = 0xaaaaaaaa ; // Pclk = 1/4 CclK PCLKSEL1 = 0xaaaaaaaa ; MEMMAP = 0x01; MAMCR = 0x00 ; MAMTIM = 0x03 ; MAMCR = 0x02 ; Initgpio(); } void InitSPI(void) { PCONP |= 0x100; //power on for spi 8th bit is SPI bit PINSEL0 |= 0xC0000000; //P0.15 spi pin configuration PINSEL1 |= 0x0000003C; //P0.17,P0.18,P0.16 IODIR0 = 0x00010000; IOSET0 = 0x00010000; //P0.16 S0SPCCR =0x2c ; //0x2C S0SPCR = 0xb8; //0xb8 } while(1) { S0SPDR = 0xFF; while (!(S0SPSR & SPIF)); }
Please reply... Thanks in Advance, Regards, Kishor P.