I need help with i2c memory


Results 1 to 18 of 18

Threaded View

  1. #1
    Join Date
    Jun 2005
    Posts
    7

    Default I need help with i2c memory

    For my senior project we are using a pic16f84. A large part of the project is storing data in a serial memory chip usint i2c. ive spent 5ish hours trying to figure this out. went through data sheets and searched online, still no success. i am confident my circuit is wired correctly. any help would be greatly appriciated.

    the memory used currently is microchip's 24AA512, we also have a 24c01 laying around to play with as well.
    i have 2 pull up resistors (5.1k) on scl and sda
    write protect is grounded

    here is my code,

    addr var byte
    sda var byte
    scl var byte
    contR con %10100001
    contW con %10100000
    x var byte 'test data'
    sda=PORTB.0
    scl=PORTB.1

    addr=%00000000
    x=3 'test data is the number 3'
    pause 100 'pause just for fun'

    I2Cwrite sda,scl,contW,addr,[x] 'should write 3 to address 0, right?'
    pause 10
    I2Cread sda,scl,contR,addr,[x] 'should read the data'
    pause 10
    serout Portb.2,4,[x] 'displays data on an LCD'


    end

    Thanks!
    Last edited by -c3-; - 16th June 2005 at 00:04.

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. A help with Write/Read a I2C memory
    By Eugeniu in forum mel PIC BASIC Pro
    Replies: 25
    Last Post: - 28th March 2008, 13:53
  5. Please help with i2cslave i2c slave
    By cycle_girl in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st December 2005, 13:55

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