4 Visitor Messages

  1. View Conversation
    Leonardo,
    The code was written for a customer so i can't just send it to you as it is. When i have a free moment I'll try to post something on the wiki with code examples.
    Barak
  2. 'Receive a byte from the I2C bus and place it into variable VAR1.
    Symbol Control2 = % 10010001
    Address = 0xaa ' Read the value at address
    I2Cin SDA, SCL, Control , Address, [ VAR1 ] ' Read the byte
    Print At 4,1,Inverse 0,Dec VAR1
  3. my code is ----->

    ' Send a byte to the I2C bus.
    Dim VAR1 As Byte ' We'll only read 8-bits
    Dim Address As Word ' 16-bit address required
    Symbol Control = % 10010000 ' Target
    Symbol SDA = PORTC.4 ' Alias the SDA (Data) line
    Symbol SCL = PORTC.3 ' Alias the SSL (Clock) line
    Address = 0xa1 ' Write to address
    VAR1 = 100 ' The value place into address
    I2COUT SDA, SCL, Control , Address , [ VAR1 ] ' Send the byte
    DelayMS 10 ' Allow time for allocation of byte
    Address = 0xa2 ' Write to address
    VAR1 = 5 ' The value place into address
    I2COUT SDA, SCL, Control , Address , [ VAR1 ] ' Send the byte
    DelayMS 10 ' Allow time for allocation of byte
  4. could you please help me, i am trying to make i2c connection but none of the codes in proton help could run perfectly(I can not get a response).
    connection is between DS1621(temperature sensor) and Pic16f877a


    I printed it to a GLCD and it prints 0
Showing Visitor Messages 1 to 4 of 4
About wirecut

Basic Information


Date of Birth
September 13
About wirecut
Your Interests:
CNC, electronics, FW & SW.
Your Occupation:
HW, SW, FW & automation consultant

Statistics


Total Posts
Total Posts
457
Posts Per Day
0.13
Visitor Messages
Total Messages
4
Most Recent Message
7th October 2015 18:23
Thumbs Up?
Thumbs Up Received
1
Thumbs Up Given
0
General Information
Last Activity
Yesterday 06:58
Join Date
26th May 2008

1 Friend

  1. Tim Tim is offline

    Fanatical Contributor

    Tim
Showing Friends 1 to 1 of 1

wirecut's Downloads

  Filename Total Downloads Rating Files Uploaded Last Updated