EE here, let me get you started its been a while since I have done PICs so bear with me
Luckily Microchip has a decent IDE, start by downloading MPLABX and setting up a project with the microcontroller specified as the target.
Embedded programming is literally RTFM, so read the datasheet linked by . The way embedded programming works is you literally have a ton of macros which are defined in the header files MPLABX automatically adds to the main.c file.
For PICs you find the register you want to set, say I2C1CON (the register which controls the #1 I2C interface, see page 188 of the maual), and you set it to what you want. Suppose I want the interface to operate in 10-bit mode with everything else default I would write:
I2C1CON = 0b0000010000000000
Then, I need to enable it, I do that by writing the enable bit to one:
I2C1CON = 0b1000010000000000
Its good practice to set the config bits before you enable modules, and if you need to change the config to disable it first.
One thing about PICs is that you need to set the config of the pins before you can use them, they default as inputs on startup and you need to configure them as you need. Say I want to use RA0 (the first pin on port A) as an output for an LED, I would first make my life easier by #defining it to a variable name:
// Define RA0 to be LED0#define LED0 PORTAbits.RA0
This means that when I call LED0 and set it to 1 or 0 it will toggle that pin (which has an LED on it).
Now I will initialise the port, I do this by setting the tristate buffer to the config needed for it to be an output, and just as a precaution I set the output low:
void main(void){//Initialize RA0//Set the tristate buffer for RA0 to outputTRISAbits.RA0 = 0;//Set the port lowLED0 = 0;while(1){//main loop}}
Note that I didn't make my main return anything, this is because in embedded programming you don't have anything to return to. If you want to make your main function return a 1 on completion there is nothing stopping you though.
The PORTAbits.RA* and TRISAbits.RA* are defined in the headers, if you want to do things the long way you can also do what I did with the I2C1CON example above. Likewise you can also go I2C1CONbits.A10M and I2C1CONbits.EN instead of what I did there. MPLABX has this nice feature where if you type something like I2C1CONbits. it will bring up a dropdown menu with all the possible completed names.
One thing which trips up a lot of people new to PICs is the ADC module, if you are wanting to use a pin which can be set as an ADC input you will also need to configure the ADC port config register. In my example above I used RA0, this isn't a pin which has ADC functionality so I didn't have to do anything.
There is lots of other stuff you will have to learn as well but this will get you started. Luckily though you are using a PIC and because of the way they are setup once you have programmed one PIC you have basically programmed them all since they are so similar.