<?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>BLE unreliable when using TWI with NAU7802 ADC chip</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/106305/ble-unreliable-when-using-twi-with-nau7802-adc-chip</link><description>I am using the Nordic UART Service to communicate ADC samples read from an NAU7802 chip. It works fine when I am using connection intervals of 7.5 to 7.5ms, but when I increase the connection intervals to 15 to 30ms (to adhere to the Apple Accessory Design</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 05 Dec 2023 00:10:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/106305/ble-unreliable-when-using-twi-with-nau7802-adc-chip" /><item><title>RE: BLE unreliable when using TWI with NAU7802 ADC chip</title><link>https://devzone.nordicsemi.com/thread/458843?ContentTypeID=1</link><pubDate>Tue, 05 Dec 2023 00:10:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9ecaf6b-a56b-478f-9369-d12f849105a5</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;It is a problem; using those pins for I2C talking rarely to the RTC is rather different from your application ..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE unreliable when using TWI with NAU7802 ADC chip</title><link>https://devzone.nordicsemi.com/thread/458841?ContentTypeID=1</link><pubDate>Mon, 04 Dec 2023 23:04:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ab28d28-a9b8-43e6-b247-c9897934903c</guid><dc:creator>CBrown</dc:creator><description>&lt;p&gt;I am using PO.26 and PO.27 for my SDA and SCL pins respectively (which are both in that table), but on the&amp;nbsp;&lt;a href="http://cdn.lairdtech.com/home/brandworld/files/Datasheet%20-%20BL652.pdf"&gt;BL652 datasheet&lt;/a&gt;,&amp;nbsp;these are labeled as I2C_SDA and I2C_SCL pins, so I didn&amp;#39;t think that would be a problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE unreliable when using TWI with NAU7802 ADC chip</title><link>https://devzone.nordicsemi.com/thread/458833?ContentTypeID=1</link><pubDate>Mon, 04 Dec 2023 19:58:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ddd9335f-af1b-49e2-ad89-58bda6f9426c</guid><dc:creator>CBrown</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Karl,&lt;/p&gt;
&lt;p&gt;To elaborate:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I am sending ASCII data every 5 milliseconds, at a maximum length of 21 bytes per packet&lt;/li&gt;
&lt;li&gt;This is only a rate of 33.6 kbps, and I can see BLE&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/38449/nrf52-data-length-extension"&gt;can get to Mbps rates&lt;/a&gt;, so I don&amp;#39;t think I am reaching the limits of BLE transmission.&lt;/li&gt;
&lt;li&gt;Every 5 seconds the data packet gets written&amp;nbsp;to a&amp;nbsp;FIFO (using app_fifo) of length 2048, and whenever I get the&amp;nbsp;BLE_NUS_EVT_TX_RDY event I transmit 244 bytes (the maximum size due to the MTU) from the FIFO using&amp;nbsp;ble_nus_data_send.&lt;/li&gt;
&lt;li&gt;When I write to the FIFO I check to see if the FIFO has space. If it doesn&amp;#39;t, then I &lt;strong&gt;increase an overflow counter and the data packet is dropped&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;When I use TWI with the NAU7802 chip, &lt;strong&gt;I see the overflow counter increase&lt;/strong&gt;. This indicates&amp;nbsp;that the FIFO is not emptying fast enough. I assume this is because BLE transmission is slowed (somehow by TWI) so BLE_NUS_EVT_TX_RDY is being called less often.&lt;/li&gt;
&lt;li&gt;Note I see this issue only when using TWI.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So&amp;nbsp;the issue is I am missing &lt;strong&gt;data packets&lt;/strong&gt;&amp;nbsp;(not BLE packets), because they are being dropped, because the FIFO does not have enough space, because BLE is slowing down when TWI is being used. I do not want to increase the FIFO size because it will still have the same issue, just take slightly longer to fill up.&lt;/p&gt;
&lt;p&gt;Does that make sense? Let me know if you have any ideas.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Campbell&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE unreliable when using TWI with NAU7802 ADC chip</title><link>https://devzone.nordicsemi.com/thread/458823?ContentTypeID=1</link><pubDate>Mon, 04 Dec 2023 18:54:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f90d3d9f-e061-44cf-820e-45d8c92129b4</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;This is a very good supplement to my comment, thanks &lt;a href="https://devzone.nordicsemi.com/members/hmolesworth"&gt;hmolesworth&lt;/a&gt;&amp;nbsp;! :)&amp;nbsp;&lt;br /&gt;&lt;br /&gt;You should definitely also &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/pin.html#pin_assign"&gt;check that your selected pins are not designated low-frequency in the Pin Assignment&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE unreliable when using TWI with NAU7802 ADC chip</title><link>https://devzone.nordicsemi.com/thread/458801?ContentTypeID=1</link><pubDate>Mon, 04 Dec 2023 16:40:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:204a0189-2e88-4ed3-bdaf-29984c57b642</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Worth a mention, just in case you chose the &amp;quot;wrong&amp;quot; pins for TWI SCK:&lt;/p&gt;
&lt;p&gt;&amp;quot;2&lt;em&gt;0.2 GPIO located near the RADIO&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Radio performance parameters, such as sensitivity, may be affected by high frequency digital I/O with large sink/source current close to the radio power supply and antenna pins.&amp;nbsp;Refer to Pin assignments on page 14 for recommended usage guidelines to maximize radio performance in an application&lt;/em&gt;.&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE unreliable when using TWI with NAU7802 ADC chip</title><link>https://devzone.nordicsemi.com/thread/458687?ContentTypeID=1</link><pubDate>Mon, 04 Dec 2023 09:36:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7ff8152-0d74-4b95-ab6e-2abb232fbbf7</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;Could you elaborate on what you mean when you say &amp;#39;missing packets&amp;#39;? Does this mean that you can see that the value is received as expected by the nRF, but then never actually sent to the connected peer? Or does it mean that you expect to read a new sample over the TWI at a given interval, and suddenly miss some of these intervals?&lt;br /&gt;&lt;br /&gt;In general, &lt;a href="https://infocenter.nordicsemi.com/topic/sds_s140/SDS/s1xx/processor_avail_interrupt_latency/exception_mgmt_sd.html"&gt;the SoftDevice has the highest priority&lt;/a&gt; and will take control over the CPU when a radio event is upcoming in order to reach its timing critical deadlines, which means that it could take control of the CPU right as your CPU is scheduled to execute the TWI read.&lt;br /&gt;If it is critical to your application that this does not happen you could instead look into using the easyDMA feature in combination with the PPI peripheral to trigger TWI transmission without needing the CPU intervention. In most cases you will however be fine just waiting for the radio event to complete and then do another TWI read.&lt;br /&gt;&lt;br /&gt;Could you elaborate more on your applications usage and requirements, so that I may better understand your issue and be better suited to advise you on how to proceed?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>