<?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>I2S</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84624/i2s</link><description>HI 
 I am using the I2S on the nRF52840DK I have constructed an array and all works well except once I start it , it continues to run, I cant get it to play the sample just once, how can I do this 
 Start Code 
 NRF_I2S-&amp;gt;ENABLE = 1; 
 // Configure data</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 24 Feb 2022 12:19:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84624/i2s" /><item><title>RE: I2S</title><link>https://devzone.nordicsemi.com/thread/354806?ContentTypeID=1</link><pubDate>Thu, 24 Feb 2022 12:19:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0fa8c143-f685-4ba6-8a25-d1b3c32d1f19</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Try declaring it as static outside the function as in the example;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1645705159445v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S</title><link>https://devzone.nordicsemi.com/thread/354420?ContentTypeID=1</link><pubDate>Tue, 22 Feb 2022 16:55:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38f0e0a1-ae69-4095-bb5b-92cd8648c5bb</guid><dc:creator>DPJONES</dc:creator><description>&lt;p&gt;Hi&amp;nbsp; Jared&lt;/p&gt;
&lt;p&gt;I have replaced the code as you suggested, I am using an int16 array of 8192,&amp;nbsp;so I have used a cast to unint32, but when compiled I get the error below.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/cast_5F00_error.JPG" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Thanks for your help&amp;nbsp;&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S</title><link>https://devzone.nordicsemi.com/thread/354374?ContentTypeID=1</link><pubDate>Tue, 22 Feb 2022 13:50:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e38c5ad-f002-412f-a796-0e79d4764f74</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;That&amp;#39;s not how you should pass the buffer as a parameter. Look at the I2S example, first you declare a&amp;nbsp;nrf_drv_i2s_buffers_t struct which hold the TX and/or RX buffer. Then you pass the pointer address nrf_drv_i2s_buffers_t&amp;nbsp;struct to the&amp;nbsp;nrf_drv_i2s_start(). I2S example:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1645537761285v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S</title><link>https://devzone.nordicsemi.com/thread/353973?ContentTypeID=1</link><pubDate>Sat, 19 Feb 2022 10:07:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0aecc3b-1ae2-42a7-894a-8a9f2200ca07</guid><dc:creator>DPJONES</dc:creator><description>&lt;p&gt;Hi Jared&lt;/p&gt;
&lt;p&gt;Here I have tried to use the nrf_drv_i2s_start&amp;nbsp; but&amp;nbsp; giving warnings my array is an int16_t&amp;nbsp; so have tried to cast, this seems to be what the function expects.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;err_code = nrf_drv_i2s_start((uint32_t)sine_table2, 8192, 0);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;Here are the warnings.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/I2s_5F00_capture.JPG" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Can you please advice where I am going wrong.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S</title><link>https://devzone.nordicsemi.com/thread/353795?ContentTypeID=1</link><pubDate>Fri, 18 Feb 2022 09:57:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1dc32f3-1cb2-4972-8234-af3d3e023bc1</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi there,&lt;/p&gt;
&lt;p&gt;I agree that the example from the SDK might be too complicated for someone that is just starting using our products. The bare-metal example I shared earlier should worked as I did test it before I uploaded it. Regarding your code:&lt;/p&gt;
[quote user="DPJONES"]NRF_I2S-&amp;gt;TXD.PTR = (uint32_t)&amp;amp;sine_table2[0];&lt;br /&gt; NRF_I2S-&amp;gt;RXTXD.MAXCNT = sizeof(sine_table2) / sizeof(uint32_t);&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; NRF_I2S-&amp;gt;ENABLE = 1; &lt;br /&gt; NRF_I2S-&amp;gt;TASKS_START = 1;[/quote]
&lt;p&gt;This block should be replaced by calling&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__drv__i2s.html#gaeafb1391aa86b8f1cab9b82c8fdb562d"&gt;nrf_drv_i2s_start&lt;/a&gt;() where you pass the buffer, the buffer size as parameters. At the end of the function it will start the transfer, by triggering the START task.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The data handler should be called when the peripheral has finished accessing the buffer. You can therefore stop the function when the handler is called.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S</title><link>https://devzone.nordicsemi.com/thread/353548?ContentTypeID=1</link><pubDate>Thu, 17 Feb 2022 10:01:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96678fc7-aff6-4ca1-8f0c-4ef6c6788e35</guid><dc:creator>DPJONES</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I have used the driver to config the device but I still have 4 lines of code that are bare bones can you please assist me in converting them to use the driver. Please bare in mind this is the first time I have used your product/code.&amp;nbsp; my code is below&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;#define PIN_MCK (41) //P1.09&lt;br /&gt;#define PIN_BCLK (40) //P1.08&lt;br /&gt;#define PIN_LRCK (38) //P1.06&lt;br /&gt;#define PIN_SDOUT (39) //P1.07&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;static void data_handler(nrf_drv_i2s_buffers_t const * p_released,uint32_t status)&lt;br /&gt;{&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;int main(void)&lt;br /&gt;{&lt;br /&gt; uint32_t err_code = NRF_SUCCESS;&lt;/p&gt;
&lt;p&gt;nrf_gpio_cfg_output(LED);&lt;br /&gt; nrf_gpio_cfg_input(Button, NRF_GPIO_PIN_PULLUP);&lt;/p&gt;
&lt;p&gt;err_code = NRF_LOG_INIT(NULL);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt; &lt;br /&gt; nrf_drv_i2s_config_t config = NRF_DRV_I2S_DEFAULT_CONFIG;&lt;br /&gt; &lt;br /&gt; config.sck_pin = PIN_BCLK;&lt;br /&gt; config.lrck_pin = PIN_LRCK;&lt;br /&gt; config.sdout_pin = PIN_SDOUT;&lt;br /&gt; &lt;br /&gt; config.mode = I2S_CONFIG_MODE_MODE_Master;&lt;br /&gt; config.sample_width = I2S_CONFIG_SWIDTH_SWIDTH_16BIT;&lt;/p&gt;
&lt;p&gt;config.mck_setup = NRF_I2S_MCK_32MDIV8;&lt;br /&gt; config.ratio = NRF_I2S_RATIO_512X;&lt;br /&gt; config.channels = NRF_I2S_CHANNELS_RIGHT;&lt;/p&gt;
&lt;p&gt;err_code = nrf_drv_i2s_init(&amp;amp;config, data_handler);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; // sine_table2[8192] from sounds.h&lt;br /&gt; // Configure data pointer&lt;br /&gt; NRF_I2S-&amp;gt;TXD.PTR = (uint32_t)&amp;amp;sine_table2[0];&lt;br /&gt; NRF_I2S-&amp;gt;RXTXD.MAXCNT = sizeof(sine_table2) / sizeof(uint32_t);&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; NRF_I2S-&amp;gt;ENABLE = 1; &lt;br /&gt; NRF_I2S-&amp;gt;TASKS_START = 1;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; for (;;)&lt;br /&gt; {&lt;br /&gt; __WFE();&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S</title><link>https://devzone.nordicsemi.com/thread/353036?ContentTypeID=1</link><pubDate>Tue, 15 Feb 2022 09:36:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d905e397-15e8-40ed-8145-52581ceed2f4</guid><dc:creator>DPJONES</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;That is the problem, I don&amp;#39;t know how to Write it using the driver.&lt;/p&gt;
&lt;p&gt;I found this code online and it worked but not for a single shot, you gave me the code with an interrupt handler as above but that doesn&amp;#39;t work.&lt;/p&gt;
&lt;p&gt;The code you recommended (&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/i2s_example_loopback.html?cp=8_1_4_6_15"&gt;I2S example in the SDK&lt;/a&gt;),&amp;nbsp; does not use an interrupt handler I don&amp;#39;t understand it.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S</title><link>https://devzone.nordicsemi.com/thread/353025?ContentTypeID=1</link><pubDate>Tue, 15 Feb 2022 08:42:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0148502e-8a65-40c7-97eb-85e33cfbf022</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You&amp;#39;re mixing the usage of the driver and writing directly to the peripheral. All calls that starts with&amp;nbsp;&lt;span&gt;NRF_I2S-&amp;gt; is omitting&amp;nbsp;the driver and writing directly&amp;nbsp;to the driver. I suggest that you clean up your code and remove all parts that write directly&amp;nbsp;to the peripheral and only use the driver.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Jared&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S</title><link>https://devzone.nordicsemi.com/thread/352886?ContentTypeID=1</link><pubDate>Mon, 14 Feb 2022 13:00:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a4bcfe9-2c72-429a-96ab-dc3be2f7b86f</guid><dc:creator>DPJONES</dc:creator><description>&lt;p&gt;Hi Jared&lt;/p&gt;
&lt;p&gt;Yes I have taken a look at the code but don&amp;#39;t really understand it, I have attached my latest code and have&amp;nbsp; excluded from the build the nrfx_i2s the program compiles now without issue.&lt;/p&gt;
&lt;p&gt;The problem is when I run the program it seems to go immediately&amp;nbsp;to the interrupt and doesn&amp;#39;t play my file at all.&lt;/p&gt;
&lt;p&gt;I have confirmed this in debug mode&amp;nbsp;it goes &lt;span&gt;immediately&lt;/span&gt; to the Interrupt.&lt;/p&gt;
&lt;p&gt;can you please assist.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;#include &amp;quot;nrf_drv_i2s.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_delay.h&amp;quot;&lt;br /&gt;#include &amp;quot;app_util_platform.h&amp;quot;&lt;br /&gt;#include &amp;quot;app_error.h&amp;quot;&lt;br /&gt;#include &amp;quot;boards.h&amp;quot;&lt;/p&gt;
&lt;p&gt;#include &amp;quot;nrf_log.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_log_ctrl.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_log_default_backends.h&amp;quot;&lt;/p&gt;
&lt;p&gt;#include &amp;lt;nrf.h&amp;gt;&lt;/p&gt;
&lt;p&gt;#include &amp;quot;sounds.h&amp;quot;&lt;/p&gt;
&lt;p&gt;#define PIN_MCK (41) //P1.09&lt;br /&gt;#define PIN_BCLK (40) //P1.08&lt;br /&gt;#define PIN_LRCK (38) //P1.06&lt;br /&gt;#define PIN_SDOUT (39) //P1.07&lt;/p&gt;
&lt;p&gt;#define Button 11&lt;br /&gt;#define LED 13&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;int main(void)&lt;br /&gt;{&lt;br /&gt; uint32_t err_code = NRF_SUCCESS;&lt;/p&gt;
&lt;p&gt;err_code = NRF_LOG_INIT(NULL);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;NRF_LOG_DEFAULT_BACKENDS_INIT();&lt;/p&gt;
&lt;p&gt;NRF_LOG_INFO(&amp;quot;I2S loopback example started.&amp;quot;);&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; // Enable transmission&lt;br /&gt; NRF_I2S-&amp;gt;CONFIG.TXEN = (I2S_CONFIG_TXEN_TXEN_ENABLE &amp;lt;&amp;lt; I2S_CONFIG_TXEN_TXEN_Pos);&lt;/p&gt;
&lt;p&gt;// Enable MCK generator&lt;br /&gt; NRF_I2S-&amp;gt;CONFIG.MCKEN = (I2S_CONFIG_MCKEN_MCKEN_ENABLE &amp;lt;&amp;lt; I2S_CONFIG_MCKEN_MCKEN_Pos);&lt;/p&gt;
&lt;p&gt;// MCKFREQ = 4 MHz&lt;br /&gt; NRF_I2S-&amp;gt;CONFIG.MCKFREQ = I2S_CONFIG_MCKFREQ_MCKFREQ_32MDIV8 &amp;lt;&amp;lt; I2S_CONFIG_MCKFREQ_MCKFREQ_Pos;&lt;/p&gt;
&lt;p&gt;// Ratio = 64 &lt;br /&gt; NRF_I2S-&amp;gt;CONFIG.RATIO = I2S_CONFIG_RATIO_RATIO_512X &amp;lt;&amp;lt; I2S_CONFIG_RATIO_RATIO_Pos;&lt;/p&gt;
&lt;p&gt;// Master mode, 16Bit, left aligned&lt;br /&gt; NRF_I2S-&amp;gt;CONFIG.MODE = I2S_CONFIG_MODE_MODE_MASTER &amp;lt;&amp;lt; I2S_CONFIG_MODE_MODE_Pos;&lt;br /&gt; NRF_I2S-&amp;gt;CONFIG.SWIDTH = I2S_CONFIG_SWIDTH_SWIDTH_16BIT &amp;lt;&amp;lt; I2S_CONFIG_SWIDTH_SWIDTH_Pos;&lt;br /&gt; NRF_I2S-&amp;gt;CONFIG.ALIGN = I2S_CONFIG_ALIGN_ALIGN_LEFT &amp;lt;&amp;lt; I2S_CONFIG_ALIGN_ALIGN_Pos;&lt;/p&gt;
&lt;p&gt;// Format = I2S&lt;br /&gt; NRF_I2S-&amp;gt;CONFIG.FORMAT = I2S_CONFIG_FORMAT_FORMAT_I2S &amp;lt;&amp;lt; I2S_CONFIG_FORMAT_FORMAT_Pos;&lt;br /&gt; &lt;br /&gt; // Use stereo &lt;br /&gt; NRF_I2S-&amp;gt;CONFIG.CHANNELS = I2S_CONFIG_CHANNELS_CHANNELS_RIGHT &amp;lt;&amp;lt; I2S_CONFIG_CHANNELS_CHANNELS_Pos;&lt;br /&gt; &lt;br /&gt; // Configure pins&lt;br /&gt; NRF_I2S-&amp;gt;PSEL.MCK = (PIN_MCK &amp;lt;&amp;lt; I2S_PSEL_MCK_PIN_Pos);&lt;br /&gt; NRF_I2S-&amp;gt;PSEL.SCK = (PIN_BCLK &amp;lt;&amp;lt; I2S_PSEL_SCK_PIN_Pos); &lt;br /&gt; NRF_I2S-&amp;gt;PSEL.LRCK = (PIN_LRCK &amp;lt;&amp;lt; I2S_PSEL_LRCK_PIN_Pos); &lt;br /&gt; NRF_I2S-&amp;gt;PSEL.SDOUT = (PIN_SDOUT &amp;lt;&amp;lt; I2S_PSEL_SDOUT_PIN_Pos);&lt;br /&gt; &lt;br /&gt; NRF_I2S-&amp;gt;ENABLE = 1;&lt;/p&gt;
&lt;p&gt;// Configure data pointer&lt;br /&gt; NRF_I2S-&amp;gt;TXD.PTR = (uint32_t)&amp;amp;sine_table2[0];&lt;br /&gt; NRF_I2S-&amp;gt;RXTXD.MAXCNT = sizeof(sine_table2) / sizeof(uint32_t);&lt;/p&gt;
&lt;p&gt;//Enable interrupt and IRQ&lt;br /&gt; NRF_I2S-&amp;gt;INTENSET = I2S_INTENSET_TXPTRUPD_Enabled &amp;lt;&amp;lt; I2S_INTENSET_TXPTRUPD_Pos;&lt;br /&gt; NRF_I2S-&amp;gt;EVENTS_TXPTRUPD = 0;&lt;br /&gt; //NVIC_EnableIRQ(I2S_IRQn);&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; nrf_gpio_cfg_output(LED);&lt;br /&gt; nrf_gpio_cfg_input(Button, NRF_GPIO_PIN_PULLUP);&lt;/p&gt;
&lt;p&gt;// Start transmitting I2S data&lt;br /&gt; NRF_I2S-&amp;gt;ENABLE = 1;&lt;br /&gt; NRF_I2S-&amp;gt;TASKS_START = 1;&lt;/p&gt;
&lt;p&gt;//nrf_delay_ms(1200);&lt;br /&gt; NVIC_EnableIRQ(I2S_IRQn);&lt;/p&gt;
&lt;p&gt;for (;;)&lt;br /&gt; {&lt;br /&gt; &lt;br /&gt; //if(nrf_gpio_pin_read(Button) == 0)&lt;br /&gt; //{&lt;br /&gt; // nrf_gpio_pin_clear(LED); &lt;br /&gt; // // Start transmitting I2S data&lt;br /&gt; // //NRF_I2S-&amp;gt;ENABLE = 1;&lt;br /&gt; // //NRF_I2S-&amp;gt;TASKS_START = 0; &lt;br /&gt; // //printf(&amp;quot;Button is Pressed \r\n&amp;quot;); &lt;br /&gt; //}&lt;br /&gt; //else&lt;br /&gt; //{&lt;br /&gt; // nrf_gpio_pin_set(LED);&lt;br /&gt; // // Start transmitting I2S data&lt;br /&gt; // //NRF_I2S-&amp;gt;ENABLE = 0;&lt;br /&gt; // //NRF_I2S-&amp;gt;TASKS_START = 1;&lt;br /&gt; // //printf(&amp;quot;Button is Released \r\n&amp;quot;);&lt;/p&gt;
&lt;p&gt;//}&lt;br /&gt; &lt;br /&gt; // // Wait for an event.&lt;br /&gt; // //__WFE();&lt;br /&gt; // // Clear the event register.&lt;br /&gt; // //__SEV();&lt;br /&gt; // // __WFE();&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;////NRF_LOG_FLUSH();&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;void I2S_IRQHandler(void)&lt;br /&gt;{&lt;br /&gt; if (NRF_I2S-&amp;gt;EVENTS_TXPTRUPD == 1)&lt;br /&gt; {&lt;br /&gt; NRF_I2S-&amp;gt;EVENTS_TXPTRUPD = 0;&lt;br /&gt; NRF_I2S-&amp;gt;TASKS_STOP = 1;&lt;br /&gt; nrf_delay_ms(100);&lt;br /&gt; }&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind Regards&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S</title><link>https://devzone.nordicsemi.com/thread/352849?ContentTypeID=1</link><pubDate>Mon, 14 Feb 2022 11:19:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4cc31d5-bfc0-40c0-84e5-84c5ce094b87</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Have you seen our &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/i2s_example_loopback.html?cp=8_1_4_6_15"&gt;I2S example in the SDK&lt;/a&gt;? It shows how you can use the driver to stop a transfer after the a specific number of data has been transferred.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S</title><link>https://devzone.nordicsemi.com/thread/352705?ContentTypeID=1</link><pubDate>Fri, 11 Feb 2022 16:04:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ccd7636-948f-4354-96cf-079df3845f2a</guid><dc:creator>DPJONES</dc:creator><description>&lt;p&gt;Hi Jared&lt;/p&gt;
&lt;p&gt;Thanks for getting back so promptly, I am trying to use your driver please see code below (first time I have used Nordic), I think I am mixing both, but it does work can you please amend so I am only using your driver and I am able to use the interrupt.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;#include &amp;quot;nrf_drv_i2s.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_delay.h&amp;quot;&lt;br /&gt;#include &amp;quot;app_util_platform.h&amp;quot;&lt;br /&gt;#include &amp;quot;app_error.h&amp;quot;&lt;br /&gt;#include &amp;quot;boards.h&amp;quot;&lt;/p&gt;
&lt;p&gt;#include &amp;quot;nrf_log.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_log_ctrl.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_log_default_backends.h&amp;quot;&lt;/p&gt;
&lt;p&gt;#include &amp;lt;nrf.h&amp;gt;&lt;/p&gt;
&lt;p&gt;#include &amp;quot;sounds.h&amp;quot;&lt;/p&gt;
&lt;p&gt;#define PIN_MCK (41) //P1.09&lt;br /&gt;#define PIN_BCLK (40) //P1.08&lt;br /&gt;#define PIN_LRCK (38) //P1.06&lt;br /&gt;#define PIN_SDOUT (39) //P1.07&lt;/p&gt;
&lt;p&gt;#define Button 11&lt;br /&gt;#define LED 13&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;static void data_handler(nrf_drv_i2s_buffers_t const * p_released,uint32_t status)&lt;br /&gt;{&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;int main(void)&lt;br /&gt;{&lt;br /&gt; uint32_t err_code = NRF_SUCCESS;&lt;/p&gt;
&lt;p&gt;err_code = NRF_LOG_INIT(NULL);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt; &lt;br /&gt; nrf_drv_i2s_config_t config = NRF_DRV_I2S_DEFAULT_CONFIG;&lt;br /&gt; &lt;br /&gt; config.sck_pin = PIN_BCLK;&lt;br /&gt; config.lrck_pin = PIN_LRCK;&lt;br /&gt; config.sdout_pin = PIN_SDOUT;&lt;br /&gt; &lt;br /&gt; config.mode = I2S_CONFIG_MODE_MODE_Master;&lt;br /&gt; config.sample_width = I2S_CONFIG_SWIDTH_SWIDTH_16BIT;&lt;/p&gt;
&lt;p&gt;config.mck_setup = NRF_I2S_MCK_32MDIV8;&lt;br /&gt; config.ratio = NRF_I2S_RATIO_512X;&lt;br /&gt; config.channels = NRF_I2S_CHANNELS_RIGHT;&lt;/p&gt;
&lt;p&gt;err_code = nrf_drv_i2s_init(&amp;amp;config, data_handler);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; &lt;br /&gt; // // Enable transmission&lt;br /&gt; NRF_I2S-&amp;gt;CONFIG.TXEN = (I2S_CONFIG_TXEN_TXEN_ENABLE &amp;lt;&amp;lt; I2S_CONFIG_TXEN_TXEN_Pos);&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;// // Configure data pointer&lt;br /&gt; NRF_I2S-&amp;gt;TXD.PTR = (uint32_t)&amp;amp;sine_table2[0];&lt;br /&gt; NRF_I2S-&amp;gt;RXTXD.MAXCNT = sizeof(sine_table2) / sizeof(uint32_t);&lt;br /&gt; &lt;br /&gt; nrf_gpio_cfg_output(LED);&lt;br /&gt; nrf_gpio_cfg_input(Button, NRF_GPIO_PIN_PULLUP);&lt;br /&gt; &lt;br /&gt; NRF_I2S-&amp;gt;ENABLE = 1;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; NRF_I2S-&amp;gt;TASKS_START = 1;&lt;/p&gt;
&lt;p&gt;for (;;)&lt;br /&gt; {&lt;br /&gt; &lt;br /&gt; if(nrf_gpio_pin_read(Button) == 0)&lt;br /&gt; {&lt;br /&gt; nrf_gpio_pin_clear(LED); &lt;br /&gt; //printf(&amp;quot;Button is Pressed \r\n&amp;quot;); &lt;br /&gt; }&lt;br /&gt; else&lt;br /&gt; {&lt;br /&gt; nrf_gpio_pin_set(LED);&lt;br /&gt; //printf(&amp;quot;Button is Released \r\n&amp;quot;); &lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; // Wait for an event.&lt;br /&gt; //__WFE();&lt;br /&gt; // Clear the event register.&lt;br /&gt; //__SEV();&lt;br /&gt; // __WFE();&lt;/p&gt;
&lt;p&gt;//NRF_LOG_FLUSH();&lt;br /&gt; &lt;br /&gt; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S</title><link>https://devzone.nordicsemi.com/thread/352654?ContentTypeID=1</link><pubDate>Fri, 11 Feb 2022 14:01:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f679a887-cd1e-40f2-94c0-45fe158f4e4d</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It&amp;#39;s because you have included a source file which already contains the definition of the IRQ handler, the error message specifies that this is first defined in nrfx_I2S. I suggest omitting the driver from the project if you&amp;#39;re only going to use the peripheral bare metal.&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S</title><link>https://devzone.nordicsemi.com/thread/352650?ContentTypeID=1</link><pubDate>Fri, 11 Feb 2022 13:52:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b7fe90f-8b13-48e8-adbf-d7bee3aec97c</guid><dc:creator>DPJONES</dc:creator><description>&lt;p&gt;Hi Jared&lt;/p&gt;
&lt;p&gt;Thank for sending this code, the only problem is, when I put in&amp;nbsp;&lt;/p&gt;
&lt;p&gt;//IRQ handler&lt;/p&gt;
&lt;p&gt;void I2S_IRQHandler(void)&lt;br /&gt;{&lt;br /&gt; if (NRF_I2S-&amp;gt;EVENTS_TXPTRUPD == 1)&lt;br /&gt; {&lt;br /&gt; NRF_I2S-&amp;gt;EVENTS_TXPTRUPD = 0;&lt;br /&gt; NRF_I2S-&amp;gt;TASKS_STOP = 1;&lt;/p&gt;
&lt;p&gt;}&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;I get these errors please see attached&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/I2S_5F00_Error.JPG" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you for all your help&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S</title><link>https://devzone.nordicsemi.com/thread/352590?ContentTypeID=1</link><pubDate>Fri, 11 Feb 2022 12:19:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:526fa402-fabe-4d5a-ac52-b7b75bb6379c</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Here you go:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;nrf.h&amp;gt;

#define PIN_MCK    (13)
#define PIN_SCK    (14)
#define PIN_LRCK   (15)
#define PIN_SDOUT  (16)

int main(void)
{
  // Sine table (stereo, so every value is duplicated)
  int16_t sine_table[] = { 0, 0, 23170, 23170, 32767, 32767, 23170, 23170, 0, 0, -23170, -23170, -32768, -32768, -23170, -23170};
  
  // Enable transmission
  NRF_I2S-&amp;gt;CONFIG.TXEN = (I2S_CONFIG_TXEN_TXEN_ENABLE &amp;lt;&amp;lt; I2S_CONFIG_TXEN_TXEN_Pos);
  
  // Enable MCK generator
  NRF_I2S-&amp;gt;CONFIG.MCKEN = (I2S_CONFIG_MCKEN_MCKEN_ENABLE &amp;lt;&amp;lt; I2S_CONFIG_MCKEN_MCKEN_Pos);
  
  // MCKFREQ = 4 MHz
  NRF_I2S-&amp;gt;CONFIG.MCKFREQ = I2S_CONFIG_MCKFREQ_MCKFREQ_32MDIV11  &amp;lt;&amp;lt; I2S_CONFIG_MCKFREQ_MCKFREQ_Pos;
  
  // Ratio = 64 
  NRF_I2S-&amp;gt;CONFIG.RATIO = I2S_CONFIG_RATIO_RATIO_64X &amp;lt;&amp;lt; I2S_CONFIG_RATIO_RATIO_Pos;
    
  // Master mode, 16Bit, left aligned
  NRF_I2S-&amp;gt;CONFIG.MODE = I2S_CONFIG_MODE_MODE_MASTER &amp;lt;&amp;lt; I2S_CONFIG_MODE_MODE_Pos;
  NRF_I2S-&amp;gt;CONFIG.SWIDTH = I2S_CONFIG_SWIDTH_SWIDTH_16BIT &amp;lt;&amp;lt; I2S_CONFIG_SWIDTH_SWIDTH_Pos;
  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 stereo 
  NRF_I2S-&amp;gt;CONFIG.CHANNELS = I2S_CONFIG_CHANNELS_CHANNELS_STEREO &amp;lt;&amp;lt; I2S_CONFIG_CHANNELS_CHANNELS_Pos;
  
  // Configure pins
  NRF_I2S-&amp;gt;PSEL.MCK = (PIN_MCK &amp;lt;&amp;lt; I2S_PSEL_MCK_PIN_Pos);
  NRF_I2S-&amp;gt;PSEL.SCK = (PIN_SCK &amp;lt;&amp;lt; I2S_PSEL_SCK_PIN_Pos); 
  NRF_I2S-&amp;gt;PSEL.LRCK = (PIN_LRCK &amp;lt;&amp;lt; I2S_PSEL_LRCK_PIN_Pos); 
  NRF_I2S-&amp;gt;PSEL.SDOUT = (PIN_SDOUT &amp;lt;&amp;lt; I2S_PSEL_SDOUT_PIN_Pos);
  
  
  // Configure data pointer
  NRF_I2S-&amp;gt;TXD.PTR = (uint32_t)&amp;amp;sine_table[0];
  NRF_I2S-&amp;gt;RXTXD.MAXCNT = sizeof(sine_table) / sizeof(uint32_t);
  
  //Enable interrupt and IRQ
  NRF_I2S-&amp;gt;INTENSET = I2S_INTENSET_TXPTRUPD_Enabled &amp;lt;&amp;lt; I2S_INTENSET_TXPTRUPD_Pos;

  
  NVIC_EnableIRQ(I2S_IRQn);
  
  NRF_I2S-&amp;gt;ENABLE = 1;
  // Start transmitting I2S data
  NRF_I2S-&amp;gt;TASKS_START = 1;
  
  
  // Since we are not updating the TXD pointer, the sine wave will play over and over again.
  // The TXD pointer can be updated after the EVENTS_TXPTRUPD arrives.
  while (1)
  {
    //__WFE();
  }
}

//IRQ handler

void I2S_IRQHandler(void)
{
  if (NRF_I2S-&amp;gt;EVENTS_TXPTRUPD == 1)
  {
      NRF_I2S-&amp;gt;EVENTS_TXPTRUPD = 0;
      NRF_I2S-&amp;gt;TASKS_STOP = 1;

  }
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S</title><link>https://devzone.nordicsemi.com/thread/352420?ContentTypeID=1</link><pubDate>Thu, 10 Feb 2022 16:29:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e007f4f-37df-4818-8ab5-814c66d0ac9c</guid><dc:creator>DPJONES</dc:creator><description>&lt;p&gt;Hi Jared&lt;/p&gt;
&lt;p&gt;Thanks for getting back to me, can you please show me how I can intercept and use the TXPTRUPD event in __WFE (Sleep Mode) as I cant seem to find any details on how to do this.&lt;/p&gt;
&lt;p&gt;Kind Regards&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2S</title><link>https://devzone.nordicsemi.com/thread/352334?ContentTypeID=1</link><pubDate>Thu, 10 Feb 2022 13:03:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad57e44c-2c5e-441f-a0e1-413cdb19cdba</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;&lt;span&gt;TXPTRUPD&amp;nbsp;event will be generated every time&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/i2s.html?cp=4_0_0_5_10_1#register.RXTXD.MAXCNT"&gt;RXTXD.MAXCNT&lt;/a&gt;&amp;nbsp;number of transmitted data words has been sent. You can stop transmitting when this event is generated. Alternatively, you can use &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/hardware_driver_i2s.html?cp=8_1_2_0_4"&gt;our driver&lt;/a&gt;&amp;nbsp;which makes it much more easier to setup and use the I2S peripheral.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Jared&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>