<?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>nRF52832 and SHT11 GPIO bit bang</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/42779/nrf52832-and-sht11-gpio-bit-bang</link><description>Hello, 
 I&amp;#39;m trying to use this code https://github.com/kimyd/SHT1X_on_nrf51822 to communicate with an SHT11 sensor via GPIO pins. I have a Saleae hooked up an can see the pulses and everything looks okay until the command ACK stage. The data pin is never</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 26 Jan 2019 15:58:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/42779/nrf52832-and-sht11-gpio-bit-bang" /><item><title>RE: nRF52832 and SHT11 GPIO bit bang</title><link>https://devzone.nordicsemi.com/thread/168064?ContentTypeID=1</link><pubDate>Sat, 26 Jan 2019 15:58:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6874d24-e037-4a73-9136-6ee490b43ef3</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;No problem. You can make the case as answered by clicking &amp;quot;More&amp;quot; and then &amp;quot;Verify Answer&amp;quot; on the answer that helped you solve the case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 and SHT11 GPIO bit bang</title><link>https://devzone.nordicsemi.com/thread/167709?ContentTypeID=1</link><pubDate>Thu, 24 Jan 2019 15:36:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dace1a17-2978-42a9-92ab-ff58b249400b</guid><dc:creator>RobYouYou</dc:creator><description>&lt;p&gt;Thanks again for the help - I&amp;#39;m not sure how to mark this closed/answered.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 and SHT11 GPIO bit bang</title><link>https://devzone.nordicsemi.com/thread/167586?ContentTypeID=1</link><pubDate>Thu, 24 Jan 2019 10:09:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ce848ea-e6e7-4486-8982-71f2e28e4d98</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am glad to hear you found the issue. It all made sense in the end &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Regarding GPIO voltage, that is always the same as VDD on nRF5 devices, so it is not configurable. I do not see a need for changing it in this case, but if it is needed for some reason, then you have to use&amp;nbsp;a level shifter.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 and SHT11 GPIO bit bang</title><link>https://devzone.nordicsemi.com/thread/167470?ContentTypeID=1</link><pubDate>Wed, 23 Jan 2019 19:13:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56246128-76f0-425e-8a91-8e9f5fb81e86</guid><dc:creator>RobYouYou</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;I tried using S0H1 for the output settings but that had little to no effect on the voltage levels I&amp;#39;m seeing (both data and clock outputs are 2.89V.&amp;nbsp; Out of interest I pulled the SHT out and tried the code which resulted in the same readings both clock and data only reach 2.89V so it&amp;#39;s nothing to do with the SHT.&lt;/p&gt;
