Search Results - MEL PICBASIC Forum


Search:

Type: Posts; User: CuriousOne; Keyword(s):

Search: Search took 0.00 seconds.

  1. Replies
    30
    Views
    15,420

    Re: I2CRead & I2CWrite not working as expected

    I will use everything different - LCD, PIC, EEPROM and will check again...
  2. Replies
    30
    Views
    15,420

    Re: I2CRead & I2CWrite not working as expected

    yes it is read routine - it reads eeprom only once.
  3. Replies
    30
    Views
    15,420

    Re: I2CRead & I2CWrite not working as expected

    Maybe read routine is faulty?
  4. Replies
    30
    Views
    15,420

    Re: I2CRead & I2CWrite not working as expected

    Here is full complete code.



    ;----[16F886 Hardware Configuration]--------------------------------------------
    #CONFIG
    cfg1 = _INTRC_OSC_NOCLKOUT ; INTOSCIO oscillator: I/O function on...
  5. Replies
    30
    Views
    15,420

    Re: I2CRead & I2CWrite not working as expected

    The code which I've posted, which writes 99 into eeprom.
    I replace 99 with any other value - it works.
    I put variable name into brackets - it writes zeroes into eeprom.
    no matter what type of...
  6. Replies
    30
    Views
    15,420

    Re: I2CRead & I2CWrite not working as expected

    Pins are configured properly, LCD also working fine.



    TRISA=%00000000 'SET A TO OUTPUT
    TRISC=%00001101
    TRISB=%00011000
    ANSELH=%00000000 ' ADC OFF B
    ANSEL=%000000000 ' turn off...
  7. Replies
    30
    Views
    15,420

    Re: I2CRead & I2CWrite not working as expected

    DPIN Var PORTA.2 ' I2C data pin
    CPIN Var PORTA.1 ' I2C clock pin
    B0 Var word
    B1 Var byte
    B2 Var byte
    X var byte
    x=0


    For B0 = 0 To 15
  8. Replies
    30
    Views
    15,420

    Re: I2CRead & I2CWrite not working as expected

    I tried to add brackets and now it starts working, but in the weird way.

    I2CWRITE DPIN,CPIN,$A0,B0,[127]
    Writes 127 into eeprom
    but if I substitute variable there, no matter, byte or word...
  9. Replies
    30
    Views
    15,420

    Re: I2CRead & I2CWrite not working as expected

    Well, if there's syntax error, compiler should warn about it, right?
  10. Replies
    30
    Views
    15,420

    Re: I2CRead & I2CWrite not working as expected

    I set up I2C capture and it looks suspicious.
    The 1st entry at "data" is actually and address of the chip
    and 3rd entry - the address I'm sending to it for reading
    but I'm getting no response?
    ...
  11. Replies
    30
    Views
    15,420

    Re: I2CRead & I2CWrite not working as expected

    Oh by the way, I swapped chip with 24C04N - no difference.
  12. Replies
    30
    Views
    15,420

    Re: I2CRead & I2CWrite not working as expected

    Here I connected the scope.
    This is how this code looks:
    My scope (Hantek DSO2D10) Has I2C decode function, but I can't get it running properly.


    mainloop:


    For B0 = 0 To 15 step 2
    ...
  13. Replies
    30
    Views
    15,420

    Re: I2CRead & I2CWrite not working as expected

    I will try grounding. I will also hook up scope to see what happens.
    I do have pull up resistors in place for SDA/SCL pins.
    Regarding how I know about datasheet?
    I bought this IC from digikey, and...
  14. Replies
    30
    Views
    15,420

    Re: I2CRead & I2CWrite not working as expected

    From the datasheet:


    DEVICE/PAGE ADDRESSES (A2, A1, A0): The A2, A1 and A0 pins are device address
    inputs that are hard wired or left not connected for hardware compatibility with
    AT24C16. When...
  15. Replies
    30
    Views
    15,420

    Re: I2CRead & I2CWrite not working as expected

    SDA var PORTA.1
    SCL var PORTA.2
    T1 var byte
    T1=15
    I2CAddress var word 'I2C address
    I2CDevice var byte 'I2C device add
    i2CDevice=$A0
    I2CAddress=8
    I2CWrite SDA,SCL,I2CDevice,I2CAddress,127...
Results 1 to 15 of 15