i2c PBP questions


Results 1 to 15 of 15

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    Try this one, it's working here
    Code:
    define LOADER_USED 1
    disable debug
    Data_READ   var byte
    Data_Write  var byte
    Bad         var bit
    ADDR        var word
    SDA         var PORTC.4
    SCL         var PORTC.3
    Control     con $A0
    
    Bad = 0
    
    Start:
        For addr=0 to $FFFF
            
            data_write=addr.lowbyte
            bad = 0
            I2CWRITE sda,scl,control,ADDR,[data_write]
            PAUSE 10 
    
            I2CREAD sda,scl,control,ADDR,[Data_read]
            enable debug
                data_read=data_read ' refresh ICD display
            disable debug
            if data_read != data_write then bad=bad +1
    
            next
        GOTO Start
    Last edited by mister_e; - 2nd February 2007 at 04:09.
    Steve

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

Similar Threads

  1. explanation on I2C command (PBP)
    By F1CHF in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 12th May 2014, 06:30
  2. I2C Master/Slave 16F88/16F767 working code
    By DanPBP in forum Code Examples
    Replies: 2
    Last Post: - 23rd October 2012, 23:31
  3. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 22:07
  4. I2C Master Slave issues.
    By cpayne in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 29th March 2008, 20:33
  5. Still new to PicBasic - i2c questions
    By cometboy in forum mel PIC BASIC
    Replies: 4
    Last Post: - 13th November 2006, 19:27

Members who have read this thread : 1

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