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 16F690 and 24LC16B memory - can't WRITE 8 different bytes in a row

    This is what I get with your suggestion:
    Code:
    EeCtrl=$a0 + 2 ;using block 1 ie 1<<1=2
        i2cwrite SDA,SCL,EeCtrl,0,[1,2,3,4,5,6,7,8]
    EeWP = 1
    Name:  2020-12-30 10_32_49-Window.png
Views: 3302
Size:  1.7 KB


    Something is also even more confusing to me. As you wrote, the address has to be WORD sized - this is also stated in the DS.

    In my code, I have it ("EeCtrl") as a BYTE. If I change it to a WORD, it doesn't make any difference.

    Your last suggestion with a WORD sized EeCtrl var gives this result:

    Name:  2020-12-30 10_42_42-Window.png
Views: 3283
Size:  2.3 KB


    Maybe I'm messing things up in the I2CWRITE command because I understand it this way and both vars (EeCtrl and EeAddress) are looking to be BYTE long:
    Name:  2020-12-30 10_52_01-Clipboard.png
Views: 3325
Size:  8.6 KB


    To be honnest, I don't get that thing with the WORD sized address...
    Roger

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


    Did you find this post helpful? Yes | No

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

    the closest eprom i have is a xc24c16 which is pretty similar


    this works for me

    Code:
        DEFINE OSC 8                 
     sda var portc.1 
      sck var portc.2
              TMP VAR byte[3]
            
    
    
           osccon=$70    '8 mhz
             ansel=0       'dig i/o
             CMCON0=7        ' compare off 
             trisa=%001110
             trisc=%111111
    
    
             serout2 porta.0,84, ["ready ",13,10]  
                                   
         i2cwrite  sda,sck,$aa,$38,[1,30,52]     
          
     
       
        main: 
        
    
    
    
    
    
    
        i2cread sda,sck,$aa,$38,[str tmp \3 ] 
    
    
         serout2 porta.0,84, ["d " , #tmp[0] ,"," , #tmp[1] ,"," , #tmp[2] ,",",13,10]
         
       pause 4000 
       goto main
    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 Re: 16F690 and 24LC16B memory - can't WRITE 8 different bytes in a row

    Quote Originally Posted by richard View Post
    the closest eprom i have is a xc24c16...
    Thank you very much Richard.

    Unfortunately, even with your code example, it looks hopeless

    I should be able to grab another identical chip (or maybe a 24LC64...) by tomorrow or the day after.
    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