I2CWRITE and 18F4680


Closed Thread
Results 1 to 40 of 41

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Patches and more.....

    I have the patch installed and it is reported as 2.50a by Microcode Studio.

    I have put in this code based on what you posted:

    define I2C_SLOW
    'Constant list
    GP_port con 0
    LAT_port con 2
    IOdir con 6
    iaddr con $20
    'Variables
    ireg var byte
    'Set up the 23016
    ireg=IOdir
    i2cwrite idata,iclock,iaddr,ireg,[0,0] 'Sets GP0.0-GP0.7 as OUTPUTS
    pause 20
    'Write to the 23016
    ireg=GP_port
    i2cwrite idata,iclock,iaddr,ireg,[0,0]
    pause 20
    ireg=LAT_port
    i2cwrite idata,iclock,iaddr,ireg,[0,0]

    And the ports are all still high, I agree with you, the chip did not accept the first command.

    Did I understand your code?

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


    Did you find this post helpful? Yes | No

    Default

    What if you comment the DEFINE line?

    Would help if i had this chip here
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    Could you attach the compiled .HEX file here (in a ZIP file), so i could see if the signal are correct?

    May worth to try to reduce those pull-ups from 4.7K to let's say 1.8 K
    Last edited by mister_e; - 17th May 2008 at 00:19.
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default



    How about
    Code:
     iaddr CON $40
    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