<?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>PCF8574A IO Expander with nRF52-DK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13890/pcf8574a-io-expander-with-nrf52-dk</link><description>Hi, 
 I&amp;#39;m trying to use PCF8574A IO Expander with a nRF52-DK board to display characters on an HD44780 LCD. I noticed that I have to use the function nrf_drv_twi_tx() . Since PCF8574A doesn&amp;#39;t have a register address, how do I send commands and text to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 19 May 2016 18:14:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13890/pcf8574a-io-expander-with-nrf52-dk" /><item><title>RE: PCF8574A IO Expander with nRF52-DK</title><link>https://devzone.nordicsemi.com/thread/53079?ContentTypeID=1</link><pubDate>Thu, 19 May 2016 18:14:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d030fca-766a-4740-9565-73613b47d8d5</guid><dc:creator>Mark</dc:creator><description>&lt;p&gt;I couldn&amp;#39;t get my code to work. It compiles and loaded on the board, but doesn&amp;#39;t do anything.&lt;/p&gt;
&lt;p&gt;First thing I wanted to double check, can I power both the PCF8574A IO Expander and HD44780 LCD through VSHLD(3.3V) pin of the nRF52-DK board? If I have to run HD44780 LCD from a 5V supply, then can I use something like BSS138 MOSFETs to level shift my I2C line from 3.3V to 5V?&lt;/p&gt;
&lt;p&gt;Also, do I need to use 10K pull up resistors on the I2C line?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PCF8574A IO Expander with nRF52-DK</title><link>https://devzone.nordicsemi.com/thread/53078?ContentTypeID=1</link><pubDate>Wed, 18 May 2016 18:01:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3085372-b07f-4f7f-b3b7-2c68665a90c8</guid><dc:creator>Mark</dc:creator><description>&lt;p&gt;Yeah, I&amp;#39;ve never worked with ARM core processors before nor Nordic SDKs; so, I&amp;#39;m trying to get my code working in blocking mode first, and if successful, then I&amp;#39;ll try to use twi_handler later. I&amp;#39;ll most likely have more questions about how to use a handler later.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PCF8574A IO Expander with nRF52-DK</title><link>https://devzone.nordicsemi.com/thread/53077?ContentTypeID=1</link><pubDate>Wed, 18 May 2016 03:16:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47671853-6830-4191-a8a5-2c0fa2d3c1ff</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;oh one more comment - don&amp;#39;t send the data on the stack like that- if you&amp;#39;re using blocking mode you&amp;#39;ll probably get away with it, but using a static buffer is a much better idea.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PCF8574A IO Expander with nRF52-DK</title><link>https://devzone.nordicsemi.com/thread/53076?ContentTypeID=1</link><pubDate>Wed, 18 May 2016 00:16:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c56d0843-decf-45e0-845c-b4d58b6bfbbf</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Yep - boringly simple isn&amp;#39;t it, especially when you have only 1 byte of data to send and receive.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PCF8574A IO Expander with nRF52-DK</title><link>https://devzone.nordicsemi.com/thread/53075?ContentTypeID=1</link><pubDate>Tue, 17 May 2016 18:32:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:482fb787-6272-4203-8347-d4a4169a1282</guid><dc:creator>Mark</dc:creator><description>&lt;p&gt;Oh, ok, thanks RK. The reason I want to use an IO Expander is that I will be using the nRF52-DK in a big project and multiple I2C devices, so I want to make it neat.&lt;/p&gt;
&lt;p&gt;I know my device address is 0x38, but as Alex pointed out I thought register address is a necessary parameter to use in order to use TWI function.&lt;/p&gt;
&lt;p&gt;Now, when I looked up nrf_drv_twi_tx() function, the parameter that you send data is declared as &amp;quot;uint8_t const *&amp;quot;. So can I use the TWI function in the following way?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static ret_code_t expanderWrite(uint8_t buffer)
{

return nrf_drv_twi_tx(&amp;amp;m_twi_hd44780, hd44780_ADDR, &amp;amp;buffer, sizeof(buffer), false);

}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;passing data as reference &amp;amp;buffer?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PCF8574A IO Expander with nRF52-DK</title><link>https://devzone.nordicsemi.com/thread/53074?ContentTypeID=1</link><pubDate>Tue, 17 May 2016 10:46:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1ec1543-6fdf-435d-be7e-59e3f94af977</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;That i forgot. Yes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PCF8574A IO Expander with nRF52-DK</title><link>https://devzone.nordicsemi.com/thread/53073?ContentTypeID=1</link><pubDate>Tue, 17 May 2016 10:18:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b5826d9-6ab1-4b4b-b66b-be10416fe11c</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;well that&amp;#39;s not how that function works, it takes the I2C peripheral address plus a buffer of data and a length, that&amp;#39;s it, and it writes the data to the device at that address. There is no concept in that function of a register address on the other side, it&amp;#39;s just raw data.&lt;/p&gt;
&lt;p&gt;so nrf_drv_twi_tx() will work just as it is without rewriting it, and if you actually did set data length to zero then it wouldn&amp;#39;t do anything because it wouldn&amp;#39;t write any data. He wants data == the 8 bits of data he wants to send out and data length == 1&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PCF8574A IO Expander with nRF52-DK</title><link>https://devzone.nordicsemi.com/thread/53072?ContentTypeID=1</link><pubDate>Tue, 17 May 2016 10:13:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa787b69-9317-44ad-a00d-c0d7950a7739</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;Mark talking about address of the register inside of the expander. PCF8574 doesn&amp;#39;t have it but standard I2C function designed to work with memory type of device where you have to send internal address then data. This is how I understood.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PCF8574A IO Expander with nRF52-DK</title><link>https://devzone.nordicsemi.com/thread/53071?ContentTypeID=1</link><pubDate>Tue, 17 May 2016 10:07:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62937fec-a76d-4da6-ae74-cddea639e37f</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;The PCF8574A has an address, it has to have an address, it&amp;#39;s an I2C device, I2C requires things to have an address. The address is whatever you set up on the A0-A2 pins.&lt;/p&gt;
&lt;p&gt;So you give the command the address of the expander and write a byte of data.&lt;/p&gt;
&lt;p&gt;I do have to ask however, since you have an nRF52 development kit which has masses of output lines just begging to be used, why do you need a port expander? Port expanders are for arduinos which come with about 1 1/2 pins available.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PCF8574A IO Expander with nRF52-DK</title><link>https://devzone.nordicsemi.com/thread/53070?ContentTypeID=1</link><pubDate>Tue, 17 May 2016 08:35:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6a508c8-40ac-454f-84d3-51e419cdacdb</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;Either change nrf_drv_twi_tx() or use address as data and length as zero when writing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>