Another attempt for I2C eeprom, this time - 25C256.


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,621


    Did you find this post helpful? Yes | No

    Default Re: Another attempt for I2C eeprom, this time - 25C256.

    Yeah, you really should spend some time getting that logic analyzer working and understand what it does. It's NOT an oscilloscope and although newer versions of the software does allow it to continously stream and display that's not really its intended purpose.

    Anyway, here's what I'd try (and I'd have the logic analyzer hooked up)
    Code:
    Chip_Address	VAR BYTE
    Mem_Address	VAR WORD
    sda		VAR portb.1
    scl		VAR portb.0
    
    Chip_Address = 160
    
    ' The chip address must be a BYTE, this is the 160 + whatever A0-A2 is set to.
    ' The memory address must be a WORD for the 24C256, this is the address of the byte to written (or read)
    ' The data to be written is, in this case, a BYTE but it does not have to be, you can write words or arrays - which are obviously just multiple bytes...
    
    FOR Mem_Address = 0 to 12
      '        I/O  I/O       BYTE        WORD             BYTE
      I2CWrite sda, scl, Chip_Address, Mem_Address, [Mem_Address.LOWBYTE]
    NEXT
    And I'd like to thank Richard for the primers on PBP I2C the last couple of days, much appreciated!

  2. #2
    Join Date
    Feb 2013
    Posts
    1,153


    Did you find this post helpful? Yes | No

    Default Re: Another attempt for I2C eeprom, this time - 25C256.

    WOW! Finally it works!

    Code:
    x var word
    y var byte
    adr var byte
    sda var portc.0
    scl var portc.1
    lcdout $fe, $01, " "
    adr=160
    
    
    for X=0 to 5 
    I2CWrite sda, scl, adr, x, [x.lowbyte]
    lcdout $fe, $14, dec x
    
    
    pause 100
    next
    pause 500
    lcdout $fe, $1, "Complete:" 
    lcdout $fe, $c0, " "
    pause 500
    
    
    for x=0 to 5  
    i2cread sda, scl, adr, x, [y]
    lcdout $fe, $14, dec y
    pause 100
    next
    stop
    That's very good, this means now I can do a lot of LCD things!

    Thanks everyone!

    by the way, I tried to write 160 directly, instead of adr - also works.

  3. #3
    Join Date
    Feb 2013
    Posts
    1,153


    Did you find this post helpful? Yes | No

    Default Re: Another attempt for I2C eeprom, this time - 25C256.

    Now I need bitwise hex editor - one that allows editing hex file by bits, not by bytes. Any ideas

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,621


    Did you find this post helpful? Yes | No

    Default Re: Another attempt for I2C eeprom, this time - 25C256.

    Not directly and the following isn't a hex editor but if it's intended purpose is to create "content" for LCDs then https://www.mikroe.com/glcd-font-creator might be what you're looking for.
    Here's another one https://www.buydisplay.com/lcd-font-maker and another https://kapusta.cc/2020/03/20/fontedit/

    I've not used any of them, I know Richard is using the one from MikroE.

  5. #5
    Join Date
    Feb 2013
    Posts
    1,153


    Did you find this post helpful? Yes | No

    Default Re: Another attempt for I2C eeprom, this time - 25C256.

    Yes I know all these
    The issue with Mikroe "creation" is it, as everything else done by them, is written with left feet- need admin priviledges to run it, and it outputs fonts rotated by 90 degrees
    But currently I don't need font editor or graphics editor, I already have all that done, just need some hex editor to put everything into single file and adjust bits as necessary.

    Oh and another issue, which deserves separate topic is how to emulate LCDOUT statement, because it can't send $FE to display

  6. #6
    Join Date
    Feb 2013
    Posts
    1,153


    Did you find this post helpful? Yes | No

    Default Re: Another attempt for I2C eeprom, this time - 25C256.

    Not exact match, but HxD hex editor does the job almost in the way I see it.

  7. #7
    Join Date
    May 2013
    Location
    australia
    Posts
    2,680


    Did you find this post helpful? Yes | No

    Default Re: Another attempt for I2C eeprom, this time - 25C256.

    The issue with Mikroe "creation" is it, as everything else done by them, is written with left feet- need admin priviledges to run it, and
    make an icon and assign admin to it , not a problem. running in compatibility mode can help if it wont save stuff w10 is ok without it

    it outputs fonts rotated by 90 degrees
    glcd mode is data by column, tft mode is data by row , there is no problem
    you need to massage the data a little for pbp but its no big deal
    Warning I'm not a teacher

Similar Threads

  1. i2c non-eeprom examples?
    By justDIY in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 22nd January 2010, 18:07
  2. Using eeprom for the first time- Help please
    By financecatalyst in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 12th October 2009, 03:16
  3. Help with i2C eeprom
    By Squibcakes in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 17th March 2006, 00:33
  4. Real Time Clock & Eeprom
    By smart_storm in forum General
    Replies: 8
    Last Post: - 17th February 2006, 19:03
  5. I2C EEPROM Programming
    By Rob in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 23rd March 2005, 15:03

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