<?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>twi sensor</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/11113/twi-sensor</link><description>i am programming nrf-51 dk&amp;#39;s program. 
 i have to get data from sensor, so i am studying example code which is twi_sensor. 
 i don&amp;#39;t know well these function. 
 nrf_drv_twi_tx(&amp;amp;m_twi_mma_7660, MMA7660_ADDR, reg, sizeof(reg), false); 
 i know function</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 05 Jan 2016 14:47:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/11113/twi-sensor" /><item><title>RE: twi sensor</title><link>https://devzone.nordicsemi.com/thread/41630?ContentTypeID=1</link><pubDate>Tue, 05 Jan 2016 14:47:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e8dacba-177a-4dfa-bbd4-7d78deb6b37c</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;which arduino shield? Are the correct pins used?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: twi sensor</title><link>https://devzone.nordicsemi.com/thread/41622?ContentTypeID=1</link><pubDate>Tue, 05 Jan 2016 14:47:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac398a43-18b4-45ad-8002-72282115aa43</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;Why would you do make a bit-bang protocol when you have a hardware driver? Also the SDK have a bit-bang driver that is called tw_sw_master.&lt;/p&gt;
&lt;p&gt;Anyhow, the problem is probably with the pins used, connecting a oscilloscope or logic analyzer would be a smart.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: twi sensor</title><link>https://devzone.nordicsemi.com/thread/41627?ContentTypeID=1</link><pubDate>Sat, 02 Jan 2016 07:12:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80e31438-52d3-4666-9ecb-d9bf13c3d493</guid><dc:creator>hong min</dc:creator><description>&lt;p&gt;Please remind always check the hardware at first , almost troubles from hardware side.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Check the pin assign as same as the software defined&lt;/li&gt;
&lt;li&gt;Check the voltage of VDD/SDA/SCL pins&lt;/li&gt;
&lt;li&gt;Check the the device address , if its a flexible addressing device ,make sure the schematic is same as you defined in software.&lt;/li&gt;
&lt;li&gt;Check your pin assign to arduino .&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;After check the hardware finish.
Next check the timing digram is correct by using  oscilloscope or i2c logic analyzer.
If it not same as sensor specification , it strongly problem in software.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: twi sensor</title><link>https://devzone.nordicsemi.com/thread/41625?ContentTypeID=1</link><pubDate>Sat, 02 Jan 2016 06:33:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6b5967d-319a-4225-af97-13b4ce841278</guid><dc:creator>hardnrf</dc:creator><description>&lt;p&gt;i have a arduino shield that is i2c device, and i succeeded to fetching sensor data with arduino uno board.&lt;/p&gt;
&lt;p&gt;but it is not work in nrf.&lt;/p&gt;
&lt;p&gt;please confirm you private message&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: twi sensor</title><link>https://devzone.nordicsemi.com/thread/41624?ContentTypeID=1</link><pubDate>Sat, 02 Jan 2016 06:29:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c87bc02b-4b00-49fb-a813-0060390bc896</guid><dc:creator>hong min</dc:creator><description>&lt;p&gt;so do u have the i2c device now ?
if not , it cannot fetch the sensor data.
If you have the sensor device, please check the electrical specification of I2c requirement.
Check the hardware schematic of yours device at first.
Next check the resistance of i2c pins and VDD current.
If you prepare ready , connect i2c pins to PCA10028 as you want twi module instance.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: twi sensor</title><link>https://devzone.nordicsemi.com/thread/41623?ContentTypeID=1</link><pubDate>Sat, 02 Jan 2016 06:12:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6ac30a5-f579-49a7-b9e1-310654a9e347</guid><dc:creator>hardnrf</dc:creator><description>&lt;p&gt;my board number is PCA 10028 V1.10 2015.24.&lt;/p&gt;
&lt;p&gt;so what should i do for getting the sensor data?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: twi sensor</title><link>https://devzone.nordicsemi.com/thread/41626?ContentTypeID=1</link><pubDate>Sat, 02 Jan 2016 06:05:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4deda5cb-6df6-4152-8cd3-beaf00da1391</guid><dc:creator>hong min</dc:creator><description>&lt;p&gt;Sorry , Im not come from Korea.
Could you tell me the DK borad number . It print on the label.
just like that:
PCA 10028
V1.10
2015.24&lt;/p&gt;
&lt;p&gt;If so, this board not include the MMA7660&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: twi sensor</title><link>https://devzone.nordicsemi.com/thread/41631?ContentTypeID=1</link><pubDate>Sat, 02 Jan 2016 06:04:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83c98e85-77cb-4599-b0f5-960c29a85ce7</guid><dc:creator>hardnrf</dc:creator><description>&lt;p&gt;and i use a arduino shield&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: twi sensor</title><link>https://devzone.nordicsemi.com/thread/41632?ContentTypeID=1</link><pubDate>Sat, 02 Jan 2016 06:00:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56666af9-6462-4d4e-92fa-84cbd5a79f37</guid><dc:creator>hardnrf</dc:creator><description>&lt;p&gt;im using nrf-51 dk and v1.1 sdk alpha.&lt;/p&gt;
&lt;p&gt;excuse me, are you korean?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: twi sensor</title><link>https://devzone.nordicsemi.com/thread/41629?ContentTypeID=1</link><pubDate>Sat, 02 Jan 2016 05:56:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:806056da-4d0a-4088-bc0f-1426bfa2defc</guid><dc:creator>hong min</dc:creator><description>&lt;p&gt;Im glad i could help you.
First , please tell me what board you&amp;#39;re using. I&amp;#39;m afraid that you just using the board. It doesnt have
other peripheral i2c device.  So you send the command to device ,you would never get the result.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: twi sensor</title><link>https://devzone.nordicsemi.com/thread/41620?ContentTypeID=1</link><pubDate>Sat, 02 Jan 2016 05:50:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1523ac0c-0058-4c12-9ed3-49355cd9aae1</guid><dc:creator>hong min</dc:creator><description>&lt;p&gt;By the way . i dont have this example , so i just geuss the m_set_mode_done  is a ack of callback that MMA7660 is enable finish or not.&lt;/p&gt;
&lt;p&gt;The program stuck in here becaue the MMA7660 is not yet ready or other reasons.
Please ensure the slave of address, i2c pin assign , pin config is correct.
If you have checked above , please check the timing of i2c protocol is right.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: twi sensor</title><link>https://devzone.nordicsemi.com/thread/41628?ContentTypeID=1</link><pubDate>Sat, 02 Jan 2016 05:50:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a07cf20d-df21-44be-9ee9-b2d7a07feac0</guid><dc:creator>hardnrf</dc:creator><description>&lt;p&gt;thank you very much!!!&lt;/p&gt;
&lt;p&gt;but i cannot understand your answer.....&lt;/p&gt;
&lt;p&gt;could you recommend any books or supplements about basics of these?&lt;/p&gt;
&lt;p&gt;i&amp;#39;m student so i need study more,,,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: twi sensor</title><link>https://devzone.nordicsemi.com/thread/41621?ContentTypeID=1</link><pubDate>Sat, 02 Jan 2016 05:36:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c70f552f-034b-43e3-ad6a-2c170fc6a8ae</guid><dc:creator>hong min</dc:creator><description>&lt;p&gt;Maybe I can explain to you.
But i think you can try to write a i2c bit-bang protocol , you could be familiar with i2c.
The i2c address is shown in your heart rate sensor specification , it usually as 7-bit address.
Some sensor i2c address is fixed , some is flexible and determined by hardware pin setting.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s example of flexible address of device - ADXL345.
if the ALT_ADDRESS pin pull high , the ADXL345 address would be 0x1D
if the ALT_ADDRESS pin grounded , the ADXL345 address would be 0x53&lt;/p&gt;
&lt;p&gt;If you try to read register val with ADXL345, you need send slave address(ADXL345) with write byte at first transmitting.
&amp;lt;7bit address&amp;gt;+
So if my ADXL345 address is 0x1D , the full 8bits would be 0x1D&amp;lt;&amp;lt;1.&lt;/p&gt;
&lt;p&gt;Next you need send yours desired register address, it could be 8 bit or greater.
The ADXL345 register is 8bit assigned. So you just need send the address of register.
Like 0x32 (the high byte data of X-axis)&lt;/p&gt;
&lt;p&gt;Next , you need send the slave address of ADXL345 with read bit , it would be  (0x1D&amp;lt;&amp;lt;1)|0x01&lt;/p&gt;
&lt;p&gt;Finally , you can read the data from register.&lt;/p&gt;
&lt;p&gt;So if you want to try hardware twi , refer to the twi api, the theory is the same.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>