<?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 TWI at 50 KHz (SMBus Compatibility)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/29834/nrf52832-twi-at-50-khz-smbus-compatibility</link><description>I am running the NRF52832 (BMD-300 module) and I&amp;#39;m trying to talk to battery over SMBus.
SMBus is compatible with devices up to 100 KHz. 
 I was wondering if there was a way to talk to an I2C device on the NRF52832 with a lower clock rate than the 100</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 21 Dec 2021 21:31:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/29834/nrf52832-twi-at-50-khz-smbus-compatibility" /><item><title>RE: NRF52832 TWI at 50 KHz (SMBus Compatibility)</title><link>https://devzone.nordicsemi.com/thread/344692?ContentTypeID=1</link><pubDate>Tue, 21 Dec 2021 21:31:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72dff46d-6c53-4f02-b593-24416d3a4749</guid><dc:creator>Greg Nowak</dc:creator><description>&lt;p&gt;Not that I have found.&amp;nbsp; I keep it in my repo as my &amp;quot;things to change when I upgrade&amp;quot; list.&amp;nbsp; I&amp;#39;ve just manually updated each time I update (which, admittedly is not very often)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 TWI at 50 KHz (SMBus Compatibility)</title><link>https://devzone.nordicsemi.com/thread/344690?ContentTypeID=1</link><pubDate>Tue, 21 Dec 2021 21:21:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50d7396f-5340-4732-b674-3c4add7f694d</guid><dc:creator>embeddedER</dc:creator><description>&lt;p&gt;To make myself more clear:&lt;/p&gt;
