Need code help for I2C in Pic16f877

Discussion in 'Programmer's Corner' started by RRITESH KAKKAR, Sep 8, 2012.

  1. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    Hi,

    I need help for writing code for I2C in C lang for PIC16F877. i have readied the working of SCL and SDA but i have no idea how to start programming of it i am using MAP lab Hi-tech C compiler....


    Thanks
     
  2. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Have you looked at the examples that follows HI-TEch C. Also what kind of reading have you done. Microchip has a good PDF tutorial on I2C. And then of course the datasheet should also be a good source of information.
     
  3. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    I had issues using I2C and SPI in Hi-Tech C (lite version).... I ended up just Bit Banging the I2C and SPI routines I used.... What do you need to communicate with via I2C??
     
  4. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    I will like to do in C or C++ (this motor driver.....)
     
    Last edited: Sep 8, 2012
  5. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
  6. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    Hi,

    I have seen that Code before but u think it will work for speed control and how?
     
  7. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    I think i should learn some basic so my thread start here...
     
  8. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    Thanks for help....

    I have BLDC motor and now i want to control its speed here is the speed control which work with PPM or I2C.
    please help me to write code for it.....
     
Loading...