24fc512


Closed Thread
Results 1 to 3 of 3

Thread: 24fc512

Hybrid View

  1. #1
    Beavis's Avatar
    Beavis Guest

    Default 24fc512

    anyone got a 24fc512 to work using i2c? ic2write and read? cant seem to get this to work with this code:

    Code:
    CONTROL = %10100000' CONTROL ADDRESS OF 24FS512
    '************************************************************
    b1="0"
          '  FOR B0 = 0 TO 15              
                    I2CWRITE SDA,SCL,control,%0001,$156
                    PAUSE 100               ' DELAY 10MS AFTER EACH WRITE
                    
           ' NEXT B0
    
    LOOP:   
                    I2CREAD SDA,SCL,control,%0001,[B1]
                    LCDOUT $FE,$80, bin16 B1
                     LCDOUT $FE,$c0, dec B1
                    
                    pause 2000
                    
                    LCDOUT, $FE,$1 'CLEAR LCD
    			PAUSE 1500
           
    
           	 
    		
            GOTO LOOP

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    that's for sure
    1. adress must be a word sized variable
    2. your I2Cwrite statement is not write correctly

    try this

    Code:
    addr var word
    B0 var byte
    control con %10100000
    clear
    
    Start:
    
    FOR B0 = 0 TO 15            
          I2CWRITE SDA,SCL,control,addr,[B0]
          PAUSE 10               
          addr=addr+1
    NEXT B0
    
    for addr=0 to 15
         I2CREAD SDA,SCL,control,addr,[b0]
         LCDOUT $FE,1,"addr = ",dec addr,_
                $FE,$C0,"data = ", dec b0
         pause 1000      
    next
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Beavis's Avatar
    Beavis Guest


    Did you find this post helpful? Yes | No

    Default

    thanks, dunno how i missed that, thought I tried everything....guess not

Similar Threads

  1. I2CREAD issues with 24FC512 EEPROM
    By circuitpro in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2010, 18:52

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