16F690 and 24LC16B memory - can't WRITE 8 different bytes in a row


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Byte...word ???

    Sorry to ask again Richard, but I really don't understand this "WORD" story. I'm french speaking so I may not fully understand your explanation

    In "i2cwrite sda,sck,$aa,$38,[1,30,52]", $AA (=EeCtrl) and $38 (=EeAddress) have BYTE sizes, no?

    Do you mean the I2C command will transform the two BYTE variables in one WORD sized one?
    Roger

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,644


    Did you find this post helpful? Yes | No

    Default Re: 16F690 and 24LC16B memory - can't WRITE 8 different bytes in a row

    the control word to address an individual memory cell is 16 bits long for that eeprom
    made up as ->
    $a0 + block <<1 + r/rw [0 for pbp] + eeaddress [0-255]
    for example block=5,cell 0x38
    0xA0 + 5<<1 + 0 = 0xAA , high byte of word
    address=0x38 ,
    low byte of word
    this word is transmitted as two bytes, big end first ,

    other eeproms have other schemes where cell address is a word and the device control address byte is a constant
    based on address pins plus device code.
    address =0x538
    i2cwrite sda,sck,$a0,address,[1,30,52]

    Do you mean the I2C command will transform the two BYTE variables in one WORD sized one?
    no , the eeprom will interpret the two bytes as a 16 bit value
    Warning I'm not a teacher

  3. #3
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Working fine after chip replacement

    Thanks a lot for your patience and clear explanation

    BTW, I changed my chip...and all is working fine now.

    I've put my last working test program in attachment.
    Attached Files Attached Files
    Roger

Similar Threads

  1. 16F690 read/write
    By louislouis in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 17th December 2016, 09:21
  2. Save some bytes in program memory
    By Ioannis in forum Code Examples
    Replies: 11
    Last Post: - 10th February 2012, 16:17
  3. How to Read / Write I2c 24LC16B EEprom
    By odie52 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 5th May 2010, 03:00
  4. Need the code to write to a memory
    By Hamlet in forum General
    Replies: 0
    Last Post: - 20th August 2007, 00:22
  5. cannot read/write to 16F690 data memory after CPD_ON
    By awdsas in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 22nd November 2006, 11:46

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