I2CWRITE not writing anything on PIC18F45K80


Closed Thread
Results 1 to 40 of 69

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,653


    Did you find this post helpful? Yes | No

    Default Re: I2CWRITE not writing anything on PIC18F45K80

    provided it is wired correctly and the chip is pcf8574 the original code works just fine
    although technically
    TRISD=%00000000 'set PORTD as output all
    should be
    TRISD=%00001100 'set PORTD

    Name:  k80.jpg
Views: 6906
Size:  224.7 KB
    Warning I'm not a teacher

  2. #2
    Join Date
    Feb 2013
    Posts
    1,132


    Did you find this post helpful? Yes | No

    Default Re: I2CWRITE not writing anything on PIC18F45K80

    The chips are PCF8574T.
    I have pull up resistors 4.7K and SDA and SCL pins of 3 pcs. PCF chips are in parallel.
    I tried adding that cont variable and changing TRIS for D port pins. Still nothing.
    On the startup, SCL gets high and that's all, there is no activity on these pins.
    But if I run simple high/low statements for those pins, then I can see these pins getting high or low on scope.

  3. #3
    Join Date
    Feb 2013
    Posts
    1,132


    Did you find this post helpful? Yes | No

    Default Re: I2CWRITE not writing anything on PIC18F45K80

    By the way, I have DS3231 hooked to another pins of same CPU.
    It also not working - no activity on SDA/SCL pins while performing I2CREAD.
    So maybe some config error?

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,653


    Did you find this post helpful? Yes | No

    Default Re: I2CWRITE not writing anything on PIC18F45K80

    So maybe some config error?
    if you mean its wiring error or the chips aren't what you say , probably

    schematic ?
    Warning I'm not a teacher

  5. #5
    Join Date
    Feb 2013
    Posts
    1,132


    Did you find this post helpful? Yes | No

    Default Re: I2CWRITE not writing anything on PIC18F45K80

    No, there is no wiring error and when using HIGH or LOW statements, I can pull these pins up and down as normal.
    I mean, maybe there is some config error for 18F, which prevents I2CREAD/I2CWRITE from working?

  6. #6
    Join Date
    May 2013
    Location
    australia
    Posts
    2,653


    Did you find this post helpful? Yes | No

    Default Re: I2CWRITE not writing anything on PIC18F45K80

    to be clear

    provided it is wired correctly and the chip is pcf8574 the original code works just fine
    Warning I'm not a teacher

  7. #7
    Join Date
    Aug 2011
    Posts
    455


    Did you find this post helpful? Yes | No

    Default Re: I2CWRITE not writing anything on PIC18F45K80

    Change CONFIG XINST setting to OFF.

    Very few compilers are compatible with ON

  8. #8
    Join Date
    Feb 2013
    Posts
    1,132


    Did you find this post helpful? Yes | No

    Default Re: I2CWRITE not writing anything on PIC18F45K80

    Yes, you were right!
    Also XINST messes with LCDOUT.
    When XINST=ON, then DEC/HEX/BIN etc. modifiers of LCDOUT statement do not work.

    But why this is not mentioned in manual?
    Also, turning off XINST means we're turning off these extended instructions of 18F, so loosing all advantages these series have?

Similar Threads

  1. DT_Ints with PIC18F45K80 problem
    By Zapman in forum Code Examples
    Replies: 2
    Last Post: - 20th April 2022, 01:43
  2. Replies: 9
    Last Post: - 27th January 2015, 13:57
  3. PIC18F45K80 runs way to fast.
    By bmoe79 in forum PBP3
    Replies: 3
    Last Post: - 19th December 2014, 13:24
  4. I2CWrite issue
    By robertmark68 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 20th September 2006, 01:30
  5. I2CWRITE writing Strings to EEPROM
    By NavMicroSystems in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 27th March 2005, 19:45

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