problem to read write 24LC512


Closed Thread
Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    17

    Wink problem to read write 24LC512

    Ciao.

    I try to write an read an 24LC512 with a PIC 18F252. The program works well till the address 32728, after that I am not sure what is happent.
    I looks like overwrite the memory by the address zero, or in the same time write the address 32728 and the address 0 with the same data.

    I wont to write all memory not only half.

    This is part of my program:

    'I2C Variables
    ctl CON $A0

    'I2C Eeprom Pins
    sda_B VAR PORTB.5 ' I2C SDA for ext eeprom B
    scl VAR PORTB.6 ' I2C SCL for ext all eeprom
    sda_A VAR PORTB.7 ' I2C SDA for ext eeprom A
    sda_C VAR PORTC.5 ' I2C SDA for ext eeprom C

    in_adr VAR WORD
    out_adr VAR WORD
    mem_adr VAR WORD

    data VAR BYTE[17]
    .
    .
    .
    in_adr=0
    out_adr=65535

    For mem_adr = in_adr TO out_adr STEP 16

    For m=1 TO 16
    I2CWrite sda_A,scl,ctl,mem_adr+(m-1),[data[m]]
    Pause 10
    Next m
    Next mem_adr
    .
    .
    .
    'Read procedure

    For m=1 TO 16
    I2CRead sda_A,scl,ctl,mem_adr+(m-1),[gps_data[m]]
    Next m
    HSerout [DEC2 data[1],DEC2 data[2],DEC2 data[3],DEC2 data[4],DEC2 data[5],DEC2 data[6],DEC2 data[7],DEC2 data[8],DEC2 data[9],DEC2 data[10],DEC2 data[11],DEC3 data[12],DEC2 data[13],DEC2 data[14],DEC2 data[15],DEC1 data[16] ,10,13]

    mem_adr=mem_adr+16
    EndIF
    End

    I need your help. Thanks.

  2. #2
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    17


    Did you find this post helpful? Yes | No

    Talking the memory is 24LC515 not 24LC512

    Ciao.

    I will answer by myself.
    I have looking for software errors, but finaly I found the problem.
    For mistake the memory is 24LC515 not 24LC512.

    Thanks.

Similar Threads

  1. Cleaning up code
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd December 2009, 07:14
  2. write -read problem?
    By turkuaz in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 30th August 2009, 13:06
  3. Read Write Problem
    By kduck63 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 15th June 2009, 19:03
  4. SEROUT WORD variable problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th April 2009, 11:20
  5. Read Modify Write problem?
    By markedwards in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 18th November 2005, 21:02

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts