<?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>how to toggle spim1 and twim1</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15914/how-to-toggle-spim1-and-twim1</link><description>I want to use nrf52832 to communicate with my sensors , but my three sensors should use spis to communicate, the others use TWI ,so in sampling , I need to switch between spi and twi, in the file nrf_drv_config.h when i use spi ,I should #define SPI0_ENABLED</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 24 Aug 2016 09:39:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15914/how-to-toggle-spim1-and-twim1" /><item><title>RE: how to toggle spim1 and twim1</title><link>https://devzone.nordicsemi.com/thread/60722?ContentTypeID=1</link><pubDate>Wed, 24 Aug 2016 09:39:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96bc357e-281a-4cea-98f6-eec85889fd0c</guid><dc:creator>talha</dc:creator><description>&lt;p&gt;First of all, you cannot toggle the #define EXAMPLE commands because they are not commands for your program file, they are commands for the compiler. When the compiler is compiling your C code and turning it into a .hex file, it does not include those statements. So there is no way to toggle them while the program is running.&lt;/p&gt;
&lt;p&gt;If the peripherals have the same address I don&amp;#39;t think you can use them. I am not really familiar with SPI but in TWI (i2c) you are not supposed to use two devices with the same 7-bit device_address at least that is what I am told. If you are using multiple EEPROMs for instance, they have additional address bits just for you to configure and differentiate its 7-bit address from other same type EEPROMs.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know if this was helpful at all. Maybe if you can explain which peripherals you are using I can help more.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to toggle spim1 and twim1</title><link>https://devzone.nordicsemi.com/thread/60721?ContentTypeID=1</link><pubDate>Wed, 24 Aug 2016 07:17:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db846b23-9def-4b5b-98ed-767267481115</guid><dc:creator>Zou</dc:creator><description>&lt;p&gt;the ID is the same ,so the peripherals base address is the same. in the datasheet 8.4 has a table to introduction .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to toggle spim1 and twim1</title><link>https://devzone.nordicsemi.com/thread/60719?ContentTypeID=1</link><pubDate>Wed, 24 Aug 2016 06:59:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bda404be-76e3-415e-9983-2c02c8b1f139</guid><dc:creator>talha</dc:creator><description>&lt;p&gt;you mean their 7-bit id is the same?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to toggle spim1 and twim1</title><link>https://devzone.nordicsemi.com/thread/60720?ContentTypeID=1</link><pubDate>Wed, 24 Aug 2016 05:08:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7cb32e1b-fa36-4e4f-a803-4d951b3228eb</guid><dc:creator>Zou</dc:creator><description>&lt;p&gt;maybe i have not expressed clearly.In my project , I have to use three spi in master mode and three twi in master mode to communicate with my sensors, but when i use them at the same time , the NRF52832 is not support ,because some of them are shared the same ID. i don&amp;#39;t know how to allocate the shared ID resources.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to toggle spim1 and twim1</title><link>https://devzone.nordicsemi.com/thread/60718?ContentTypeID=1</link><pubDate>Tue, 23 Aug 2016 09:21:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e69ff74-0c24-4e93-ba06-aaa4ddf45f52</guid><dc:creator>talha</dc:creator><description>&lt;p&gt;I think what you need to do is to use TWI0 along with SPI1 or TWI1 along with SPI0. Would this solve your issue?&lt;/p&gt;
&lt;p&gt;As I know you cannot use TWI1 with SPI1 but you can use TWI0 with SPI1.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>