A help with Write/Read a I2C memory


Results 1 to 26 of 26

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    in your first example, try to change to..
    Code:
    <font color="#000000">        @ __CONFIG _XT_OSC &amp; _WDT_ON &amp; _PWRTE_ON &amp; _BODEN_ON &amp; _LVP_OFF                  
            <font color="#000080">DEFINE </font>OSC 4
            <font color="#000080">INCLUDE </font>&quot;Modedefs.bas&quot;
            
            <font color="#000080">DEFINE </font>LCD_DREG PORTB
            <font color="#000080">DEFINE </font>LCD_DBIT 4
            <font color="#000080">DEFINE </font>LCD_RSREG PORTB
            <font color="#000080">DEFINE </font>LCD_RSBIT 3
            <font color="#000080">DEFINE </font>LCD_EREG PORTB
            <font color="#000080">DEFINE </font>LCD_EBIT 2
            
            SDA <font color="#000080">VAR </font>PORTC.4
            SCL <font color="#000080">VAR </font>PORTC.3
            
            J <font color="#000080">VAR WORD
            </font>i <font color="#000080">VAR WORD
            
            </font>c <font color="#000080">VAR BYTE
            </font>variabila1 <font color="#000080">VAR BYTE
            </font>variabila2 <font color="#000080">VAR BYTE        
            </font>variabila1=&quot;A&quot;
            variabila2=&quot;B&quot;
            
            i=0
            J=0
            
            ADCON1 = 7
            TRISB = 0
    
    start:
    
            <font color="#000080">I2CWRITE </font>SDA, SCL,$A0,i,[&quot;TEXT1&quot;,variabila1,&quot; TEXT2&quot;,variabila2]
            <font color="#000080">LCDOUT </font>$FE,1
            <font color="#000080">LCDOUT </font>$FE,$80,&quot;INCERCARI&quot;
            <font color="#000080">LCDOUT </font>$FE,$C0
            
            <font color="#000080">FOR </font>J = 0 <font color="#000080">TO </font>12
                <font color="#000080">I2CREAD </font>SDA, SCL,$A0,J,[c]
                <font color="#000080">LCDOUT </font>c
                <font color="#000080">NEXT </font>J
    
            @   <font color="#000080">GOTO </font>$
    Last edited by mister_e; - 27th March 2008 at 21:23.
    Steve

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

Similar Threads

  1. I2C Master/Slave 16F88/16F767 working code
    By DanPBP in forum Code Examples
    Replies: 2
    Last Post: - 23rd October 2012, 22:31
  2. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 21:07
  3. I2C Master Slave issues.
    By cpayne in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 29th March 2008, 19:33
  4. Please help with i2cslave i2c slave
    By cycle_girl in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st December 2005, 13:55
  5. I need help with i2c memory
    By -c3- in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 23rd June 2005, 19:57

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