<?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/"><channel><title>Readiing humidity from HTU21D sensor using TWI</title><link>/nordic/nordic-blog/b/blog/posts/readiing-humidity-from-htu21d-sensor-using-twi</link><description>##Measuring humidity using TWI on nrf52##

In this post I will explain how the nRF5x chip can be used to communicate with a sensor over TWI (I2C). To run this example extract the files to examples -&amp;gt; peripheral in the SDK for nrf52 and open the ...</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><item><title>RE: Readiing humidity from HTU21D sensor using TWI</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/readiing-humidity-from-htu21d-sensor-using-twi</link><pubDate>Mon, 24 Apr 2017 14:41:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:161b4bcb-4058-4637-a1e1-1cdae6bb283f</guid><dc:creator>g.joshi</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I am using SDK v 12.2.0 and my pca board is pca10040 and everytime i try to run this program i get the fatal error or blank screen. Can somebody help ?&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=902&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Readiing humidity from HTU21D sensor using TWI</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/readiing-humidity-from-htu21d-sensor-using-twi</link><pubDate>Thu, 16 Mar 2017 02:33:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:161b4bcb-4058-4637-a1e1-1cdae6bb283f</guid><dc:creator>sansil</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Hi, Excellent post!&lt;/p&gt;
&lt;p&gt;I tried to run the code in sdk 11.0 and keil, but i have the following error:&lt;/p&gt;
&lt;pre&gt;Build target &amp;#39;nrf52_mpw3&amp;#39;
compiling main.c...
..\..\main.c(58): error:  #20: identifier &amp;quot;TWI0_USE_EASY_DMA&amp;quot; is undefined
  static const nrf_drv_twi_t m_twi_master = 
RF_DRV_TWI_INSTANCE(MASTER_TWI_INST);
..\..\main.c(91): error:  #20: identifier &amp;quot;NRF_DRV_TWI_TX_DONE&amp;quot; is undefined
          case NRF_DRV_TWI_TX_DONE:
..\..\main.c(94): error:  #20: identifier &amp;quot;NRF_DRV_TWI_RX_DONE&amp;quot; is undefined
          case NRF_DRV_TWI_RX_DONE:
..\..\main.c(97): error:  #20: identifier &amp;quot;NRF_DRV_TWI_ERROR&amp;quot; is undefined
          case NRF_DRV_TWI_ERROR:
..\..\main.c(140): error:  #140: too many arguments in function call
      ret_code = nrf_drv_twi_rx(&amp;amp;m_twi_master, 
TU21D_ADDRESS, returned_over_I2C, 3, 
alse); //Get raw humidity data   
..\..\main.c(169): error:  #140: too many arguments in function call
      ret_code = nrf_drv_twi_rx(&amp;amp;m_twi_master, 
TU21D_ADDRESS, returned_over_I2C, 3, 
alse); //Get raw humidity data
..\..\main.c(201): warning:  #167-D: argument of type &amp;quot;void (*)(nrf_drv_twi_evt_t *)&amp;quot; is incompatible with parameter of type &amp;quot;nrf_drv_twi_evt_handler_t&amp;quot;
          ret_code = nrf_drv_twi_init(&amp;amp;m_twi_master, &amp;amp;config, twi_event_handler);    
..\..\main.c(201): error:  #165: too few arguments in function call
          ret_code = nrf_drv_twi_init(&amp;amp;m_twi_master, &amp;amp;config, twi_event_handler);    
