I2C & Sniffer

Any bugs you encounter with Flowcode should be discussed here.
chipfryer27
Valued Contributor
Posts: 1147
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 285 times
Been thanked: 412 times

I2C & Sniffer

Post by chipfryer27 »

Hi

I could very well be doing something stupid, but as sometimes you can't see the woods for the trees I'm hoping someone else can.

I'm attempting to get an I2C sensor running with a Pico. Wouldn't do much so I used the I2C sniffer which returned the following (excert, it runs up to 254 then repeats). I modified the sniffer to use the Pico with appropriate pins
Screenshot 2023-08-20 091054.jpg
Screenshot 2023-08-20 091054.jpg (26.15 KiB) Viewed 1350 times

Seems strange to say the least. I get the same results with nothing connected to the pins.

Swapping the sensor for a Display on the same pins, I can get the display to work, but if I use the sniffer I get the same as above.


IC2_Address_Sniffer_v3_Pico.fcfx
(22.15 KiB) Downloaded 51 times

Regards

EDIT
I did manage to get the sensor to work, but not having much luck with the sniffer on the Pico or on an ESP32-Lolin

viktor_au
Posts: 18
Joined: Wed Jul 12, 2023 7:09 am
Has thanked: 2 times
Been thanked: 4 times

Re: I2C & Sniffer

Post by viktor_au »

Hi
What sensor is it?

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 285 times
Been thanked: 412 times

Re: I2C & Sniffer

Post by chipfryer27 »

Hi

It was one of the BH1750 modules.

I used one last year, but this was a different version and I was intending using it with either a Pico or an ESP32-Lolin. Usually if I have any trouble with any I2C, the sniffer is helpful. My sensor issue was related to the JST connector. Removing it and connecting directly resolved, nothing to do with the chip or FC, but I had the strange sniffer results even with nothing connected.

Regards

viktor_au
Posts: 18
Joined: Wed Jul 12, 2023 7:09 am
Has thanked: 2 times
Been thanked: 4 times

Re: I2C & Sniffer

Post by viktor_au »

Hi
Re: but this was a different version...
Can you give a link to the manual/pdf?

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 285 times
Been thanked: 412 times

Re: I2C & Sniffer

Post by chipfryer27 »

Hi

I can do so later today, but if you look through this forum (prob about page 13) you will see reference to using one of these sensors.

In the thread Medelec35 linked to a sensor he used, and it was one of them I'm now using.

Sensor isn't the problem, it works and so does display etc, but sniffer is giving strange results.

Regards

medelec35
Matrix Staff
Posts: 1451
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: I2C & Sniffer

Post by medelec35 »

Hello.
The reason is for PICO, ESP32, St Arm & RPI, I2C requires to use transactions.
I will look at this today.
Martin

medelec35
Matrix Staff
Posts: 1451
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: I2C & Sniffer

Post by medelec35 »

Hi.
I have attached a new version that should work on PICO.
There are caveats.
1. You must have at least 1 I2C component connected or you will see every address appear.
If that is the case you will know there is a faulty component or connection.

2. Will only work in software mode.

I have spotted an issue with the I2C cal file so you will need the attached file for the Scanner/Sniffer to compile.
Browse to this location using file explorer, it's hidden by default so just paste the link into your address bar.

Code: Select all

C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\PICO\
save the attached CAL file in the above location.
Hopefully, it will work for you
Attachments
PICO_CAL_I2C.c
(15.04 KiB) Downloaded 49 times
IC2_Address_Scanner v4.fcfx
(19.98 KiB) Downloaded 57 times
Martin

medelec35
Matrix Staff
Posts: 1451
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: I2C & Sniffer

Post by medelec35 »

Hi.
Did you get the sniffer to work on the PICO?
Martin

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 285 times
Been thanked: 412 times

Re: I2C & Sniffer

Post by chipfryer27 »

Hi

Sorry for the tardy reply, I was called away for a few days.

Just downloaded and tested.

Pico with I2C Display connected:-
Screenshot 2023-08-24 105756.jpg
Screenshot 2023-08-24 105756.jpg (27.12 KiB) Viewed 1257 times


Pico with display Data line disconnected:-

Screenshot 2023-08-24 105851.jpg
Screenshot 2023-08-24 105851.jpg (46.53 KiB) Viewed 1257 times

Looks like it's now working fine as you describe :)

Thanks.

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 285 times
Been thanked: 412 times

Re: I2C & Sniffer

Post by chipfryer27 »

Hi Viktor

This is the link for the sensors

https://www.amazon.co.uk/dp/B07YDH737W? ... ct_details


Within the description there is a link to what I presume was the datasheet, but this is broken. However a search for the module will give you good results.

As per a previous post last year, the modules are quite accurate when compared to both a "cheap" meter and a calibrated one. The difference for my need was trivial and consistant through range.

Regards

Post Reply