Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

strange 24lc512 eeprom problem

Status
Not open for further replies.

devil6600

Full Member level 5
Joined
Nov 15, 2008
Messages
250
Helped
7
Reputation
14
Reaction score
7
Trophy points
1,298
Activity points
2,931
Hi all,

i've very strange problem while writing to external eeprom 24lc512. its connected to 18f4550 with 4.7k pullups. eeprom data is sent through USB from PC

i am writing eeprom in chunk of 28bytes, writing to first 28 location is ok but when i write to 29th location the 28th location byte gets corrupt. when i try to correct it by writing a single byte at 28th location then the 27th location byte gets corrupt.
i have no idea why eeprom is not working as expected. below is the code:
Code:
              for aa = 3 to 62 step 2
                temp_add = USBRXBuffer[aa]
                gosub hexconvert    
                edata[0] = temp_add * 16
                
                temp_add = USBRXBuffer[aa+1]
                gosub hexconvert
                edata[1] = temp_add
                
                edata[2] = edata[1] + edata[0]
                prg_block[cc] = edata[2]
                cc = cc + 1                            
            next aa                
            I2cwrite SDA,SCL,CONTROL,address[4],[str prg_block\cc]
            pause 10
eeprom dump, see at last 28th byte should be FF but its D9:
Code:
FF
FF
FF
FF
FF
FF
FF
FF
FF
FF
FF
FF
FF
FF
FF
FF
FF
FF
FF
FF
FF
FF
FF
FF
FF
FF
FF
FF
D9
FF
FF
FF
when i specifically try to correct 28th byte then the 27th byte gets corrupted
can you please help me solving this issue

Thank You
 

Your code nothing explains. Please, post the full version. And explain what do you want to do.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top