Maker Pro
Maker Pro

Programming a Digital Current and Power Monitor on PIC18F26K80

Hi, I'm on a project where I would like to measure a battery voltage. For that, I have to use a Digital Current and Power Monitor, called INA260. I already have a board made and it's functional because I've already tested it with the arduino, but I'm not able to do the programming on the PIC18F26K80. Can anyone help me?
 
I have programmed the PIC32MX devices using C. I have a feeling this is not much different. You have a few options. You can use the 'Harmony Library' or you can program it directly in 'C'. I am not a fan of the Harmony Library.
I see the part is I2C, I have programmed PIC's for I2C before.
Please provide the full schematic. Also, do you have a programmer (PICKIT-3 or PICKIT-4?)
 
I created the I2C library using the MPLAB® Code Configurator then I made the C code by hand but I still can't get the values properly
 
I created the I2C library using the MPLAB® Code Configurator then I made the C code by hand but I still can't get the values properly
I created the I2C library using the MPLAB® Code Configurator then I made the C code by hand but I still can't get the values properly
I created the I2C library using the MPLAB® Code Configurator then I made the C code by hand but I still can't get the values properly
Attached is code for PIC32MX I2C Master. Had to change extension, it is a .c file.
 

Attachments

  • I2CMaster.txt
    10 KB · Views: 2
Top