I'm having problems with reading a AT24C1024 EEPROM


Closed Thread
Results 1 to 2 of 2
  1. #1

    Default I'm having problems with reading a AT24C1024 EEPROM

    You guys can help me hello
    I'm having problems with reading a AT24C1024 EEPROM,
    I'm able to read a line of information, would like to know how to perform the reading of the other lines because the messages are displayed on the LCD with characters on black

    Here is the code

    DEFINE LCD_DREG PORTB
    DEFINE LCD_DBIT 4
    DEFINE LCD_RSREG PORTB
    DEFINE LCD_RSBIT 1
    DEFINE LCD_EREG PORTB
    DEFINE LCD_EBIT 2
    TRISB = 0
    CMCON = 7

    SCL var PORTA.0 ' Clock pin
    SDA var PORTA.1 ' Data pin


    E0 var byte
    B1 var byte ' Data 1
    B2 VAR BYTE

    b1 = e0 + $00 'B1 is dados da EEPROM 'not sure what you are using E0 + $20 for?
    B1 = E0 + $10
    ADDR var WORD ' 24c32a uses 2 bytes for address ( 12 bits, high 4 bits are 0's )
    ADDR = 0 ' where in eeprom to store first byte, I chose 0 (start of eeprom)


    pause 100
    I2CWRITE SDA,SCL,$A0,ADDR,[16,"pic basic pro "] ' "pic basic pro" is 16 characters long
    pause 100
    I2CWRITE SDA,SCL,$A1,ADDR,[16,"Mechatronics "]
    LCDOUT $FE,1 'clear &home lcd screen (change this to position on screen you want your data)
    pause 100

    ADDR = 0
    WHILE ADDR < 16 'Character Loop to read the 16 bytes "pic basic pro"
    I2CREAD SDA,SCL,$A0,ADDR,[b1] 'read byte from eeprom
    lcdout b1 'display byte on lcd
    ADDR = ADDR + 1 'advance address to next eeprom location
    pause 100
    I2CREAD SDA,SCL,$A0,ADDR,[b2]


    wend 'done with all of string

    pause 100
    lcdout $FE, $0C
    pause 100

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: I'm having problems with reading a AT24C1024 EEPROM

    You really need to read the manual page 158 on I2CWRITE as the way you are using it is all wrong. You can not expect to write a string to a page like you are doing. Also you are writing the second string to another AT24C1024 from the looks of it. Is this correct?
    Dave Purola,
    N8NTA
    EN82fn

Similar Threads

  1. Problem reading 93c46 EEprom
    By dj.lambert in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 27th March 2009, 07:10
  2. Reading eeprom
    By Lotondo in forum Off Topic
    Replies: 1
    Last Post: - 21st February 2007, 18:37
  3. Reading EEPROM data?
    By Qacer in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 10th March 2006, 18:06
  4. problem of reading eeprom 24lc515
    By mike12 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 1st January 2006, 18:36
  5. 93c46 Eeprom Writing/reading Help
    By EDWARD in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 13th June 2005, 21:40

Members who have read this thread : 1

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