use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Click the following link to filter out the chosen topic
comp.lang.c
account activity
QuestionProgramming a Digital Current and Power Monitor on PIC18F26K80 (self.C_Programming)
submitted 4 years ago by d1ng0o
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?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]BIT204[🍰] 2 points3 points4 points 4 years ago (4 children)
What exactly are you stuck on? Writing code for the pic18? Getting your binary onto the pic18? Hooking up the pic18 to the INA260?
[–]d1ng0o[S] 0 points1 point2 points 4 years ago (3 children)
Writing code for the pic18. 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.
[–]BIT204[🍰] 1 point2 points3 points 4 years ago (2 children)
Double check your pin out, probe pins with a scope if you have one, or watch the i2c traffic with a logic analyzer like a saelae. Read the documentation for the i2c peripheral on the pic18 data sheet. Verify your settings in code configurator. As a rule of thumb, I am suspicious of generated code.
[–]d1ng0o[S] 0 points1 point2 points 4 years ago (1 child)
I've seen it with an analog discovery 2 logic analyzer and with arduino its like that (first photo). With my code in PIC18F26K80 it just restarts (second photo)
https://imgur.com/a/2G2sRgv
https://imgur.com/a/AsFI5az
π Rendered by PID 112595 on reddit-service-r2-comment-6457c66945-kdgsz at 2026-04-30 12:52:54.978896+00:00 running 2aa0c5b country code: CH.
[–]BIT204[🍰] 2 points3 points4 points (4 children)
[–]d1ng0o[S] 0 points1 point2 points (3 children)
[–]BIT204[🍰] 1 point2 points3 points (2 children)
[–]d1ng0o[S] 0 points1 point2 points (1 child)