Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

EEPROM Problem

Status
Not open for further replies.

helloleong

New Member
Im using Xicor x25650 EEPROM. But i found the chip has 2 problem.

First is the WIP bit problem. Initially i keep on check the WIP bit by the MCU, if write cycle finish only continue to the next instruction. After few 10 times i read the WIP bit, then the WIP bit get spoilt. Then i change to delay 5ms only the next write instruction ok.

Second is when the eeprom dint not power on for long time, after power on the 1st 8 bit will be fail to read, but the next read and write instruction is ok. So i have to read the first data twice to avoid first data miss read.

Did anybody face this problem also?

Thanks you.
 
Im using Xicor x25650 EEPROM. But i found the chip has 2 problem.

First is the WIP bit problem. Initially i keep on check the WIP bit by the MCU, if write cycle finish only continue to the next instruction. After few 10 times i read the WIP bit, then the WIP bit get spoilt. Then i change to delay 5ms only the next write instruction ok.

Second is when the eeprom dint not power on for long time, after power on the 1st 8 bit will be fail to read, but the next read and write instruction is ok. So i have to read the first data twice to avoid first data miss read.

Did anybody face this problem also?

Thanks you.

hi,
It would be helpful if you posted your program so that we can check it out.
 
My program is refer to microchip application notes.

Code:
void main(void)
{
	Init();
        //EEPROM power off for long time and dint operate, the first 8 bit cannot be read.
	//So have to read twice.
	Master = ByteRead(0x1FF0)<<8;
	Master|= ByteRead(0x1FF1);
	
	//Restore master pin again
	Master = ByteRead(0x1FF0)<<8;
	Master|= ByteRead(0x1FF1);

       //Other program here...

}

//**************************************************************
void ByteWrite(unsigned int address, unsigned char ByteData)
{
	static unsigned char status;
	//WriteEnable();			// Set WEL bit for write (Comment out: Stack over flow)	
	CS=0;					// Bring CS low (active)
	dummy = SPI_OUTPUT(0x06); 		// Output WREN command
	CS=1;

	CS=0;					// Bring CS high (inactive) 
	dummy = SPI_OUTPUT (0x02);		// Output WRITE command
	dummy = SPI_OUTPUT ((address>>8)&0xFF);	// Output MSB of address
	dummy = SPI_OUTPUT (address&0xFF);	// Output LSB of address
	dummy = SPI_OUTPUT (ByteData);		// Write byte of data
	CS=1;					// Bring CS high (inactive)
//	WIP_Poll();				// Perform WIP polling
	Delay_Routine(720);			// WIP polling (EEPROM error, change to delay 5ms)
}

//**************************************************************
 char ByteRead(unsigned int address)
{	
	static unsigned char spi_received;
	
	CS=0; 					// Bring CS low (active)
	
	dummy = SPI_OUTPUT(0x03);		// Output READ command
	dummy = SPI_OUTPUT((address>>8)&0xFF);	// Output MSB of address
	dummy = SPI_OUTPUT(address&0xFF);	// Output LSB of address
	spi_received = SPI_OUTPUT(0x00);	// The byte transmitted here is a don't care.
	
	CS=1;					// Bring CS high (inactive)
	
	return spi_received;			// Return byte of data

}

//**************************************************************
char SPI_OUTPUT (char spi_byte)
{
	SSPBUF = spi_byte;  			// Transfer data to SSPBUF	
	do{}
	while(!BF);   				// Wait until the transmission is complete.
	return SSPBUF;	 			// The data received should be valid.	
}

//**************************************************************
void WIP_Poll(void)
{
	static unsigned char status; 		// Variable to store Status Register
	
	do{
		status = ReadStatusReg(); 	// Read status register
	}while(status & 0x01); 			// Loop wile WIP (bit 0) is 1
}

I think the code has no problem, is it the chip is not so durable?
 
Im using Xicor x25650 EEPROM. But i found the chip has 2 problem.

First is the WIP bit problem. Initially i keep on check the WIP bit by the MCU, if write cycle finish only continue to the next instruction. After few 10 times i read the WIP bit, then the WIP bit get spoilt. Then i change to delay 5ms only the next write instruction ok.

Second is when the eeprom dint not power on for long time, after power on the 1st 8 bit will be fail to read, but the next read and write instruction is ok. So i have to read the first data twice to avoid first data miss read.

Did anybody face this problem also?

Thanks you.

For the second part of your question, perhaps you are reading the device too soon after power up.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top