<?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>Correct TWI Sensor data only when programmer connected</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20068/correct-twi-sensor-data-only-when-programmer-connected</link><description>Hello, 
 I have made a custom board using nrf51822 QFAC that has an IMU on TWI interface. For programming I am using ST-LinkV2 and OpenOCD. The board is working just fine. I have successfully programmed it. 
 I want to transmit the readings from the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 06 Mar 2017 13:47:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20068/correct-twi-sensor-data-only-when-programmer-connected" /><item><title>RE: Correct TWI Sensor data only when programmer connected</title><link>https://devzone.nordicsemi.com/thread/78111?ContentTypeID=1</link><pubDate>Mon, 06 Mar 2017 13:47:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2bc01420-fec0-4308-a79a-de63f8077546</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;It sounds strange that you measure 4-6 kHz on the crystal if it is a 32.768 kHz crystal. Are you sure you have connected it properly and followed any directions in the datasheet of the IMU? Could you send me your schematics so I can take a look?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Correct TWI Sensor data only when programmer connected</title><link>https://devzone.nordicsemi.com/thread/78116?ContentTypeID=1</link><pubDate>Sat, 04 Mar 2017 14:15:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5dc60007-750f-4a66-85d4-f8d0ad5b735c</guid><dc:creator>Iulian Mate?ica</dc:creator><description>&lt;p&gt;I managed to look with an oscilloscope to see what is going on there.
On my board I have two 32.768kHz crystals, one for the nRF and the other for IMU.&lt;/p&gt;
&lt;p&gt;I have put the oscilloscope to measure the frequency on both crystals with and without the programmer connected. Results:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;IMU configured to use Internal Crystal&lt;/p&gt;
&lt;p&gt;a) ST-LinkV2 unconnected&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  - crystal connected to nRF51822: ~32.768kHz
  - crystal connected to IMU: ~0Hz 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;b) ST-LinkV2 connected&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  - crystal connected to nRF51822: ~32.768kHz
  - crystal connected to IMU: ~  4-6 kHz  (??)
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;IMU configured to use External Crystal&lt;/p&gt;
&lt;p&gt;a) ST-LinkV2 unconnected&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  - crystal connected to nRF51822: ~32.768kHz
  - connected to IMU: ~0Hz (so it doesn&amp;#39;t oscillate - IMU gives me zeros)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;b) ST-LinkV2 connected&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  - crystal connected to nRF51822: ~32.768kHz
  - crystal connected to IMU: ~4-6 kHz  (IMU gives me correct values)
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Correct TWI Sensor data only when programmer connected</title><link>https://devzone.nordicsemi.com/thread/78115?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2017 16:21:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7bf3d20f-8fa3-4374-a75b-45a119f5ce81</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Great! Let me know what you figure out.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Correct TWI Sensor data only when programmer connected</title><link>https://devzone.nordicsemi.com/thread/78114?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2017 16:20:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ded7af2e-7fa1-4b54-9527-829963cfe7c1</guid><dc:creator>Iulian Mate?ica</dc:creator><description>&lt;p&gt;I will try in the weekend to see with an oscilloscope what is going on there. Thank you!&lt;/p&gt;
&lt;p&gt;I will let you know about the result.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Correct TWI Sensor data only when programmer connected</title><link>https://devzone.nordicsemi.com/thread/78113?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2017 16:19:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5471d309-1d77-4989-b53e-6d86efb4e93a</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Yes, it should. This is why I was wondering if the crystal actually start when you do not have the programmer connected. I can&amp;#39;t see any connection between this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Correct TWI Sensor data only when programmer connected</title><link>https://devzone.nordicsemi.com/thread/78112?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2017 16:16:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c552667-bed8-4c2d-8de7-330deb938a23</guid><dc:creator>Iulian Mate?ica</dc:creator><description>&lt;p&gt;I haven&amp;#39;t checked with an oscilloscope.
IMU works OK with external crystal only if programmer is connected and OpenOCD running. As you said before, maybe it starts into debug mode, but in this case, shouldn&amp;#39;t it affect only the clock source for nRF51822?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Correct TWI Sensor data only when programmer connected</title><link>https://devzone.nordicsemi.com/thread/78121?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2017 15:57:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e3fc0dd-54a4-45db-809b-6e1755c66d6f</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Have you checked if the crystal starts oscillating when you set the IMU to use external crystal?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Correct TWI Sensor data only when programmer connected</title><link>https://devzone.nordicsemi.com/thread/78120?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2017 15:34:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:004c60e1-bc7f-4035-8f8a-05b0b24bf8da</guid><dc:creator>Iulian Mate?ica</dc:creator><description>&lt;p&gt;It is BNO055 from Bosch.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Correct TWI Sensor data only when programmer connected</title><link>https://devzone.nordicsemi.com/thread/78119?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2017 15:34:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b97b475-7a45-496d-928d-cdba503cd2d3</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;What IMU are you using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Correct TWI Sensor data only when programmer connected</title><link>https://devzone.nordicsemi.com/thread/78118?ContentTypeID=1</link><pubDate>Wed, 01 Mar 2017 19:27:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a7deae9-8d81-43bd-a878-2de1b8a86d25</guid><dc:creator>Iulian Mate?ica</dc:creator><description>&lt;p&gt;nRF51822 and IMU have each their own 32kHz oscillator. The only thing these two oscillators have in common is GND.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Correct TWI Sensor data only when programmer connected</title><link>https://devzone.nordicsemi.com/thread/78117?ContentTypeID=1</link><pubDate>Wed, 01 Mar 2017 19:22:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:631f74c4-e1cb-4789-8940-c33a3cf73669</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Have you connected the same 32.768 kHz crystal to both the nRF51822 and the IMU? Connecting the debugger to the SWD interface might put the chip in debug mode, which will force the clock sources to run. If this is the case, you can try starting the 32.768 kHz crystal from your nRF51822 device before initializing the IMU to use the external crystal.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Correct TWI Sensor data only when programmer connected</title><link>https://devzone.nordicsemi.com/thread/78110?ContentTypeID=1</link><pubDate>Wed, 01 Mar 2017 19:09:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec3cd380-84f1-4e3c-a66f-16ca01ecc89c</guid><dc:creator>Iulian Mate?ica</dc:creator><description>&lt;p&gt;Okay, I have found the problem.&lt;/p&gt;
&lt;p&gt;The IMU I am using accepts an external 32kHz crystal oscillator for better performance instead of the internal one. When I was initializing the TWI and my sensor I was configuring it to use external crystal. Now I have configured it to use the internal one and it works perfectly (with or without OpenOCD open/with or without ST-LinkV2 connected).&lt;/p&gt;
&lt;p&gt;I do not understand why it works with the external crystal for IMU only with OpenOCD running. Any ideas what could be the connection between those two is welcome. The wires I connect to the programmer are: SWDIO, SWDCLK and GND. No VCC - the board is powered from batteries.&lt;/p&gt;
&lt;p&gt;I will be using the internal oscillator but I will still investigate the problem. If I find anything I will let you know.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Correct TWI Sensor data only when programmer connected</title><link>https://devzone.nordicsemi.com/thread/78109?ContentTypeID=1</link><pubDate>Wed, 01 Mar 2017 17:37:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4cb0adc1-2261-4fad-8917-4b97e82eb74d</guid><dc:creator>Iulian Mate?ica</dc:creator><description>&lt;p&gt;I have observed right now that it transmits the correct values only when OpenOCD is running. If I close it, I get zero. It doesnt make any sense to me.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>