&lt;p&gt;I am using nRF Connect SDK 1.8.0 and I changed the register (TWIM_FREQUENCY_FREQUENCY_K100) value in nrf52_bitfields.h and it worked for me.&lt;/p&gt;
&lt;p&gt;But this&amp;nbsp;change is outside my application i.e. if I&amp;nbsp;migrate to latest SDK later on then I&amp;#39;ll need to do change in that SDK as well.&amp;nbsp;So, I was just wondering if there is a way to change this register from my application itself?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 TWI at 50 KHz (SMBus Compatibility)</title><link>https://devzone.nordicsemi.com/thread/344452?ContentTypeID=1</link><pubDate>Mon, 20 Dec 2021 23:36:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3bf75b41-5e88-4725-a5dd-ce0af6066785</guid><dc:creator>embeddedER</dc:creator><description>&lt;p&gt;Thanks Greg for quick revert. I am new to&amp;nbsp;nRF devices, nRF SDK and still consuming&amp;nbsp;lot of information.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Could you share the snippet of code (or guide me) on &amp;quot;how to set&amp;nbsp;FREQUENCY register&amp;quot; in my application?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;TIA.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 TWI at 50 KHz (SMBus Compatibility)</title><link>https://devzone.nordicsemi.com/thread/344451?ContentTypeID=1</link><pubDate>Mon, 20 Dec 2021 22:08:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eed40a1a-b670-4857-a71e-6e2650e42b42</guid><dc:creator>Greg Nowak</dc:creator><description>&lt;p&gt;I just changed the timing register to&amp;nbsp;&lt;span&gt;0xCC0000 in order to communicate with my smart battery and that seemed to work.&amp;nbsp;&lt;br /&gt;Technically it is &amp;#39;outside of the tested specification&amp;quot; but I&amp;#39;ve got hundreds of products so far with this change and I haven&amp;#39;t had any issues yet.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 TWI at 50 KHz (SMBus Compatibility)</title><link>https://devzone.nordicsemi.com/thread/344449?ContentTypeID=1</link><pubDate>Mon, 20 Dec 2021 21:59:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77fa1ead-695c-44b0-8109-b7e70a090d6a</guid><dc:creator>embeddedER</dc:creator><description>&lt;p&gt;Hi Greg,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Were you able to make nRF52 work with 50k? I&amp;#39;ve sensor which is using bit-bang I2C and it&amp;#39;s rate is much slower (~50k).&lt;/p&gt;
&lt;p&gt;Could you please share the sample if it worked for you?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 TWI at 50 KHz (SMBus Compatibility)</title><link>https://devzone.nordicsemi.com/thread/119950?ContentTypeID=1</link><pubDate>Tue, 06 Feb 2018 13:34:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:011aed8b-98a5-4358-9ddd-b9fef717109e</guid><dc:creator>Greg Nowak</dc:creator><description>&lt;p&gt;Changing the register value seems to have worked for me.&amp;nbsp; I&amp;#39;m no longer getting the read errors from my battery.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 TWI at 50 KHz (SMBus Compatibility)</title><link>https://devzone.nordicsemi.com/thread/118543?ContentTypeID=1</link><pubDate>Sat, 27 Jan 2018 11:07:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9595bfc-6807-4c62-9668-668119aa7cf0</guid><dc:creator>studzinski</dc:creator><description>&lt;p&gt;OK. I understand. As I said, I did not test it with softdevice. However, for LIS accelerometer even large clock gaps (till 500 us) do not affect communication. What are for you large gaps? 1ms, more?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 TWI at 50 KHz (SMBus Compatibility)</title><link>https://devzone.nordicsemi.com/thread/118542?ContentTypeID=1</link><pubDate>Sat, 27 Jan 2018 10:52:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9c81570-34d3-488f-82bd-ef299332a88a</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;bitbanging means you generate the signal yourself by setting and reading the GPIOs and using software timers to time the transitions (when to change a bit, when to read). This doesn&amp;#39;t work with the softdevice running (ie advertising or in connection) as it can and does interrupt for fairly lengthy periods whenever it needs to do some bluetooth operations and that has higher priority than any timer or timer interrupt. So the timing of the software-generated protocol has large gaps in it and communications fail.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 TWI at 50 KHz (SMBus Compatibility)</title><link>https://devzone.nordicsemi.com/thread/118541?ContentTypeID=1</link><pubDate>Sat, 27 Jan 2018 10:49:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81d4a08b-2e0c-4723-a9ec-5fcfc32f3f30</guid><dc:creator>studzinski</dc:creator><description>&lt;p&gt;I do not know the meaning of bitbang term. Since years I use bit coding for I2C of LIS accelerometer (I generate the clock with one GPIO levels and read value on other data GPIO). However, it is true, I did not tested it on Nrf52832.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 TWI at 50 KHz (SMBus Compatibility)</title><link>https://devzone.nordicsemi.com/thread/118540?ContentTypeID=1</link><pubDate>Sat, 27 Jan 2018 10:43:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5121c50-6c20-4e0e-8a36-5077bf0b5aec</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;do you mean bitbang it? With the softdevice running that&amp;#39;s not going to work, this is discussed very often, bitbanging things with any kind of timing requirement is often tried and almost always fails.&lt;/p&gt;
&lt;p&gt;If you didn&amp;#39;t mean that, what did  you mean?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 TWI at 50 KHz (SMBus Compatibility)</title><link>https://devzone.nordicsemi.com/thread/118539?ContentTypeID=1</link><pubDate>Sat, 27 Jan 2018 10:39:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5dd147f-8e37-4598-954c-da86750fdfd1</guid><dc:creator>studzinski</dc:creator><description>&lt;p&gt;You can always use software TWI coding using GPIO levels with all frequencies you want...
In cuch case you define your clock. It seems that in earlier SDK there is such library...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 TWI at 50 KHz (SMBus Compatibility)</title><link>https://devzone.nordicsemi.com/thread/118538?ContentTypeID=1</link><pubDate>Wed, 17 Jan 2018 08:18:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df0d149f-ff82-413a-b306-679519e9a220</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The formula for calculating the frequency vs the register values is more complicated than one might think. This is partly due to how the algorithm handles rounding errors, and partly because it relies on how you configure the TWI. In other words, it is not as simple as just dividing a fixed master clock frequency with a register value. Furthermore, if you read the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/twim.html?cp=2_1_0_32_8#unique_1658832437"&gt;TWIM&amp;#39;s electrical specifications&lt;/a&gt; you will see that it is specced between 100k and 400kHz. However, this doesn&amp;#39;t mean that it wont work at all outside these boundaries, but Nordic has not tested it and therefore gives no guarantees. That being said, halving the register values as RK suggest will probably get you close to 50kHz (I haven&amp;#39;t tried), but if you do this you are doing so at your own discretion.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 TWI at 50 KHz (SMBus Compatibility)</title><link>https://devzone.nordicsemi.com/thread/118537?ContentTypeID=1</link><pubDate>Wed, 17 Jan 2018 04:57:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec3a178e-ea68-47dd-85d3-4382cdf38c08</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;you could just try halving the value in the frequency register and seeing if it works. 0xCC0000 would be the value to try. No guarantees of course but worth the 10 minutes to test.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>