&lt;p&gt;Doh - okay (I&amp;#39;m a dummy/bit slow), I use VDD instead of the +5V pin and everything looks to be working.&amp;nbsp; So I guess my questions now is how to re-adjust the GPIO output levels to use +5V?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 and SHT11 GPIO bit bang</title><link>https://devzone.nordicsemi.com/thread/167436?ContentTypeID=1</link><pubDate>Wed, 23 Jan 2019 15:52:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:335efd2f-3796-492a-8151-c75df13c2616</guid><dc:creator>RobYouYou</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;Looks like you have identified the &amp;#39;smoking gun&amp;#39;.&amp;nbsp; Both my data and clock line are nowhere near 80% of VDD but I have no idea why.&amp;nbsp; Here are my readings:&lt;/p&gt;
&lt;p&gt;VDD: 4.929V (5V pin on 52832)&lt;/p&gt;
&lt;p&gt;Data Output: 3.436V (you can see it is higher at the end of the trace/picture after I release the data pin)&lt;/p&gt;
&lt;p&gt;Data Input: 2.946V&lt;/p&gt;
&lt;p&gt;Clock Output: 2.767V&lt;/p&gt;
&lt;p&gt;My calculator tells me 80% of 4.929V should be around 3.94V (which is close to data input but not quite).&lt;/p&gt;
&lt;p&gt;Here is a picture:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Screen-Shot-2019_2D00_01_2D00_23-at-8.39.00-AM.png" /&gt;&lt;/p&gt;
&lt;p&gt;Any ideas on how I can raise the voltage levels on Data and Clock to hit 80% VDD (short of a transistor or some kind of relay)?&amp;nbsp; Given this works on a Pi I&amp;#39;m thinking I need to configure the GPIO pins in some manner.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Apologies on the code/command mix up.&amp;nbsp; I&amp;#39;ve change the code around so many times I mixed up the command order.&amp;nbsp; The attached image is a: reset, transmission start, read temp command.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Rob.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 and SHT11 GPIO bit bang</title><link>https://devzone.nordicsemi.com/thread/167417?ContentTypeID=1</link><pubDate>Wed, 23 Jan 2019 14:44:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11a7673c-efd8-40c9-a3d7-19da94e1b931</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The new plot was much better &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt; Can you upload the code which calls your&amp;nbsp;s_write_byte() as well? I am wondering because you wrote that&amp;nbsp; you write the code word for humidity (000 00101), but it looks to me like you write 000 00111 (Read Status Register).&amp;nbsp;But that does not impact the main issue here, as in any case the&amp;nbsp;SHT11 should have acknowledged by pulling down the data line (according to the &lt;a href="https://www.sparkfun.com/datasheets/Sensors/SHT1x_datasheet.pdf"&gt;datasheet&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;If the data and clock line matches what you get from the RPi, then there is something else preventing the&amp;nbsp;SHT11 from receiving or acking. Is the signal voltage for data and clock at the&amp;nbsp;SHT11 acceptable compared to VDD? Logic &amp;#39;1&amp;#39; should be at least 80% of VDD.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 and SHT11 GPIO bit bang</title><link>https://devzone.nordicsemi.com/thread/167167?ContentTypeID=1</link><pubDate>Tue, 22 Jan 2019 15:52:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5da0186-8d05-4e04-a284-ebda02be87ea</guid><dc:creator>RobYouYou</dc:creator><description>&lt;p&gt;Apologies forgot to answer the second part of the question - yes the data line is pulled low on the read by the code.&amp;nbsp; I changed this so that it never goes to read if it doesn&amp;#39;t get the first ack (see 2nd capture).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m use the SEGGER project for the PCA10040 (nRF52832 board) and I&amp;#39;ve just added the SHT code into the project.&amp;nbsp; It compiles with no warnings.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 and SHT11 GPIO bit bang</title><link>https://devzone.nordicsemi.com/thread/167166?ContentTypeID=1</link><pubDate>Tue, 22 Jan 2019 15:48:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aae0801b-aaa9-4eb7-916f-2d2e7f3f03b8</guid><dc:creator>RobYouYou</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s another capture (maybe better) with some timing ticks&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Screen-Shot-2019_2D00_01_2D00_22-at-8.36.34-AM.png" /&gt;&lt;/p&gt;
&lt;p&gt;Some more information:&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using pins 11 &amp;amp; 12 (11 SHT_DATA, 12 SHT_SCK)&lt;/p&gt;
&lt;p&gt;here is the code snipped for writing the command (note TICK, SETTLE and DATA_IN are macros for:&lt;/p&gt;
&lt;p&gt;#define TICK nrf_delay_us(125)&lt;/p&gt;
&lt;p&gt;#define DATA_IN nrf_gpio_cfg(SHT_DATA, NRF_GPIO_PIN_PULLUP)&lt;/p&gt;
&lt;p&gt;#define SETTLE nrf_delay_us(2)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static char s_write_byte(unsigned char value) { 
  
  unsigned char i,error=0;  

  // start trans
  nrf_gpio_cfg_output(SHT_DATA);   
  nrf_gpio_pin_clear(SHT_SCK);                   //Initial state
  nrf_gpio_pin_set(SHT_DATA); 
  TICK;
  nrf_gpio_pin_set(SHT_SCK);
  TICK;
  nrf_gpio_pin_clear(SHT_DATA);
  TICK;
  nrf_gpio_pin_clear(SHT_SCK);  
  TICK; 
  nrf_gpio_pin_set(SHT_SCK);
  TICK;
  nrf_gpio_pin_set(SHT_DATA);		   
  TICK;
  nrf_gpio_pin_clear(SHT_SCK); 
  TICK;
  
  nrf_gpio_pin_clear(SHT_DATA);
  TICK;

  //shift bit for masking
  for (i=0x80;i&amp;gt;0;i/=2) { 
    if (i&amp;amp;value) { 
      nrf_gpio_pin_set(SHT_DATA); 
    } else {
      nrf_gpio_pin_clear(SHT_DATA);
    }

    nrf_gpio_pin_set(SHT_SCK);   
    TICK;
    nrf_gpio_pin_clear(SHT_SCK);
    TICK;
  }
  
  // release data line
  nrf_gpio_pin_set(SHT_DATA);
  SETTLE;
  
  nrf_gpio_pin_set(SHT_SCK);                            //clk #9 for ack 
  TICK;
  DATA_IN;
  error = nrf_gpio_pin_read(SHT_DATA);	
  nrf_gpio_pin_clear(SHT_SCK);
    
  return error;                     //ack=1 in case of no acknowledge
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 and SHT11 GPIO bit bang</title><link>https://devzone.nordicsemi.com/thread/167106?ContentTypeID=1</link><pubDate>Tue, 22 Jan 2019 13:23:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85f098ce-69c0-40f8-8b38-5db4d8543407</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It is a little bit difficult to read the clock and data lines together, but I think i see the same bit pattern you describe. Would it be possible to upload a plot with higher time resolution to make it easier to see the relative timing of the clock and data edges?&lt;/p&gt;
&lt;p&gt;Your description covers about the first half of the graph, and the rest you say is garbage. But the data line is pulled low at one point there, is done by the nRF (your bit ganging SW)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 and SHT11 GPIO bit bang</title><link>https://devzone.nordicsemi.com/thread/166852?ContentTypeID=1</link><pubDate>Mon, 21 Jan 2019 13:47:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d06a28b8-c4ec-4fbb-a0da-a7c7f91a1b6b</guid><dc:creator>RobYouYou</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;Yes, I&amp;#39;ve compared them and the only difference I can see is that the data line never goes low after the command is entered.&amp;nbsp; I&amp;#39;m using a Parallax part that has a pull-up integrated (only 4.7K) and I&amp;#39;ve tried the code with both NOPULL and PULLUP on the input (no difference).&amp;nbsp; Attached is a scope trace that shows the data line not going low.&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/shtscope.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;So basically the above is clock on top and data on bottom.&amp;nbsp; There are 9 pulses with data high (reset), a transmit start sequence and then a code word (5 for humidity). the&amp;nbsp; ack pulse (9th pulse) does not result in the data line going low. so the rest of the data/clock pulses are basically garbage (all ones).&lt;/p&gt;
&lt;p&gt;The wire diagram shows:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/FDY8GBBH2WETXIL.LARGE.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;And this setup works great on a Pi + Python without any additional resistors (don&amp;#39;t need the clock pull down).&amp;nbsp; So I think I&amp;#39;m basically clueless as to how the GPIO pins on the 52832 are supposed to work.&amp;nbsp; The clock pin is set to output all the time but the data pin flips between input and output.&amp;nbsp; Is there some special configuration I need to get this to work properly (i.e. is there an extra settle delay when flipping between input and output?).&lt;/p&gt;
&lt;p&gt;Any suggestions would be greatly appreciated.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 and SHT11 GPIO bit bang</title><link>https://devzone.nordicsemi.com/thread/166780?ContentTypeID=1</link><pubDate>Mon, 21 Jan 2019 10:23:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c715601f-0756-4589-8704-c171f55ed8ed</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Have you compared the logic analyzer trace with the known good sequence you get when using the RPi?&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;SHT11 need a pull up resistor on the DATA line, so you have to enable the internal pull-up resistor in the nRF (unless you have an external pull-up resistor, SHT11 spec states it should be about 10 kΩ). That said, this does not seem to be the problem if the data pin stays always high.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>