Hi,
I have over 20+ years of experience in embedded system design, During this period i have been worked on AVR uc. I have SPI flash code for (AT45DB642D - 8MB) interface with Atmega128. Developed on AVR-GCC using AVR studio.
As Test program for flash testing is as follows , I can easily modified my code as per your requirement.
void main(void) //FLASH Test
{
unsigned int retval, pagenumber, startbyte, stopbyte, i;
unsigned char L_wbuf[26],L_rBuf[26];
SysEnterInPwrDwnMode();//Power Sleep Mode initialisation
InitialiseSystem();//System Initialisation
pagenumber = 4;
startbyte = 0;
stopbyte = 26;
SetBacklight( 1 );
for(i = 0; i < 26;i++) //writing to L_wbuf
{
L_wbuf[i] = 'A' + i;
readPageBuffer[i] = 0;
L_rBuf[i] = 0;
}
L_wbuf[i] = '\0';
write(COM_PORT1, "\r\nWRITING...\r\n",14,FALSE );//reading from L_wbuf
PageModify_Str( 0, L_wbuf ,pagenumber,startbyte, stopbyte );//writing on pagenumber fr startbyte to stopbyte
write(COM_PORT1, (unsigned char *)L_rBuf,26,FALSE );
write(COM_PORT1, "FINISH....\r\n",12,FALSE );//reading from L_wbuf
Page_Read_Str(0, pagenumber, (unsigned char *)readPageBuffer ); //reading from pagenumber in a
write(COM_PORT1, "READING...\r\n",12,FALSE );//write read data to serial port
write(COM_PORT1, (unsigned char *)readPageBuffer,26,FALSE );
while(1)
CheckAndTurnOffSystem(NULL);//Power ON/OFF Polling Function
}
Waiting for your resp, thanks- rdbembsys