Hi Neil, Have recently gone down the same track, 18LF46K22, MCC & XC8. It took some= =20 time/effort to figure things out, but between the .c and .h files there is = kindof enough=20 info to figure out how they work. I agree it could be easier. After some tr= ial & error it=20 started to fall into place somewhat and I could appreciate that MCC was act= ually=20 being helpful. Examples: result =3D ADC_GetConversion(6); // Get ADC result, channel 6 #define MCP23017 0x20 // I2C address of MCP23017 16bit I/O expander unsigned char somedata[12] =3D { 0x00, // Starting from register address 0 0xFF, // IODIRA - Direction A all inputs 0x01, // IODIRB - Direction B one input 0x00, // IPOLA - Input polarity A 0x00, // IPOLB - Input polarity B 0xFF, // GPINTENA - Interrupt on change A, 8 inputs 0x01, // GPINTENB - Interrupt on change B, 1 input 0xFF, // DEFVALA - Default value compare A 0xFF, // DEFVALB - Default value compare B 0xFF, // INTCONA - Interrupt A use DEFVAL 0xFF, // INTCONB - Interrupt B use DEFVAL 0x40 }; // IOCON - INT pins OR'ed I2C1_MasterWrite(somedata, 12, MCP23017, &I2C_Wflag); // Send 12 bytes of=20 data to I2C chip to initialize command =3D 0x12; // Request key status (inputs) length =3D 1; // from I2C port expander chip I2C1_MasterWrite(&command, length, MCP23017, &I2C_Wflag); __delay_us(10); I2C1_MasterRead(I2Cdata, 2, MCP23017, &I2C_Rflag); // Returned data is in=20 I2Cdata[0] and I2Cdata[1] On 16 Sep 2018 at 18:36, Neil wrote: > I need to add I2C functionality to existing code (18F25K42, XC8) and=20 > some libraries for this might be nice for a change of individually=20 > setting registers. >=20 > However, it seems that Mchip's direction on this is to install MCC, then= =20 > let MCC build the code framework their way (similar to PIC32 code=20 > w/Harmony). > Assuming I'm willing to do that (not sure I am yet), I installed the MCC= =20 > plugin, but can't find API docs. Google results indicate that there is=20 > some documentation in the code, but there really isn't. For example, I=20 > have the ADC module setup, but there's nothing that tells me what to=20 > call to select and sample a channel, how to determine completion and=20 > extract the result, etc. >=20 > Alternatively, can I just include and access the MCC libraries directly=20 > from my own code? If so, where is MCC even installed? >=20 > Cheers, > -Neil. >=20 >=20 > --=20 > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .