I2CWRITE not writing anything on PIC18F45K80


Closed Thread
Results 1 to 40 of 69

Hybrid View

  1. #1
    Join Date
    Feb 2013
    Posts
    1,150


    Did you find this post helpful? Yes | No

    Default Re: I2CWRITE not writing anything on PIC18F45K80

    Did a test with various size of arrays.
    If both arrays do not exceed 24 bytes total, then everything is fine. As they exceed 24 bytes, issues start to appear.

  2. #2
    Join Date
    Aug 2011
    Posts
    457


    Did you find this post helpful? Yes | No

    Default Re: I2CWRITE not writing anything on PIC18F45K80

    Fair enough, but what about this when x >= 16
    Code:
    if topline[x]=32 or botline[x]=32 then a=0
    if topline[x+1]=32 or botline[x+1]=32 then b=0 'blanker

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


    Did you find this post helpful? Yes | No

    Default Re: I2CWRITE not writing anything on PIC18F45K80

    I don't see any relation
    I modified code and X now changes from 0 to 14 - still same issue.

  4. #4
    Join Date
    Aug 2011
    Posts
    457


    Did you find this post helpful? Yes | No

    Default Re: I2CWRITE not writing anything on PIC18F45K80

    You've been using x, y, and z to get values to set a and b.
    You've been shoving invalid data out to the lcd and wondering why the display is wrong.

    It's probably still wrong.

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


    Did you find this post helpful? Yes | No

    Default Re: I2CWRITE not writing anything on PIC18F45K80

    LOL.
    I'm trying to explain that if I add one extra array definition, another array gets screwed. How this is related to LCD?
    I just wrote another code, which simply reads values of array and writes data on 1602LCD.
    Issue still exists - data in array gets damaged, if total array length exceeds 24 bytes.

  6. #6
    Join Date
    Aug 2011
    Posts
    457


    Did you find this post helpful? Yes | No

    Default Re: I2CWRITE not writing anything on PIC18F45K80

    I just did this with an 18F45K80
    Code:
    ' device = 18F45K80
    
    topline var byte [16]  'top part of the screen array
    botline var byte [16] 'bottom part of screen
    
    ix var byte
    ct var byte
    cb var byte
    
    ' clear arrays
    for ix = 0 to 15
        topline[ix] = 0
        botline[ix] = 0
    next ix
    
    ' read array data
    arraywrite topline,["0123456789ABCDEF"]
    arraywrite botline,["0123456789ABCDEF"]
    
    ix = 0
    
    'read array char by char
    for ix = 0 to 15
        ct = topline[ix]
        cb = botline[ix]
    next ix
    
    ix = 0
    When it gets to the end, topline and botline arrays are exactly as specified... each is 16 chars "0"-"F"
    Reading the arrays byte by byte also does as expected.
    I even added a third array of 16 chars... works too.

    Your problem is elsewhere... not with the arrays themselves.

  7. #7
    Join Date
    Feb 2013
    Posts
    1,150


    Did you find this post helpful? Yes | No

    Default Re: I2CWRITE not writing anything on PIC18F45K80

    Thanks, have you tried to read the same array several times?
    Problem is definitely in arrays, because if I make say topline 4 bytes and botline 16 bytes (even without writing anything to any of them) - there are no problems, but as soon their total "length" exceeds 24 bytes, issues start to appear.

  8. #8
    Join Date
    May 2013
    Location
    australia
    Posts
    2,666


    Did you find this post helpful? Yes | No

    Default Re: I2CWRITE not writing anything on PIC18F45K80

    Quote Originally Posted by tumbleweed View Post

    Your problem is elsewhere... not with the arrays themselves.
    code snippets , a complete waste of time and effort
    Warning I'm not a teacher

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 : 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