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.
BME280
-
medelec35
- Valued Contributor
- Posts: 2486
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 796 times
- Been thanked: 858 times
Re: BME280
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.
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 6 times
- (view online)
Re: BME280
Martin,
I’ve just finished testing with the two addresses, 0x76 and 0x77.
Both return a value of 0 (BME initialization).
I’ve just finished testing with the two addresses, 0x76 and 0x77.
Both return a value of 0 (BME initialization).
Re: BME280
For your information, it's the same in the Proteus simulation; I get a return value of 0.
-
medelec35
- Valued Contributor
- Posts: 2486
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 796 times
- Been thanked: 858 times
Re: BME280
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:
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.
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.500000CDid 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
Re: BME280
Thanks Martin,
It looks like you've got a good temperature and low humidity with a pressure of 1017 hPa—all in England,
.
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
It looks like you've got a good temperature and low humidity with a pressure of 1017 hPa—all in England,
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: 2486
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 796 times
- Been thanked: 858 times
Re: BME280
You're welcome Luc.
My concern would be what the datasheet shows for the minimum voltage for logic 1 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?
My concern would be what the datasheet shows for the minimum voltage for logic 1 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 5 times
- (view online)
-
- IC2 Address Sniffer 16F18877 v3.fcfx
- (22.29 KiB) Downloaded 3 times
- (view online)
Martin
Re: BME280
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.
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 (214.28 KiB) Viewed 72 times