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 Confused but still no pins toggle

    Thanks for the input, I am confused however upon my reading (and re-reading the 23016 datasheet) writing to the config registers are:
    "First, the device is selected bt sending the slave address and setting the R/W bit to logic '0'. The command byte is sent after the address and determines which register will be written." and then it shows the waveforms for this.
    Address is sent 1st (according to the datasheet) and is 0-1-0-0-A2-A1-A0 and then the R/W bit. Next is the command byte (8 bits) and then the 2 data bits - Appaerntly this device uses 2 and accesses them automatically.

    All of this I think I get - but it still does not answer the fact that the data and clock pins do not toggle - AT ALL! I can see if I get my sequence wrong - but the lines should still toggle.

    Once I get the lines to at least toggle in some form, then I set myself to get the device to actually look like it may work.

    Any other ideas?

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


    Did you find this post helpful? Yes | No

    Default Updated PBP now looking for MPASM 5.20

    Mr. E-
    I have updated to PBP 2.50 (we had it just not loaded) and am looking for MPASM 5.20 and don't seem to find it on Microchip's website - where did you find it?

    I re-compiled with PBP 2.50 and MPASM 5.14 and get the same thing - just dead pins.......

    I also added the patch so I am now using PBP 2.50A.....
    Last edited by ecoli-557; - 16th May 2008 at 20:32. Reason: edit

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ecoli-557 View Post
    I re-compiled with PBP 2.50 and MPASM 5.14 and get the same thing - just dead pins.......
    Wondering...how do you in fact know that the pins are actually dead...i.e. not doing anything?
    I know you said "by a scope" back in post #1...but what do you mean by 'scope'? A freq. meter, a 1Khz BW o-scope? A good o-scope with a decent bandwidth?
    I begin to wonder if in fact the pins are really doing something, but the method you are using to see said something is faulty...because any pulses coming out of I2CC/I2CD would probably be too fast to see with an ordinary meter.

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


    Did you find this post helpful? Yes | No

    Default Troubleshooting gear

    Good thoughts, but, I am using a DSO with 100 MHz (not great but fast enough). And, remember (or not) I also remarked the coded for the I2C commands and added the same code used for the 'heartbeat' indication on an LED and watching the scope both lines followed the LED exactly. This should mean no sharts, the 23016 seems not to drag down the output of the PIC, etc.

    By rights it should work - I can not see why it won't. Regardless of the code issues, if the I2C command does anything it should 'wiggle' the pin and I am not seeing it. I have put the init section in its own loop and I still don't see any activity.

    My error label never gets activated so the proc thinks it is communicating with the 23016 but it is not.

    What else can I try? I appreciate the assist....

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    100Mhz DSO should be fast enough...although if you're viewing the signals in real time, you still might not see the pulses. Maybe slow the clock WAY down (i.e. 32khz internal clock) and see if you can see anything. Maybe connect the pins to a pulse counter or a freq counter and see if that shows anything. Or a 555 timer set up as a one-shot pulse stretcher (i.e. 1us pulse gets stretched to 1 second so you can see it)...

    Have you tried connecting a plain ol' 24LC256 serial eeprom type thing to the PIC and working with that just for grins and see what happens? Then after that works, move back to the other chip?


    Quote Originally Posted by ecoli-557 View Post
    ........This should mean no sharts
    You said 'sharts'

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


    Did you find this post helpful? Yes | No

    Default Well, Sharts!

    Well, oops <grin>, so much for engineers spelling......
    No, I have not tried a plain device, perhaps I should. I will try a few more desperate things before that this weekend.

    I will tie a logic probe to one of the pins and see what happens if anything.

    Thanks for the input. Any other ideas??

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


    Did you find this post helpful? Yes | No

    Default

    Seems i've overlooked this one..
    Code:
    @ __CONFIG _CONFIG4L, _LVP_ON_4L & _STVREN_ON_4L & _XINST_ON_4L & _DEBUG_OFF_4L
    Must be off as the compiler don't use the extended instruction set.

    DEFINE I2C_SLOW seems to do weird things here...

    EDIT: WHICH WILL BE FIX IF I DARE TO INSTALL THE LATEST PATCH
    * Adds support for PIC18F6628, 66J11, 66J16, 6723, 67J11, 8628, 86J11, 86J16, 8723 and 87J11.
    * Adds Microchip USB 1.2 fixes for PIC18.
    * Fixes USB for PIC18F87J50 series parts.
    * Sets Adcin default clock to rc for PIC16F882, 883, 884, 886 and 887.
    * Fixes Hpwm pin for PIC12F615, PIC12HV615, PIC16F616, 685, 690, 785, PIC16HV616 and 785.
    * Fixes Hserin2 timeout for PIC18.
    * Fixes I2C_SLOW Define for PIC18.
    * Fixes operator precedence in If..Then for long PIC18 (be safe - use parenthesis.)
    * Fixes Lookup2 for non-long PIC18.
    Last edited by mister_e; - 16th May 2008 at 23:18.
    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