<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How to get Pressure and Humidity using BME280 with nrf52840 DK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/77882/how-to-get-pressure-and-humidity-using-bme280-with-nrf52840-dk</link><description>Hi Nordic Team, 
 I have interfaced bme280 with nrf52840 and I got the temperature successfully. I have used https://github.com/knuta/nrf5-bme280-twi link for that. 
 Here in bme280_twi_measurement_fetch() function I&amp;#39;ve change the address from 0xFA to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 04 Aug 2021 10:14:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/77882/how-to-get-pressure-and-humidity-using-bme280-with-nrf52840-dk" /><item><title>RE: How to get Pressure and Humidity using BME280 with nrf52840 DK</title><link>https://devzone.nordicsemi.com/thread/323266?ContentTypeID=1</link><pubDate>Wed, 04 Aug 2021 10:14:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0babd214-c61d-4079-bffd-b240dee36714</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Someone will help you out in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/78190/bme280-with-nrf5340-display-t-p-h-problem"&gt;the ticket you have posted&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This ticket is regarding nRF5 SDK, while nRF5340 only is supported in nRF Connect SDK. These SDKs have quite different architectures and drivers.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get Pressure and Humidity using BME280 with nrf52840 DK</title><link>https://devzone.nordicsemi.com/thread/323258?ContentTypeID=1</link><pubDate>Wed, 04 Aug 2021 09:27:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:739879ab-5be4-4c82-b9af-e51eaa7241b2</guid><dc:creator>Rihab</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;i&amp;#39;m having similar problem with bme280 sensor but with NRF5340&amp;nbsp;&amp;nbsp;&lt;br /&gt;i&amp;#39;m&amp;nbsp; seeking help&amp;nbsp;&lt;br /&gt;thanks in advance&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get Pressure and Humidity using BME280 with nrf52840 DK</title><link>https://devzone.nordicsemi.com/thread/321988?ContentTypeID=1</link><pubDate>Tue, 27 Jul 2021 09:03:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ada5b718-3532-4619-9b64-3c2d69518651</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;The datasheet also says that (temperature,) humidity and pressure measurements can be skipped (in &lt;a href="https://www.mouser.com/datasheet/2/783/BST-BME280-DS002-1509607.pdf#page=17"&gt;section 3.4&lt;/a&gt;). Looking at &lt;a href="https://github.com/knuta/nrf5-bme280-twi/blob/master/driver/bme280_twi.c#L159-L164"&gt;the code you linked&lt;/a&gt;, it seems to actually skip these measurements. Did you change the code to enable the measurements again?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get Pressure and Humidity using BME280 with nrf52840 DK</title><link>https://devzone.nordicsemi.com/thread/321927?ContentTypeID=1</link><pubDate>Tue, 27 Jul 2021 05:14:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f731f2b7-a68b-480e-affa-c3e1182849e2</guid><dc:creator>PAWAN JOSHI</dc:creator><description>&lt;p&gt;Yes I&amp;#39;ve gone through the datasheet, need to change the address for getting others data, for temperature it is 0xFA and for pressure it is 0xF7. I&amp;#39;m attaching my snippet kindly look on that&lt;pre class="ui-code" data-mode="text"&gt;
static void _compensate_temp(int32_t adc_T, int32_t *temp,int32_t adc_P, int32_t *press)
{
   int32_t var3 = ((((adc_T&amp;gt;&amp;gt;3) - ((int32_t)m_dig_T1&amp;lt;&amp;lt;1))) * ((int32_t)m_dig_T2)) &amp;gt;&amp;gt; 11;
   int32_t var4 = (((((adc_T&amp;gt;&amp;gt;4) - ((int32_t)m_dig_T1)) * ((adc_T&amp;gt;&amp;gt;4) - ((int32_t)m_dig_T1))) &amp;gt;&amp;gt; 12) *
                  ((int32_t)m_dig_T3)) &amp;gt;&amp;gt; 14;
   t = var3 + var4;
   *temp = ((var3 + var4) * 5 + 128) &amp;gt;&amp;gt; 8;

   int32_t var1 = (((int32_t)t) &amp;gt;&amp;gt; 1) - (int32_t)64000;
   int32_t var2 = (((var1 &amp;gt;&amp;gt; 2) * (var1 &amp;gt;&amp;gt; 2)) &amp;gt;&amp;gt; 11)
     * ((int32_t)m_dig_P6);
   var2 = var2 + ((var1 * ((int32_t)m_dig_P5)) &amp;lt;&amp;lt; 1);
   var2 = (var2 &amp;gt;&amp;gt; 2) + (((int32_t)m_dig_P4) &amp;lt;&amp;lt; 16);
   var1 = (((m_dig_P3 * (((var1 &amp;gt;&amp;gt; 2) * (var1 &amp;gt;&amp;gt; 2)) &amp;gt;&amp;gt; 13)) &amp;gt;&amp;gt; 3)
      + ((((int32_t)m_dig_P2) * var1) &amp;gt;&amp;gt; 1)) &amp;gt;&amp;gt; 18;
   var1 = ((((32768 + var1)) * ((int32_t)m_dig_P1)) &amp;gt;&amp;gt; 15);
 
   if(var1 == 0) {
     return; /* Avoid exception caused by division by zero */
   }
 
   pressure = (((uint32_t)(((int32_t)1048576) - adc_P) - (var2 &amp;gt;&amp;gt; 12)))
     * 3125;
   if(pressure &amp;lt; 0x80000000) {
     pressure = (pressure &amp;lt;&amp;lt; 1) / ((uint32_t)var1);
   } else {
     pressure = (pressure / (uint32_t)var1) * 2;
   }
 
   var1 = (((int32_t)m_dig_P9)
                * ((int32_t)(((pressure &amp;gt;&amp;gt; 3) * (pressure &amp;gt;&amp;gt; 3)) &amp;gt;&amp;gt; 13))) &amp;gt;&amp;gt; 12;
   var2 = (((int32_t)(pressure &amp;gt;&amp;gt; 2)) * ((int32_t)m_dig_P8)) &amp;gt;&amp;gt; 13;
   pressure = (uint32_t)((int32_t)pressure
                         + ((var1 + var2 + m_dig_P7) &amp;gt;&amp;gt; 4));
 
   *press = pressure;
   printf(&amp;quot;\r%d\r\n&amp;quot;,*press);
}

void bme280_twi_measurement_fetch(void)
{
	_read(0xFA, m_buf, 3);
         nrf_delay_ms(100);
        _read(0xF7, m_buf2, 3);

        //_read(_REG_CTRL_HUM, m_buf, 3);

}

void bme280_twi_measurement_get_temp(bme280_twi_data_t *data)
{
	_compensate_temp(m_temp_raw, &amp;amp;data-&amp;gt;temp,m_press_raw, &amp;amp;data-&amp;gt;pressure);
}&lt;/pre&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here in the attached code it is not executing&amp;nbsp;to var1 and var2 which is for getting pressure, as I can&amp;#39;t able to put the breakpoint here. it is jumping after calculating var3 and var4.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get Pressure and Humidity using BME280 with nrf52840 DK</title><link>https://devzone.nordicsemi.com/thread/321740?ContentTypeID=1</link><pubDate>Mon, 26 Jul 2021 09:12:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c663e2a8-2e2d-420b-b20a-727ab6641750</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Have you checked the datasheet of the sensor to see if there is anything else needed to get pressure/humidity data? E.g. some config to enable these measurements?&lt;/p&gt;
&lt;p&gt;What do you get when trying to read pressure/humidity? No data at all, or some kind of error?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>