Page 1 of 1

I2C no longer decoding

Posted: Tue Sep 06, 2022 1:33 am
by henker
I'd like to get some help with the decoding of an I2C sensor. The MPRLS sensor is connected to an 18F4685 and with my (rigol) scope I can see the signals just fine and the scope is decoding the correct values.

Attached is the code which used to work, however for some reason after a compile, the "rdata" values return as "0". As I have installed FC on a new PC I'm wondering if there is an issue with the "Project Options" or "compile Options".
The other reason why I suspect an issue with the compiler is that I need to set the length of the string variable to 30 in order to output string that is only 9 characters long; "version 1". If the string variable is anything less than 30, it output weird characters...

Thanks for the help
Henk

Re: I2C no longer decoding

Posted: Tue Sep 06, 2022 7:54 am
by Bachman
Build menu -> Project options: set the CPU clock speed (Hz) to the correct value.

In the CPU configuration menu, change some values:
ScreenShot_336.png
ScreenShot_336.png (17.31 KiB) Viewed 7531 times

Re: I2C no longer decoding

Posted: Tue Sep 06, 2022 10:48 pm
by henker
Thanks for the information. Not sure which setting did the trick but it seems to be working!