BME280

For general Flowcode discussion that does not belong in the other sections.
medelec35
Valued Contributor
Posts: 2487
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 796 times
Been thanked: 858 times

Re: BME280

Post by medelec35 »

Sounds good to me.
Is the project file the same as attached to your first post?
The other thing that can be done is used your current board as an I2C sniffer.
You can either use the UART or display to show the results.
The idea is to see if BME280 is detected, if so what address is shown for it.
I can provide examples for you to alter for your setup.
Martin

B2CAP-V6
Posts: 49
Joined: Fri Dec 04, 2020 2:15 pm
Been thanked: 8 times

Re: BME280

Post by B2CAP-V6 »

Hello Martin, and thanks for the feedback.
The project remains the same, with a few minor changes—including the way the return value is read, which seems to work for you. I’m going to flash the program now and let you know the return value.
I’ve also changed the BME280 address from 0x76 to 0x77. I’ll run a real-world test and keep you posted.
Attachments
Thermo_Baro_V1.0.fcfx
(27.97 KiB) Downloaded 8 times
(view online)

B2CAP-V6
Posts: 49
Joined: Fri Dec 04, 2020 2:15 pm
Been thanked: 8 times

Re: BME280

Post by B2CAP-V6 »

Martin,
I’ve just finished testing with the two addresses, 0x76 and 0x77.
Both return a value of 0 (BME initialization).

medelec35
Valued Contributor
Posts: 2487
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 796 times
Been thanked: 858 times

Re: BME280

Post by medelec35 »

So your BME280 is not being detected.
I have a BME280, I will test that on FC11 to make sure the component is working as expected on my target device.
Martin

B2CAP-V6
Posts: 49
Joined: Fri Dec 04, 2020 2:15 pm
Been thanked: 8 times

Re: BME280

Post by B2CAP-V6 »

OK, thank you very much

B2CAP-V6
Posts: 49
Joined: Fri Dec 04, 2020 2:15 pm
Been thanked: 8 times

Re: BME280

Post by B2CAP-V6 »

For your information, it's the same in the Proteus simulation; I get a return value of 0.

medelec35
Valued Contributor
Posts: 2487
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 796 times
Been thanked: 858 times

Re: BME280

Post by medelec35 »

I have just added UART to your project and changed target to 18F46K22 which is the same family as your target device.
Copied all config settings so comparing like for like.
BME280 worked perfect for me with I2C in SW and on CH1.
UART Diag:

Code: Select all

UART Test
BME280 Initialise = pass
Pressure = 1017.380004, Humidity = 53.325195, temperature = 21.500000C
Looks like you have an hardware issue.
Did your protype work?

Your next step would be to use an I2C sniffer.
I have created a pic version, I will see if find and post it.
One thing is clear, the simulation you shown is not what is happing on hardware.
Martin

B2CAP-V6
Posts: 49
Joined: Fri Dec 04, 2020 2:15 pm
Been thanked: 8 times

Re: BME280

Post by B2CAP-V6 »

Thanks Martin,
It looks like you've got a good temperature and low humidity with a pressure of 1017 hPa—all in England, :lol: .
Indeed, the 18F46K22 is identical to the 18F26K22. So, if your BME is working, mine should be too.
To answer your question, I didn't do any prototyping; I went straight to having the PCB manufactured based on my Proteus schematic (ordering 5 prototype-grade PCBs from the manufacturer). While waiting for your sniffer, I'm going to replace the BME. I'll be away this morning and for part of the afternoon, today.
I've already checked the electrical continuity between the traces. It's a very strange problem. A big thank you for everything, and I'll get back to you very soon.
Luc

medelec35
Valued Contributor
Posts: 2487
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 796 times
Been thanked: 858 times

Re: BME280

Post by medelec35 »

You're welcome Luc.
My concern would be what the datasheet shows for the minimum voltage for logic 1
I2C Min High Level.png
I2C Min High Level.png (73.5 KiB) Viewed 108 times
it should be 0.7 * VDD.
Although there will be some safety margin, if measured voltages are out of tolerance that is a high risk, especially if PCB's.
Perhaps try a silicon diode in between 5V reg and microcontroller if nothing is shown for the results of the sniffer.
What I would suggest is erase the microcontroller so all pins change to inputs, then measure the voltages on I2C pins of both microcontroller and BME280.
Are the voltages enough for logic 1?
It might be a good idea to add low outputs on a blank Flowchart for I2C and check levels of both microcontroller and BME280 I2C pins.
For the LCD sniffer I will test on the 1846K22 and past results.
The LCD can be changed to the 4bit version by using the Replace option.
See this Wiki page
Personally I prefer UART versions, so have included that as well.
Do you have access to USB to UART bridge or a logic analyser?
Attachments
IC2 Address Sniffer 16F18877 I2C LCD.fcfx
(25.52 KiB) Downloaded 7 times
(view online)
IC2 Address Sniffer 16F18877 v3.fcfx
(22.29 KiB) Downloaded 5 times
(view online)
Martin

Bijumon
Posts: 50
Joined: Fri Dec 30, 2022 11:44 am
Has thanked: 19 times
Been thanked: 34 times

Re: BME280

Post by Bijumon »

Hi,

To get the BME280 sensor working correctly in Proteus simulation, connect the CSB pin to +3.3 V to enable I²C mode.
Also, make sure to connect the VDDIO pin to +3.3 V to provide the digital I/O supply voltage.
Attachments
Screenshot 2026-10-14 184310.png
Screenshot 2026-10-14 184310.png (214.28 KiB) Viewed 86 times

Post Reply