I2C no longer decoding

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
henker
Posts: 45
Joined: Mon Dec 22, 2008 11:22 pm
Location: Prospect, NS, Canada
Has thanked: 7 times
Been thanked: 2 times
Contact:

I2C no longer decoding

Post 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
Attachments
MPRLS_v1.fcf
(41.42 KiB) Downloaded 101 times

User avatar
Bachman
Posts: 116
Joined: Sun Sep 07, 2014 11:37 am
Location: Hungary
Has thanked: 9 times
Been thanked: 53 times
Contact:

Re: I2C no longer decoding

Post 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 3577 times

henker
Posts: 45
Joined: Mon Dec 22, 2008 11:22 pm
Location: Prospect, NS, Canada
Has thanked: 7 times
Been thanked: 2 times
Contact:

Re: I2C no longer decoding

Post by henker »

Thanks for the information. Not sure which setting did the trick but it seems to be working!

Post Reply