<?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>Invert UART</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/7038/invert-uart</link><description>Hello! 
 In my application, I have to receive UART signals from another device. The problem is the signal comes inverted so the nrf51422 can&amp;#39;t handle it. I thought in 2 possibilities: Using external hardware to invert signal (transistor) or do it in</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 13 May 2015 18:59:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/7038/invert-uart" /><item><title>RE: Invert UART</title><link>https://devzone.nordicsemi.com/thread/24853?ContentTypeID=1</link><pubDate>Wed, 13 May 2015 18:59:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86acbb59-f5c2-45b4-b611-1ea9475aea4d</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;you cannot connect two pins via software if the pin direction is input. But if this is output then it can be done.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Invert UART</title><link>https://devzone.nordicsemi.com/thread/24854?ContentTypeID=1</link><pubDate>Wed, 13 May 2015 15:43:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52eaed01-0694-4d9a-8d9a-b39dc96176ce</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;your hardware inverter would be easy fix, you can do this in the software but i think it will be lot of overhead and use of lot of modules like PPI, GPIOTE and extra GPIOs to workaround this.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Connect pin with uart sensor data as input to GPIOTE channel 0, configure
gpiote channel 0 as event mode and generate an event for every pin
toggle.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;connect the event (coming out of gpiote channel 0) to PPI to convert that into a task (lets say T1)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;configure gpiote channel 1 in task mode with T1 as input, toggle  another gpio pin P2(with inital state  configured to be opposite of inital  state of pin with uart data)&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;now you should have inverted data on pin P2, but you cannot use this as input to UART module as this is configured to be output, so you have to connect this pin with another gpio pin and use the latter as input to uart.&lt;/p&gt;
&lt;p&gt;I myself feel this very ugly just to invert the signal. transistor would be just fine for this.&lt;/p&gt;
&lt;p&gt;I thought of using GPIO interrupt handler to do this but then, it would change the timing of the signal.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>