Jump to content

tpcf

Members
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About tpcf

  • Rank
    Newbrie
  1. I have been trying to use the i2c_driver.h with a PIC 16F877 and a 24LC256 Serial EEPROM. The only way i could get the code to run was to modify the header file so that i could #define an I2C_MODE with the proper parameters (as in the rs232_driver.h) What i did is the following: Replaced //////////////////////////////////////////////////////////////////////////// // i2c hardwareware implementation template arguments //////////////////////////////////////////////////////////////////////////// #define i2c_ARGS 3, PORTC, TRISC, 4, PORTC, TRISC, e_SSPCON1, e_SSPCON2, \ e_SSPSTAT, e_SSPBUF, e_SSPIF_BIT, e_SSPIF_PIR, \ e_BCLIF_BIT, e_BCLIF_PIR, 7, e_SSPADD, (i2c_reset_wdt | i2c_SMP |i2c_HW) with //////////////////////////////////////////////////////////////////////////// // i2c hardwareware implementation template arguments //////////////////////////////////////////////////////////////////////////// #define i2c_ARGS 3, PORTC, TRISC, 4, PORTC, TRISC, e_SSPCON1, e_SSPCON2, \ e_SSPSTAT, e_SSPBUF, e_SSPIF_BIT, e_SSPIF_PIR, \ e_BCLIF_BIT, e_BCLIF_PIR, 7, e_SSPADD, I2C_MODE in my program and added #define I2C_MODE (i2c_HW | i2c_SMP) I also commented out the duplicate redefinitions of PORTC and TRISC and remapped all registers for a PIC16F877 Is this correct or am i doing something wrong? Any help or feedback would be greatly appreciated
×
×
  • Create New...