..\..\main.c: 1 warning, 7 errors
&lt;/pre&gt;
&lt;p&gt;Any idea? Thank you in advance&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=902&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Readiing humidity from HTU21D sensor using TWI</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/readiing-humidity-from-htu21d-sensor-using-twi</link><pubDate>Wed, 22 Feb 2017 07:52:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:161b4bcb-4058-4637-a1e1-1cdae6bb283f</guid><dc:creator>ninoq</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Linking error fixed- see &lt;a href="https://devzone.nordicsemi.com/question/15000/what-is-causing-the-error-undefined-symbol-app_error_handler/"&gt;this&lt;/a&gt;.
The application is working - getting humidity every 2 secs.  However have not yet resolved compiler warning.&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=902&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Readiing humidity from HTU21D sensor using TWI</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/readiing-humidity-from-htu21d-sensor-using-twi</link><pubDate>Wed, 22 Feb 2017 01:37:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:161b4bcb-4058-4637-a1e1-1cdae6bb283f</guid><dc:creator>ninoq</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I&amp;#39;m using an nRF52 DK board and SDK 11.  I downloaded the example code and extracted it with 7-ZIP to a folder I created under .....\examples\peripheral.
It compiles with a warning:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;....\main.c(199): warning:  #167-D:
argument of type &amp;quot;void
(*)(nrf_drv_twi_evt_t *)&amp;quot; is
incompatible with parameter of type
&amp;quot;nrf_drv_twi_evt_handler_t&amp;quot;
ret_code = nrf_drv_twi_init(&amp;amp;m_twi_master,
&amp;amp;config, twi_event_handler, ;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;but the target is not created the error message is:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;._build\nrf52_mpw3.axf: Error: L6218E: Undefined symbol
app_error_fault_handler (referred from
app_error.o).&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I&amp;#39;d appreciate some help.&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=902&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Readiing humidity from HTU21D sensor using TWI</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/readiing-humidity-from-htu21d-sensor-using-twi</link><pubDate>Mon, 25 Apr 2016 05:26:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:161b4bcb-4058-4637-a1e1-1cdae6bb283f</guid><dc:creator>samchang</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Is this example also works on nrf51-DK directly?   Or I need to replace some of these programs in order to use in nrf51-DK&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=902&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Readiing humidity from HTU21D sensor using TWI</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/readiing-humidity-from-htu21d-sensor-using-twi</link><pubDate>Tue, 01 Mar 2016 10:27:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:161b4bcb-4058-4637-a1e1-1cdae6bb283f</guid><dc:creator>Anders Strand</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;@kanchun: Try placing the &amp;quot;twi_humidity_readings&amp;quot; folder in nRF52_SDK\examples&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=902&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Readiing humidity from HTU21D sensor using TWI</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/readiing-humidity-from-htu21d-sensor-using-twi</link><pubDate>Mon, 29 Feb 2016 03:13:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:161b4bcb-4058-4637-a1e1-1cdae6bb283f</guid><dc:creator>kanchun</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;i have the following error;&lt;/p&gt;
&lt;pre&gt;*** Using Compiler &amp;#39;V5.06 update 1 (build 61)&amp;#39;, folder: &amp;#39;C:\Keil_v5\ARM\ARMCC\Bin&amp;#39;Rebuild target &amp;#39;nrf52_mpw3&amp;#39;compiling main.c.....\..\main.c(25): error: #5: cannot open source input file &amp;quot;app_uart.h&amp;quot;: No such file or directory #include &amp;quot;app_uart.h&amp;quot;..\..\main.c: 0 warnings, 1 errorcompiling bsp.c...&amp;quot;no source&amp;quot;: Error: #5: cannot open source input file &amp;quot;..\..\..\..\bsp\bsp.c&amp;quot;: No such file or directory..\..\..\..\bsp\bsp.c: 0 warnings, 1 errorcompiling app_uart_fifo.c...&amp;quot;no source&amp;quot;: Error:
#5: cannot open source input file &amp;quot;..\..\..\..\..\components\libraries\uart\app_uart_fifo.c&amp;quot;: No such file or directory..\..\..\..\..\components\libraries\uart\app_uart_fifo.c: 0 warnings, 1 errorcompiling nrf_delay.c...&amp;quot;no source&amp;quot;: Error: #5: cannot open source input file &amp;quot;..\..\..\..\..\components\drivers_nrf\delay\nrf_delay.c&amp;quot;: No such file or directory..\..\..\..\..\components\drivers_nrf\delay\nrf_delay.c: 0 warnings, 1 errorcompiling nrf_drv_common.c...&amp;quot;no source&amp;quot;: Error:
#5: cannot open source input file &amp;quot;..\..\..\..\..\components\drivers_nrf\common\nrf_drv_common.c&amp;quot;: No such file or directory..\..\..\..\..\components\drivers_nrf\common\nrf_drv_common.c: 0 warnings, 1 errorcompiling nrf_drv_gpiote.c...&amp;quot;no source&amp;quot;: Error:
#5: cannot open source input file &amp;quot;..\..\..\..\..\components\drivers_nrf\gpiote\nrf_drv_gpiote.c&amp;quot;: No such file or directory..\..\..\..\..\components\drivers_nrf\gpiote\nrf_drv_gpiote.c: 0 warnings, 1 errorcompiling nrf_drv_twi.c...&amp;quot;no source&amp;quot;: Error:
#5: cannot open source input file &amp;quot;..\..\..\..\..\components\drivers_nrf\twi_master\nrf_drv_twi.c&amp;quot;: No such file or directory..\..\..\..\..\components\drivers_nrf\twi_master\nrf_drv_twi.c: 0 warnings, 1 errorcompiling nrf_drv_twis.c...&amp;quot;no source&amp;quot;: Error:
#5: cannot open source input file &amp;quot;..\..\..\..\..\components\drivers_nrf\twis_slave\nrf_drv_twis.c&amp;quot;: No such file or directory..\..\..\..\..\components\drivers_nrf\twis_slave\nrf_drv_twis.c: 0 warnings, 1 errorcompiling nrf_drv_uart.c...&amp;quot;no source&amp;quot;: Error:
#5: cannot open source input file &amp;quot;..\..\..\..\..\components\drivers_nrf\uart\nrf_drv_uart.c&amp;quot;: No such file or directory..\..\..\..\..\components\drivers_nrf\uart\nrf_drv_uart.c: 0 warnings, 1 errorcompiling app_button.c...&amp;quot;no source&amp;quot;: Error: #5: cannot open source input file &amp;quot;..\..\..\..\..\components\libraries\button\app_button.c&amp;quot;: No such file or directory..\..\..\..\..\components\libraries\button\app_button.c: 0 warnings, 1 errorcompiling app_error.c...&amp;quot;no source&amp;quot;: Error: #5: cannot open source input file &amp;quot;..\..\..\..\..\components\libraries\util\app_error.c&amp;quot;: No such file or directory..\..\..\..\..\components\libraries\util\app_error.c: 0 warnings, 1 errorcompiling app_fifo.c...&amp;quot;no source&amp;quot;: Error: #5: cannot open source input file &amp;quot;..\..\..\..\..\components\libraries\fifo\app_fifo.c&amp;quot;: No such file or directory..\..\..\..\..\components\libraries\fifo\app_fifo.c: 0 warnings, 1 errorcompiling app_timer.c...&amp;quot;no source&amp;quot;: Error: #5: cannot open source input file &amp;quot;..\..\..\..\..\components\libraries\timer\app_timer.c&amp;quot;: No such file or directory..\..\..\..\..\components\libraries\timer\app_timer.c: 0 warnings, 1 errorcompiling app_util_platform.c...&amp;quot;no source&amp;quot;: Error: #5: cannot open source input file &amp;quot;..\..\..\..\..\components\libraries\util\app_util_platform.c&amp;quot;: No such file or  directory..\..\..\..\..\components\libraries\util\app_util_platform.c: 0 warnings, 1 errorcompiling nrf_assert.c...&amp;quot;no source&amp;quot;: Error: #5: cannot open source input file &amp;quot;..\..\..\..\..\components\libraries\util\nrf_assert.c&amp;quot;: No such file or directory..\..\..\..\..\components\libraries\util\nrf_assert.c: 0 warnings, 1 errorcompiling retarget.c...&amp;quot;no source&amp;quot;: Error: #5: cannot open source input file &amp;quot;..\..\..\..\..\components\libraries\uart\retarget.c&amp;quot;: No such file or directory..\..\..\..\..\components\libraries\uart\retarget.c: 0 warnings, 1 errorcompiling nrf_drv_timer.c...&amp;quot;no source&amp;quot;: Error:
#5: cannot open source input file &amp;quot;..\..\..\..\..\components\drivers_nrf\timer\nrf_drv_timer.c&amp;quot;: No such file or directory..\..\..\..\..\components\drivers_nrf\timer\nrf_drv_timer.c: 0 warnings, 1 errorcompiling SEGGER_RTT.c...&amp;quot;no source&amp;quot;: Error: #5: cannot open source input file &amp;quot;C:\Keil_v5\ARM\Pack\NordicSemiconductor\RTT\SEGGER_RTT.c&amp;quot;: No such file or directoryC:\Keil_v5\ARM\Pack\NordicSemiconductor\RTT\SEGGER_RTT.c: 0 warnings, 1 errorcompiling SEGGER_RTT_printf.c...&amp;quot;no source&amp;quot;: Error: #5: cannot open source input file &amp;quot;C:\Keil_v5\ARM\Pack\NordicSemiconductor\RTT\SEGGER_RTT_printf.c&amp;quot;: No such file or directoryC:\Keil_v5\ARM\Pack\NordicSemiconductor\RTT\SEGGER_RTT_printf.c: 0 warnings, 1 errorcompiling RTT_Syscalls_KEIL.c...&amp;quot;no source&amp;quot;: Error: #5: cannot open source input file &amp;quot;C:\Keil_v5\ARM\Pack\NordicSemiconductor\Syscalls\RTT_Syscalls_KEIL.c&amp;quot;: No such file or directoryC:\Keil_v5\ARM\Pack\NordicSemiconductor\Syscalls\RTT_Syscalls_KEIL.c: 0 warnings, 1 errorassembling arm_startup_nrf52.s...compiling system_nrf52.c...&amp;quot;.\_build\nrf52_mpw3.axf&amp;quot;
- 1 Error(s), 0 Warning(s).Target not created.Build Time Elapsed: 00:00:13
&lt;/pre&gt;
&lt;p&gt;seems some of the files missing.&lt;/p&gt;
&lt;p&gt;Please help.
Thanks,&lt;/p&gt;
&lt;p&gt;Kan.&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=902&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>