I use the C0 port for SCL and the C1 port for the SDAT of the 16LF18857 microchip. It didn't work, so I made a test Flowcode, see attachment.
1) Before starting the I2C, the C0 and C1 ports are tested with level 1 and 0 each second. The ports work correctly.
2) The second step is to compare the behavoir of this chip with the 16(L)F1847 chip. The last shows I2C pulses and the LCD shows the ID and config word of the slave. The 16LF18857 does show neither data nor clock I2C pulses and stops during writing the slave address (see comment NEVER REACHED in the Enable_I2C_Sensor maco).
What to do now?
Kind regards
Jan
I2C problems with 16LF18857
Moderator: Benj
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
Re: I2C problems with 16LF18857
It took a while to find a solution.
This microchip 16(L)F18857 has (as usually) 2 sets of I2C ports C3 SCLK1, C4 SDAT1, B1 SCLK2 and B2 SDAT2 with low and high levels special for I2C. Other ports (TTL levels) can be used for I2C also. This can be done by means of software setting (settings of special registers).
1) When starting Flowcode with this microchip, there is a possibility to choose the I2C ports. I needed the C0 as SCLK and C1 as SDAT.
But the Flowcode program did not work.
2) But it is curious why one could change the ports in case of channel 1, because ports should be C3 and C4.
So, I changed the ports to C3 and C4. The breadboard setup with is setting did not work either.
3) Now I changed the Flowcode Bus settings channel to “software”. Curious that the connections were fixed to C3 and C4 and could not be changed, as expected. But this works.
Question: Is it correct that one can change the I2C ports in case of "channel 1"or "channel 2" and can not change the ports in case of "software"? It seems not logic to me.
Kind regards
Jan
This microchip 16(L)F18857 has (as usually) 2 sets of I2C ports C3 SCLK1, C4 SDAT1, B1 SCLK2 and B2 SDAT2 with low and high levels special for I2C. Other ports (TTL levels) can be used for I2C also. This can be done by means of software setting (settings of special registers).
1) When starting Flowcode with this microchip, there is a possibility to choose the I2C ports. I needed the C0 as SCLK and C1 as SDAT.
But the Flowcode program did not work.
2) But it is curious why one could change the ports in case of channel 1, because ports should be C3 and C4.
So, I changed the ports to C3 and C4. The breadboard setup with is setting did not work either.
3) Now I changed the Flowcode Bus settings channel to “software”. Curious that the connections were fixed to C3 and C4 and could not be changed, as expected. But this works.
Question: Is it correct that one can change the I2C ports in case of "channel 1"or "channel 2" and can not change the ports in case of "software"? It seems not logic to me.
Kind regards
Jan
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: I2C problems with 16LF18857
Hi Jan,
I can't seem to replicate the problem.
With the two hardware channels you should get the extra Remap properties that allow you to set the hardware channel pins. With the software channel the remap properties should dissappear and you should be able to set the pins by directly editing the SDA and SCL properties.
All working nicely for me here though I am running 8.2 (due to be released later today).
I can't seem to replicate the problem.
With the two hardware channels you should get the extra Remap properties that allow you to set the hardware channel pins. With the software channel the remap properties should dissappear and you should be able to set the pins by directly editing the SDA and SCL properties.
All working nicely for me here though I am running 8.2 (due to be released later today).
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
Re: I2C problems with 16LF18857
Hi Ben
You wrote:
Kind regrads
Jan
You wrote:
what do you mean with "directly editing"you should be able to set the pins by directly editing the SDA and SCL properties
Kind regrads
Jan
-
- Posts: 74
- Joined: Mon Aug 23, 2010 7:07 pm
- Location: Amsterdam
- Has thanked: 7 times
- Been thanked: 13 times
- Contact:
Re: I2C problems with 16LF18857
Hi Jan,
I had the simular issues with a project i use the same 16F18857 MCU.
Only software channel was working. Hardware channel 1 and 2 did not.
Now i have updated FC8 to V8.2.0.12 and YES hardware channels are working now.
I directly tested both channels (SDA to B4, SCL to B5) and all is working well.
Cheers.
I had the simular issues with a project i use the same 16F18857 MCU.
Only software channel was working. Hardware channel 1 and 2 did not.
Now i have updated FC8 to V8.2.0.12 and YES hardware channels are working now.
I directly tested both channels (SDA to B4, SCL to B5) and all is working well.
Cheers.