unsigned char EEByteWrite( PARAM_SCLASS unsigned char control,
                           PARAM_SCLASS unsigned char address,
                           PARAM_SCLASS unsigned char data );
unsigned int  EERandomRead( PARAM_SCLASS unsigned char control, PARAM_SCLASS unsigned char address );

I can find the prototypes of EEByteWrite and EERandomRead functions in library file i2c.h but I can't find the whole functions where their whole working has been defined. I want to change the data type of one argument (unsigned char address-unsigned int address) but only changing the type in the prototype isn't working so I want to change the function accordingly. Anybody knows where theses functions are. If not plz help me to put value more than 255 in unsigned char address so I can complete my project.

I am using PIC 18F4520 , I2C interfacing with AT24c16 EEPROM. The Compiler I am working on is MPLAB IDE v8.50 PIC C18 other header files included in i2c.h is pconfig.h ( just #defines and #ifndefs )

If any other query or req. info ask me in cooments. THANKS.

  • \$\begingroup\$ I want to fill my cup with water, but I can't find the water. Help me find it. I have a blue cup. <--That is the equivalent of what your question is asking. With that information, can you help me fill my cup ? No. You can't. You don't know the layout of the building I am in nor do you know if this building even has water (maybe they didn't pay their water bill). So look back at your question, and see if anyone can truly answer your question with all the "relevant" details you provided. \$\endgroup\$ – efox29 Jul 2 '15 at 12:38
  • \$\begingroup\$ Thnx @efox29 I will EDIT it right now. \$\endgroup\$ – prog_SAHIL Jul 2 '15 at 12:47
  • 1
    \$\begingroup\$ "help me to put value more than 255 in unsigned char" - as long as that unsigned char is 8 bits, you're never going to get more than 255 in it. \$\endgroup\$ – Roger Rowland Jul 2 '15 at 13:01
  • \$\begingroup\$ that is the problem see my previous question \$\endgroup\$ – prog_SAHIL Jul 2 '15 at 13:11
  • 1
    \$\begingroup\$ Normally you can't have more than 128 devices on an I2C bus. Are you trying to implement 10 bit addressing? \$\endgroup\$ – Spehro Pefhany Jul 2 '15 at 13:14

These library functions are precompiled from source code by Microchip. The quotes below are taken from the C18 C Compiler Libraries reference manual.

Firstly some overview information about the compiled libraries:

The MPLAB C18 libraries are included in the lib subdirectory of the installation. These can be linked directly into an application using the MPLINK linker.

These files were precompiled in the c:\mcc18\src directory at Microchip. The directory src\traditional contains the files for Non-extended mode and src\extended contains the files for Extended mode. If you chose not to install the compiler and related files in the c:\mcc18 directory, source code from the libraries will not show in the linker listing file and cannot be stepped through when using MPLAB IDE.

Another quote suggests that the original source code is provided and can be rebuilt if required:

To include the library code in the .lst file and to be able to single step through library functions, follow the instructions in Section 1.3.3, Section 1.4.3 and Section 1.5.3 to rebuild the libraries using the supplied batch files (.bat) found in the src, src\traditional and src\extended directories.

However you are unlikely to be able to do what you are attempting. The libraries implement standard I2C, if you want more devices on the bus you may have to investigate a different protocol.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.