I2c write&read


Closed Thread
Results 1 to 16 of 16

Thread: I2c write&read

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    10K is also a little high... drop it by at least half to say 4K7.

  2. #2
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default

    Hello All,

    the deviec is 16f628. the OSC 20Mhz (internal OSC, so R is ~10k-12K)
    and the 24lc256 is BYTE SIZE. (32K X8 BIT)
    the address is variable.

    i will change to 4.7k and redefine eeprom address.

    however the fuse defined: (work well )

    OSC: INTRO CLOCKOUT
    MCLR: INPUT PIN
    (all other defined in the fuse window: marain unchange)

    thank for all

    regards,

  3. #3
    Join Date
    Dec 2007
    Location
    Finland
    Posts
    191


    Did you find this post helpful? Yes | No

    Post Rtfm ;)

    Hi MInhle,

    Check the link and see the table.
    I2CRead/I2CWrite part of PicBasic Pro manual

    What is address size for over 24LC16 (2K bytes) devices?


    BR,
    -Gusse-

  4. #4
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default

    thank Gusse,

    i replaced data address (I: in this case) by WORD . . and/or change R from 10K to 6K. ..it doesnot work.

    (in the data sheet of 24lc256 dooesnot mention anything data address.

    VOLTAGE drop across: R_SCL (10K or 6K) : ~5V (unchanged)
    R_SDA (10K or 6K): ~2.5V

    !! is it possible the EEPROM: DEATH??

  5. #5
    Join Date
    Dec 2007
    Location
    Finland
    Posts
    191


    Did you find this post helpful? Yes | No

    Post

    Hi MInhle,

    If you are running with internal oscillator then speed is 4MHz, not 20MHz. Also you should tell that to compiler.
    14.2.6 INTERNAL 4 MHZ OSCILLATOR
    The internal RC oscillator provides a fixed 4 MHz
    (nominal) system clock at VDD = 5V and 25°C, see
    “Electrical Specifications” section for information on
    variation over voltage and temperature.
    Code:
    DEFINE OSC 4
    Quote Originally Posted by MINHLE View Post
    OSC: INTRO CLOCKOUT
    14.2.7 CLKOUT
    The PIC16F62X can be configured to provide a clock
    out signal by programming the configuration word. The
    oscillator frequency, divided by 4 can be used for test
    purposes or to synchronize other logic.
    CLKOUT is RA6, which is also your I2C data pin. Disable CLKOUT or change I2C data pin to other IO.

    If you are not using comparator then disable those.
    Code:
    CMCON = 7
    I hope these modifications will bring up some life to your EEPROM interface.

    BR,
    -Gusse-

  6. #6
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default

    hello GUSSE,

    i got a BONUS now. the led is on (pin2 only) and flash

    i lookk for error in teh program and let u knoow later

    thanks for your help

  7. #7
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default

    HI Gusse,

    the modifications were made.
    as indicated.

    defined OSC 4 ;no effect: ( INTCLOUT is set in the fuse window)
    SDA PORTA.3
    SCL PORRT.4
    ......

    R_SDA & R_SCL: 4.5k
    a led on portb flashed is due to error that i cannot see where it comes from


    not write nor read. i assume EEPROM???

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. PIC16F877 I2C programme
    By cooqo in forum mel PIC BASIC
    Replies: 3
    Last Post: - 21st April 2008, 10:02
  4. I2C Master Slave issues.
    By cpayne in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 29th March 2008, 19:33
  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