I2CWRITE and 18F4680


Closed Thread
Results 1 to 40 of 41

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Are you using a OSC module or crystal?
    Steve

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

  2. #2
    Join Date
    Sep 2007
    Location
    Waco, Texas
    Posts
    151


    Did you find this post helpful? Yes | No

    Default Oscillator

    I am now using a 20 MHz oscillator fed into A.7
    I also tried downloading the MPASM again from the MELABS site - no change.....

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


    Did you find this post helpful? Yes | No

    Default

    Don't forget, the timeout label OF I2CWRITE perform a GOTO not a GOSUB, maybe why you have odd results.... stack underflow.

    What happen if you loop within the INIT section?
    Code:
    init:
            pause 1000 'Hold here for a bit while things IPL......
            LCDOUT $FE,1,"I'm alive!"
            heart=1 'Turns off HEARTBEAT led
            fault=1 'Turns off FAULT led
            for i2c_addr=0 to 7
                 i2cwrite idata,iclock,$06,i2c_addr,[$00,$FF] 'Sets GP0.0-GP0.7 as OUTPUTS
                 pause 20
                 i2cwrite idata,iclock,$07,i2c_addr,[$FF,$00] 'Sets GP1.0-GP1.7 as INPUTS
                 pause 20
                 next
            GOTO init
    Last edited by mister_e; - 16th May 2008 at 18:44.
    Steve

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

  4. #4
    Join Date
    Sep 2007
    Location
    Waco, Texas
    Posts
    151


    Did you find this post helpful? Yes | No

    Default Thanks for the response and interest.....

    Mr. E-
    I added a GOTO at the end of the INIT section (tight loop) and still the pins don't reflect any movement - they are both high.

    BTW, MPASM 5.14, MCS 2.3.0.0, PBP 2.47.

    I am no Guru but have coded before and this is driving me nuts! 2 different board designs but using the same chip gives the same symptom.......I swear it seems that the command offers no response.

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


    Did you find this post helpful? Yes | No

    Default

    Is the LCD's working?
    Steve

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

  6. #6
    Join Date
    Sep 2007
    Location
    Waco, Texas
    Posts
    151


    Did you find this post helpful? Yes | No

    Default Everything else IS working but not the I2C command

    Yes, all esle is working as expected. When I start a project I use the LCD as a debugging tool and all the messages I write to it are working. ALso the heartbeat LED is blinking showing me that I am looping in the main part and that the proc is counting correctly.

    Everything BUT the I2C commands - nothing from the pin!!

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


    Did you find this post helpful? Yes | No

    Default

    Well that's strange... i have activity here on both pins with the same PIC, but 20MHZ external crystal (not the problem here as your LCD work)

    PBP 2.50, MPASM 5.20.

    I would check for a short somewhere...
    Steve

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

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