<?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>Connection required for using Zephyr 1-wire driver on nrf52840DK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/100130/connection-required-for-using-zephyr-1-wire-driver-on-nrf52840dk</link><description>Hello, 
 I am trying to understand how to use the Zephyr 1-wire driver on nrf52840. I see from the &amp;quot;scanner&amp;quot; sample of the w1-serial driver that it supports the nrf52840DK, however, the sample readme does not provide a description of the hardware connections</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 26 May 2023 17:13:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/100130/connection-required-for-using-zephyr-1-wire-driver-on-nrf52840dk" /><item><title>RE: Connection required for using Zephyr 1-wire driver on nrf52840DK</title><link>https://devzone.nordicsemi.com/thread/427886?ContentTypeID=1</link><pubDate>Fri, 26 May 2023 17:13:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:177e8611-c33c-40ea-96d4-827289e37dc7</guid><dc:creator>pnc2</dc:creator><description>&lt;p&gt;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f62d.svg" title="Sob"&gt;&amp;#x1f62d;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Thanks anyway&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f62d.svg" title="Sob"&gt;&amp;#x1f62d;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection required for using Zephyr 1-wire driver on nrf52840DK</title><link>https://devzone.nordicsemi.com/thread/427883?ContentTypeID=1</link><pubDate>Fri, 26 May 2023 16:26:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:082a2345-b920-4279-b199-4f99de178720</guid><dc:creator>Kenneth</dc:creator><description>[quote user="pnc2"]if what I am trying to do is simply impossible?[/quote]
