<?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>52832 master, through the I2S interface to transmit voice data to the DAC player</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21728/52832-master-through-the-i2s-interface-to-transmit-voice-data-to-the-dac-player</link><description>Hi, 
 Currently I have a problem with the use of 52832 I2S interface to transmit voice, the transmission is not coherent. 
 Here is my initialization code 
 // Enable reception
NRF_I2S-&amp;gt;CONFIG.RXEN = (I2S_CONFIG_RXEN_RXEN_Enabled &amp;lt;&amp;lt; I2S_CONFIG_RXEN_RXEN_Pos</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 19 May 2017 01:11:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21728/52832-master-through-the-i2s-interface-to-transmit-voice-data-to-the-dac-player" /><item><title>RE: 52832 master, through the I2S interface to transmit voice data to the DAC player</title><link>https://devzone.nordicsemi.com/thread/85354?ContentTypeID=1</link><pubDate>Fri, 19 May 2017 01:11:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ceddd74e-55b6-42de-8925-194ce8360a56</guid><dc:creator>???</dc:creator><description>&lt;p&gt;Hi Jørn,&lt;/p&gt;
&lt;p&gt;Thank you very much for your reply and the current problem has been settled.
Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52832 master, through the I2S interface to transmit voice data to the DAC player</title><link>https://devzone.nordicsemi.com/thread/85357?ContentTypeID=1</link><pubDate>Thu, 11 May 2017 07:15:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:280449e2-a645-4e7f-ac1b-16812e243cae</guid><dc:creator>J&amp;#248;rn</dc:creator><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;I apologize for the late response.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m trying to piece together what you are doing here. I see in your first image you are focusing on the 6-CLOCK line, and mark it with &amp;quot;a data processing&amp;quot;.&lt;br /&gt;
What exactly is the line named 6 – CLOCK in your plots?  Which clock is it?&lt;/p&gt;
&lt;p&gt;The data you are sending over I2S, are they defined in your firmware, or are they transmitted to your nRF?&lt;/p&gt;
&lt;p&gt;I think it would be helpful to see the full contents of the data you are sending in your test.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52832 master, through the I2S interface to transmit voice data to the DAC player</title><link>https://devzone.nordicsemi.com/thread/85359?ContentTypeID=1</link><pubDate>Fri, 05 May 2017 08:49:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4e0f70d-a21f-4d63-b8b4-1dbb7eb20006</guid><dc:creator>???</dc:creator><description>&lt;p&gt;你可以使用百度浏览器自带的网页翻译功能来浏览国外的网站.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52832 master, through the I2S interface to transmit voice data to the DAC player</title><link>https://devzone.nordicsemi.com/thread/85358?ContentTypeID=1</link><pubDate>Fri, 05 May 2017 08:47:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e495692-c780-4bb5-928d-823968abb58b</guid><dc:creator>micele</dc:creator><description>&lt;p&gt;见到能看懂了字了。。。。。。。。。。。。。。。。。。。&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52832 master, through the I2S interface to transmit voice data to the DAC player</title><link>https://devzone.nordicsemi.com/thread/85356?ContentTypeID=1</link><pubDate>Fri, 05 May 2017 08:17:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a46320e6-c101-449c-a5ce-81e0724ef54f</guid><dc:creator>???</dc:creator><description>&lt;p&gt;Hi Jørn,&lt;/p&gt;
&lt;p&gt;Thank you for your reply, the translation of the text on the picture will be uploaded in the subsequent comments, please help continue to answer, thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52832 master, through the I2S interface to transmit voice data to the DAC player</title><link>https://devzone.nordicsemi.com/thread/85355?ContentTypeID=1</link><pubDate>Fri, 05 May 2017 07:16:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:556fbff3-cda6-45c4-ae14-a258ac641f7e</guid><dc:creator>J&amp;#248;rn</dc:creator><description>&lt;p&gt;I&amp;#39;m sorry but I need some additional information before I can help you further. Could you please provide a more detailed description of what the incoherence you are seeing is? And could you please provide an english translation of the text in the pictures?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52832 master, through the I2S interface to transmit voice data to the DAC player</title><link>https://devzone.nordicsemi.com/thread/85353?ContentTypeID=1</link><pubDate>Fri, 05 May 2017 05:46:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1890d5ab-1cae-4f97-8503-0a901c72731b</guid><dc:creator>???</dc:creator><description>&lt;p&gt;Hi Jørn,&lt;/p&gt;
&lt;p&gt;But the problem has not been resolved, I hope you can continue to help.&lt;/p&gt;
&lt;p&gt;Here is the code I modified according to your opinion:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define MY_BUF_SIZE		64
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;static uint32_t my_tx_buf[MY_BUF_SIZE];&lt;/p&gt;
&lt;p&gt;static uint32_t my_rx_buf[MY_BUF_SIZE];&lt;/p&gt;
&lt;p&gt;Initialization:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;	// Enable reception
NRF_I2S-&amp;gt;CONFIG.RXEN = (I2S_CONFIG_RXEN_RXEN_Enabled &amp;lt;&amp;lt; I2S_CONFIG_RXEN_RXEN_Pos);
// Enable transmission
NRF_I2S-&amp;gt;CONFIG.TXEN = (I2S_CONFIG_TXEN_TXEN_Enabled &amp;lt;&amp;lt; I2S_CONFIG_TXEN_TXEN_Pos);
// Enable MCK generator
NRF_I2S-&amp;gt;CONFIG.MCKEN = (I2S_CONFIG_MCKEN_MCKEN_Enabled &amp;lt;&amp;lt; I2S_CONFIG_MCKEN_MCKEN_Pos);
// MCKFREQ = 16 kHz
NRF_I2S-&amp;gt;CONFIG.MCKFREQ = I2S_CONFIG_MCKFREQ_MCKFREQ_32MDIV21 &amp;lt;&amp;lt; I2S_CONFIG_MCKFREQ_MCKFREQ_Pos;
// Ratio = 96
NRF_I2S-&amp;gt;CONFIG.RATIO = I2S_CONFIG_RATIO_RATIO_96X &amp;lt;&amp;lt; I2S_CONFIG_RATIO_RATIO_Pos;
// MCKFREQ = 4 MHz and Ratio = 256 gives sample rate = 15.625 ks/s
// Sample width = 16 bit
NRF_I2S-&amp;gt;CONFIG.SWIDTH = I2S_CONFIG_SWIDTH_SWIDTH_16Bit &amp;lt;&amp;lt; I2S_CONFIG_SWIDTH_SWIDTH_Pos;
// Alignment = Left
NRF_I2S-&amp;gt;CONFIG.ALIGN = I2S_CONFIG_ALIGN_ALIGN_Left &amp;lt;&amp;lt; I2S_CONFIG_ALIGN_ALIGN_Pos;
// Format = I2S
NRF_I2S-&amp;gt;CONFIG.FORMAT = I2S_CONFIG_FORMAT_FORMAT_I2S &amp;lt;&amp;lt; I2S_CONFIG_FORMAT_FORMAT_Pos;
// Use Left
NRF_I2S-&amp;gt;CONFIG.CHANNELS = I2S_CONFIG_CHANNELS_CHANNELS_Left &amp;lt;&amp;lt; I2S_CONFIG_CHANNELS_CHANNELS_Pos;

// MCK routed to pin 20
NRF_I2S-&amp;gt;PSEL.MCK = (20 &amp;lt;&amp;lt; I2S_PSEL_MCK_PIN_Pos) | (I2S_PSEL_MCK_CONNECT_Connected &amp;lt;&amp;lt; I2S_PSEL_MCK_CONNECT_Pos);
// SCK routed to pin 22
NRF_I2S-&amp;gt;PSEL.SCK = (22 &amp;lt;&amp;lt; I2S_PSEL_SCK_PIN_Pos) | (I2S_PSEL_SCK_CONNECT_Connected &amp;lt;&amp;lt; I2S_PSEL_SCK_CONNECT_Pos);
// LRCK routed to pin 23
NRF_I2S-&amp;gt;PSEL.LRCK = (23 &amp;lt;&amp;lt; I2S_PSEL_LRCK_PIN_Pos) | (I2S_PSEL_LRCK_CONNECT_Connected &amp;lt;&amp;lt;I2S_PSEL_LRCK_CONNECT_Pos);
// SDOUT routed to pin 24
NRF_I2S-&amp;gt;PSEL.SDOUT = (24 &amp;lt;&amp;lt; I2S_PSEL_SDOUT_PIN_Pos) | (I2S_PSEL_SDOUT_CONNECT_Connected &amp;lt;&amp;lt; I2S_PSEL_SDOUT_CONNECT_Pos);
// SDIN routed on pin 25
NRF_I2S-&amp;gt;PSEL.SDIN = (25 &amp;lt;&amp;lt; I2S_PSEL_SDIN_PIN_Pos) | (I2S_PSEL_SDIN_CONNECT_Connected &amp;lt;&amp;lt; I2S_PSEL_SDIN_CONNECT_Pos);

NRF_I2S-&amp;gt;TXD.PTR = (uint32_t)my_tx_buf;
NRF_I2S-&amp;gt;RXD.PTR = (uint32_t)my_rx_buf;
NRF_I2S-&amp;gt;RXTXD.MAXCNT = MY_BUF_SIZE;

NRF_I2S-&amp;gt;ENABLE = 1;

NRF_I2S-&amp;gt;TASKS_START = 1;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Data transmission:&lt;/p&gt;
&lt;p&gt;void QcyI2sDataSend(uint32_t *BufferTx,uint16_t BufferTxLen)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if(NRF_I2S-&amp;gt;EVENTS_TXPTRUPD != 0)

{
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;//		NRF_I2S-&amp;gt;ENABLE = 1;&lt;/p&gt;
&lt;p&gt;//		NRF_I2S-&amp;gt;TASKS_START = 1;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;	NRF_I2S-&amp;gt;TXD.PTR = (uint32_t)BufferTx;

	NRF_I2S-&amp;gt;EVENTS_TXPTRUPD = 0;

}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Here are the results of the test.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/I2S_5F00_1.jpg" alt="image description" /&gt;
&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/I2S_5F00_2.jpg" alt="image description" /&gt;
&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/I2S_5F00_3.jpg" alt="image description" /&gt;
&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/I2S_5F00_4.jpg" alt="image description" /&gt;
&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/I2S_5F00_5.jpg" alt="image description" /&gt;
&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/I2S_5F00_6.jpg" alt="image description" /&gt;
&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/I2S_5F00_7.jpg" alt="image description" /&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know what&amp;#39;s going to happen, but it affects woxit.&lt;/p&gt;
&lt;p&gt;Look forward to your answer, thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52832 master, through the I2S interface to transmit voice data to the DAC player</title><link>https://devzone.nordicsemi.com/thread/85352?ContentTypeID=1</link><pubDate>Fri, 05 May 2017 03:49:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:808ea64b-db8f-4a34-b0b8-73aa71acb23a</guid><dc:creator>???</dc:creator><description>&lt;p&gt;Hi Jørn,&lt;/p&gt;
&lt;p&gt;Thank you very much for your help. Your suggestion has been verified and the problem has been further improved.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52832 master, through the I2S interface to transmit voice data to the DAC player</title><link>https://devzone.nordicsemi.com/thread/85351?ContentTypeID=1</link><pubDate>Wed, 03 May 2017 11:04:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7832ffba-8a1d-406b-b0ad-75cb78b7cd4f</guid><dc:creator>J&amp;#248;rn</dc:creator><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;I would recommend that you use the I2S driver that comes with the SDK, as it makes it easier to use the hardware.&lt;/p&gt;
&lt;p&gt;The code looks for the most part correct, however I am unsure if you are passing the TX and RX buffers correctly. I have tried your code and I have not gotten it to work.&lt;/p&gt;
&lt;p&gt;When the buffers are declared as&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define I2S_BUFFER_SIZE     1000
static uint32_t m_buffer_rx[I2S_BUFFER_SIZE];
static uint32_t m_buffer_tx[I2S_BUFFER_SIZE];
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;you should pass them as&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_I2S-&amp;gt;TXD.PTR = (uint32_t)m_buffer_tx;
NRF_I2S-&amp;gt;RXD.PTR = (uint32_t)m_buffer_rx;
NRF_I2S-&amp;gt;RXTXD.MAXCNT = I2S_BUFFER_SIZE;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is the same way they are passed in the I2S drivers that come with the SDK (see nrf_i2s_rx_buffer_set, in nrf_i2s.h). I have successfully done a loop-back test with this.
Keep in mind the EVENTS_TXPTRUPD and EVENTS_RXPTRUPD will trigger once at the beginning of a transfer, before any data has been received.&lt;/p&gt;
&lt;p&gt;Please see if this resolves your issue.&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Jørn Frøysa&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>