<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How would I read from a BMP280 sensor at the fastest possible rate ?]]></title><description><![CDATA[<p dir="auto">I am using a BMP280 module.   I am very confident my system setup and software are working fine.   Readings of temperature and pressure I receive seem valid.</p>
<p dir="auto">I wish to implement a design, based around an 8051 microcontroller, where the pressure reading is continually read from the device and sent out a serial port onto my PC where it is date stamped and saved to a log file.</p>
<p dir="auto">I want to run this as fast as possible.   I do not wish to use the IIR filer, as I actually want to see any spikes that might appear.</p>
<p dir="auto">I'd be just reading the 3 or 6 bytes (either just pressure or pressure and temperature) and transmitting  the raw values to my PC (converting later on).  I've had my circuit reading 11 bytes from a different I2C sensor, and transmitting those values, at 800 hz without problems.   So I know I can handle the fastest ODR the device claims to achieve.</p>
<p dir="auto">I understand I can either run in "forced mode" or "normal mode".</p>
<p dir="auto">It is not exactly clear to me which to use.</p>
<p dir="auto">Also, regardless of the mode I use, how would I know when to read from the device ?</p>
<p dir="auto">If I run in forced mode, can I simply write my code to run a tight loop of just reading from the device, transmitting the data to my PC, over and over ???   It would seem I would be trying to read at a rate that is much faster then the device can actually handle.   Is there a problem with that ... as in ... would I risk reading invalid data ?</p>
<p dir="auto">If I run in normal mode, there is some sort of standby time.   Would I need to determine that time, and write my code to wait AT LEAST that amount of time before seeking another reading ?</p>
<p dir="auto">Your help would be greatly appreciated.</p>
]]></description><link>https://forum.mysensors.org/topic/4480/how-would-i-read-from-a-bmp280-sensor-at-the-fastest-possible-rate</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Jul 2026 11:03:21 GMT</lastBuildDate><atom:link href="https://forum.mysensors.org/topic/4480.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 03 Aug 2016 21:18:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How would I read from a BMP280 sensor at the fastest possible rate ? on Thu, 04 Aug 2016 00:13:15 GMT]]></title><description><![CDATA[<p dir="auto">I've now tried various algorithms.</p>
<p dir="auto">In all of these I set the oversampling of both temperature and pressure to 1 (no oversampling).</p>
<ol>
<li>
<p dir="auto">Forced mode, with fixed 5mS delay between reads,</p>
</li>
<li>
<p dir="auto">Forced mode, with fixed 4mS delay between reads,</p>
</li>
<li>
<p dir="auto">Forced mode, with fixed 3mS delay between reads,</p>
</li>
<li>
<p dir="auto">Forced mode, with fixed 1mS delay between reads,</p>
</li>
<li>
<p dir="auto">Normal mode, set t_sb = 0.5 mS, waiting until status bit 3 = 0, read data, repeat</p>
</li>
<li>
<p dir="auto">Normal mode, set t_sb = 0.5 mS, waiting until status bit 3 = 0, read data, wait until status bit 3 = 1, repeat</p>
</li>
</ol>
<p dir="auto">With each algorithm, I'd do 2000 reads.</p>
<p dir="auto">As I went through the above scenarios, the minimum and maximum readings (for both values) got farther and farter apart - ie: the range of values got larger.</p>
<p dir="auto">That was until #5, where it was slightly better then #1.  The range with #6 was the least of all - in other words, algorithm 6 gave the most consistent readings (I should say the sensor is laying still throughout these tests).</p>
<p dir="auto">In #5, it took 6 seconds to make 2000 readings - or an ODR of about 333 hz.  In #6, it took 12 seconds to make 2000 readings - or an ODR of 166 hz.  Just what the datasheet said would be the maximum ODR.</p>
<p dir="auto">I have to assume with #5, about half the readings were done before the registers were updated.  In other words, it was a waste of cpu time to make the reading.</p>
]]></description><link>https://forum.mysensors.org/post/44527</link><guid isPermaLink="true">https://forum.mysensors.org/post/44527</guid><dc:creator><![CDATA[ny51sens]]></dc:creator><pubDate>Thu, 04 Aug 2016 00:13:15 GMT</pubDate></item><item><title><![CDATA[Reply to How would I read from a BMP280 sensor at the fastest possible rate ? on Wed, 03 Aug 2016 21:46:42 GMT]]></title><description><![CDATA[<p dir="auto">Hello.</p>
<p dir="auto">I have not looked deeply at the datasheet, but I advice to read it ;)  It seems that if you want to be precise and fast, forced mode is less good than normal mode.<br />
About, your sampling rate, it will depends on lot of things like coding, sure. I think you can read/poll a register of the sensor to see if a sample is available. If I were you, I would use "if" instead loop for the polling. look at blink without led arduino example for this.</p>
<p dir="auto">I hope this helps :)</p>
]]></description><link>https://forum.mysensors.org/post/44523</link><guid isPermaLink="true">https://forum.mysensors.org/post/44523</guid><dc:creator><![CDATA[scalz]]></dc:creator><pubDate>Wed, 03 Aug 2016 21:46:42 GMT</pubDate></item></channel></rss>