&lt;p&gt;It&amp;#39;s not been designed or intended to share pins the way you are trying no. So you should not expect this to work unfortunately. So unless you can update the board to use two pins, it looks like you need to use some kind of bit bashing yes.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection required for using Zephyr 1-wire driver on nrf52840DK</title><link>https://devzone.nordicsemi.com/thread/427781?ContentTypeID=1</link><pubDate>Fri, 26 May 2023 11:56:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b5d01d2-d12d-4806-b283-bb1f5894312a</guid><dc:creator>pnc2</dc:creator><description>&lt;p&gt;Hi Kenneth,&lt;/p&gt;
&lt;p&gt;I tried out the above idea with the following addition to the custom board definition of my custom nrf52840 board&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;uart1&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;status&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span&gt;&amp;quot;okay&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;current-speed&lt;/span&gt;&lt;span&gt; = &amp;lt;&lt;/span&gt;&lt;span&gt;115200&lt;/span&gt;&lt;span&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;pinctrl-0&lt;/span&gt;&lt;span&gt; = &amp;lt;&amp;amp;&lt;/span&gt;&lt;span&gt;uart1_default&lt;/span&gt;&lt;span&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;pinctrl-1&lt;/span&gt;&lt;span&gt; = &amp;lt;&amp;amp;&lt;/span&gt;&lt;span&gt;uart1_sleep&lt;/span&gt;&lt;span&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;pinctrl-names&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span&gt;&amp;quot;default&amp;quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;&amp;quot;sleep&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;w1:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;w1&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;compatible&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span&gt;&amp;quot;zephyr,w1-serial&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;status&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span&gt;&amp;quot;okay&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;pinctrl&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;uart1_default:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;uart1_default&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;group1&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;psels&lt;/span&gt;&lt;span&gt; = &amp;lt;&lt;/span&gt;&lt;span&gt;NRF_PSEL&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;UART_RX&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;5&lt;/span&gt;&lt;span&gt;)&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;bias-pull-up&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;group2&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;psels&lt;/span&gt;&lt;span&gt; = &amp;lt;&lt;/span&gt;&lt;span&gt;NRF_PSEL&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;UART_TX&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;5&lt;/span&gt;&lt;span&gt;)&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;nordic,drive-mode&lt;/span&gt;&lt;span&gt; = &amp;lt;&lt;/span&gt;&lt;span&gt;NRF_DRIVE_S0D1&lt;/span&gt;&lt;span&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;uart1_sleep:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;uart1_sleep&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;group1&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;psels&lt;/span&gt;&lt;span&gt; = &amp;lt;&lt;/span&gt;&lt;span&gt;NRF_PSEL&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;UART_RX&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;5&lt;/span&gt;&lt;span&gt;)&amp;gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span&gt;NRF_PSEL&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;UART_TX&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;5&lt;/span&gt;&lt;span&gt;)&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;low-power-enable&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Btw GPIO0.5 happens to be the pin to which the w1 device is connected on my board (with a pull-up). As I mentioned earlier, previously this was being used by a bit-bashing bare metal driver&lt;/p&gt;
&lt;p&gt;It is building fine with the Zephyr w1 scanner sample, however, I am getting an IO error in uart_poll_in() in line 89 of w1_zephyr_serial.c (in the&amp;nbsp;serial_tx_rx() function).&lt;/p&gt;
&lt;p&gt;Could you please verify if my approach is feasible, or if what I am trying to do is simply impossible? In that case, I guess I have no option but to go back to bit bashing and forget the serial_w1 driver, since, as I said, I am not in a position to change the board wiring. Would it be possible for you to try it out with the nrf52840DK? I do not have access that board, and perhaps it is just an issue with my custom board.&lt;/p&gt;
&lt;p&gt;thanks&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;pnc&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection required for using Zephyr 1-wire driver on nrf52840DK</title><link>https://devzone.nordicsemi.com/thread/427612?ContentTypeID=1</link><pubDate>Thu, 25 May 2023 18:45:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e42855c3-75f0-4ef7-bafd-da65cb031549</guid><dc:creator>pnc2</dc:creator><description>&lt;p&gt;Following on from my previous post, it seems connecting Tx and Rx via DTS is possible, as per this discussion:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/15513/nrf52832-single-wire-uart"&gt;nrf52832-single-wire-uart&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So if I do something like this in the DTS overlay, going by the accepted solution in above discussion, it ought to work:&lt;/p&gt;
&lt;p&gt;&amp;amp;uart1_default {&lt;br /&gt; group1 {&lt;br /&gt; psels = &amp;lt;NRF_PSEL(UART_RX, 0, 5)&amp;gt;;&lt;br /&gt; bias-pull-up;&lt;br /&gt; };&lt;br /&gt; group2 {&lt;br /&gt; psels = &amp;lt;NRF_PSEL(UART_TX, 0, 5)&amp;gt;;&lt;/p&gt;
&lt;p&gt;drive-mode =&amp;nbsp;NRF_DRIVE_S0D1;&lt;br /&gt; };&lt;br /&gt; };&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll try this out tomorrow.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection required for using Zephyr 1-wire driver on nrf52840DK</title><link>https://devzone.nordicsemi.com/thread/427584?ContentTypeID=1</link><pubDate>Thu, 25 May 2023 15:12:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad309c34-9a5e-432f-83e9-203fb5047a27</guid><dc:creator>pnc2</dc:creator><description>&lt;p&gt;Hi Kenneth,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;thanks for your answer! Actually, my main question was (I guess I should have highlighted it), was if I could avoid physically shorting Tx and Rx, and simply assign them to the same pin in a DTS overlay. This would avoid hardware changes. As I mentioned in my original post, I am&amp;nbsp;creating a software update for a&amp;nbsp;production board which is already in use at various client sites, and am not in a position to modify the hardware in any way. From your answer, I feel this should be possible, but would just like to verify.&lt;/p&gt;
&lt;p&gt;As a side note, my original impression was that a 470k resistor is required between Tx and Rx, as described in this technical note from Analog Devices (diagram below)&lt;/p&gt;
&lt;p&gt;&lt;a id="" href="https://www.analog.com/en/technical-articles/using-a-uart-to-implement-a-1wire-bus-master.html"&gt;https://www.analog.com/en/technical-articles/using-a-uart-to-implement-a-1wire-bus-master.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://www.analog.com/-/media/analog/en/landing-pages/technical-articles/using-a-uart-to-implement-a-1wire-bus-master/214fig01.png" /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However, as you have indicated, and as I have seen in various other places too, a direct shorting also seems to work. That being so, assigning the same physical pin to both Tx and Rx in the DTS should have the same effect, unless it causes some internal problem&amp;nbsp;in nrf52 UART&amp;nbsp;module that you might be aware of.&lt;/p&gt;
&lt;p&gt;thanks&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;pnc&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection required for using Zephyr 1-wire driver on nrf52840DK</title><link>https://devzone.nordicsemi.com/thread/427514?ContentTypeID=1</link><pubDate>Thu, 25 May 2023 11:57:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ea2b822-ef0b-4dba-bed2-e3029f96064c</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t have a sensor to try myself. But from my understanding after reading the sample documentation:&lt;br /&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/samples/sensor/ds18b20/README.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/samples/sensor/ds18b20/README.html&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/main/samples/sensor/ds18b20"&gt;https://github.com/nrfconnect/sdk-zephyr/tree/main/samples/sensor/ds18b20&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It says you should hook up the hardware as descrbed in DS18B20 datasheet, the figure I can find that show this is:&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1685015049714v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;When compiling the sample application I can find the sample project adds two devictree overlay files to the nRF52840 DK:&lt;br /&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/main/samples/sensor/ds18b20/arduino_serial.overlay"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/main/samples/sensor/ds18b20/arduino_serial.overlay&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/main/samples/sensor/ds18b20/boards/nrf52840dk_nrf52840.overlay"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/main/samples/sensor/ds18b20/boards/nrf52840dk_nrf52840.overlay&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The nrd52840dk_nrf52840.overlay files says it should use port1 pin1 for uart rx and port1 pin2 for uart tx.&amp;nbsp;Looking at the hardware configuration figure above I can see you need a ~4.7kohm pull up on the 1-wire line, however I can also see from the overlay files that there is an bias-pull-up; option used for uart rx, so with this option you should not need an external pull-up, instead simply connect the rx and tx together with the DQ pin of the DS18B20 should be sufficient.&lt;/p&gt;
&lt;p&gt;As a side note: I can see that the&amp;nbsp;arduino_serial is used for communication, from the nRF52840dk_nrf52840.dts file I can see arduino_serial is &amp;amp;uart1:&lt;br /&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/main/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/main/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So uart1 can&amp;#39;t be used for anything else than 1-wire in this case.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>