MCUmall EPROM BIOS Chip Burner Forum
MCUmall EPROM BIOS Chip Burner Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 MCUmall Forums
 Using The Enhanced/Dual power Willem Programmer
 writing to 93c46 serial EEPROM
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

mylog

1 Posts

Posted - 09/02/2008 :  00:49:18  Show Profile
I have an M16C, a FT245BM USB interface IC and a 93C46 Serial EEPROM. I am using the MCU to write to the EEPROM on run-time. What I need to do is to overwrite one byte of data on a specific address on the EEPROM. Seemingly, I can do it successfully because I can see the change on that address point when I read the content of the EEPROM using MPROG. So far everything is fine. My problem is that FTDI drivers cannot recognize the device when I reset the USB or on the next power on after the writing to the EEPROM using program flow. However, when I write to the EEPROM manually using MPROG, I do not experience this problem. Why do you think the drivers cannot recognize the device although the content of the EEPROM in both situations (writing using MPROG and program flow) exactly matches.


Here is my Write Enable (EWEN) and Write code:

*************************

void EEpromEWEN(void)
{ char j;
char address=0x3F;
prc2=1;
E2P_DATA_DIR=1;
prc2=0;
E2P_CS=1;
write_1_();//start bit
write_0_();//0 ewen opcode
write_0_(); //0 ewen opcode
for(j=0;j<6;j++){ //send the adress
if((address>>(5-j)) & 0x01)E2P_DATA=1;
else E2P_DATA=0;
E2P_CLOCK=0;
eepromdelay();
E2P_CLOCK=1;
eepromdelay();
}
E2P_DATA=0;
E2P_CLOCK=0;
E2P_CS=0;
}

********************************

void WrEEpromData(char address, const int *ptr)
{ int EpromWriteWord;
char j;
EpromWriteWord=*ptr;
prc2=1;
E2P_DATA_DIR=1;
prc2=0;
E2P_CS=1;
write_1_(); //start bit
write_0_();
write_1_(); //write opcode

for(j=0;j<6;j++){
if((address>>(5-j)) & 0x01)E2P_DATA=1;
else E2P_DATA=0;
E2P_CLOCK=0;
eepromdelay();
E2P_CLOCK=1;
eepromdelay();
}
for(j=0;j<16;j++)
{
if(EpromWriteWord& 0x8000)E2P_DATA=1;
else E2P_DATA=0;
E2P_CLOCK=0;
eepromdelay();
E2P_CLOCK=1;
eepromdelay();
EpromWriteWord=EpromWriteWord<<1;
}
E2P_DATA=0;
E2P_CLOCK=0;
E2P_CS=0;
}

*************************

void write_1_(void)
{
E2P_CLOCK=0;
E2P_DATA=1;
eepromdelay();
E2P_CLOCK=1;
eepromdelay();
E2P_CLOCK=0;
}
**********************
void write_0_(void)
{
E2P_CLOCK=0;
E2P_DATA=0;
eepromdelay();
E2P_CLOCK=1;
eepromdelay();
E2P_CLOCK=0;//
}

************************


I appreciate your quick reply.

Many thanks.
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
MCUmall EPROM BIOS Chip Burner Forum © Copyright 2003 - 2009 Mcumall Electronics Inc. Go To Top Of Page
Generated in 0.09 sec. Snitz Forums 2000