<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ubi de Feo on Medium]]></title>
        <description><![CDATA[Stories by Ubi de Feo on Medium]]></description>
        <link>https://medium.com/@ubidefeo?source=rss-ee5787d4cd7f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*hWDtQlqoW-ClYzgI.jpg</url>
            <title>Stories by Ubi de Feo on Medium</title>
            <link>https://medium.com/@ubidefeo?source=rss-ee5787d4cd7f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 10:05:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ubidefeo/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[FotogramMatrice]]></title>
            <link>https://medium.com/@ubidefeo/fotogrammatrice-7a549acf25e4?source=rss-ee5787d4cd7f------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a549acf25e4</guid>
            <category><![CDATA[pixel]]></category>
            <category><![CDATA[matrix]]></category>
            <category><![CDATA[animation]]></category>
            <category><![CDATA[led]]></category>
            <dc:creator><![CDATA[Ubi de Feo]]></dc:creator>
            <pubDate>Thu, 09 Feb 2017 13:19:59 GMT</pubDate>
            <atom:updated>2017-02-17T14:38:37.921Z</atom:updated>
            <content:encoded><![CDATA[<p>With FITC Amsterdam X getting closer, I’m working on some small LED matrix animations for my demo (some examples are visible on my <a href="https://www.instagram.com/ubidefeo/">Instagram feed</a>), which forced me to make some changes to my rudimentary pixel frames generator.<br>Because I had to spend a few hours on it to make it suit my current needs (mostly exporting C headers), I decided to give it a bit of a polish and throw it out in the open.</p><p><a href="http://ubidefeo.com/fotogrammatrice/">http://ubidefeo.com/fotogrammatrice/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e5PY2TX1vBAoACG1YPCJhg.png" /></figure><p>FotogramMatrice comes from “Fotogramma” (frame) and “Matrice” (matrix), but in Italian when you add the suffix “-trice” or “-tore” to some verbs, it often refers to a machine or a tool which performs the action. E.g: “Calcola-trice” is the machine which performs calculations.<br>It’s not hard to figure out hour it works, and I hope you’ll give it a go.<br>It comes with the NES colour palette as default :)</p><p>It’s in pre-alpha, so it’s got some issues, namely:</p><p>- tested only on Safari (I don’t care much for other browsers)<br>- no proper layout is defined<br>- CSS is very basic and nowhere close to being “thought”<br>- the “export” functionality, for now, only works as an alert generator for you to copy from (it’s all static HTML/JS)<br>- while the palette and preview are canvas objects, the grid is still based on DIV elements (yes, I wanted to see how far I could push it)<br>- it’s still got the jQuery over-head, but I’ll scrape it off when I have more time</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a549acf25e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Revealing your sources]]></title>
            <link>https://medium.com/@ubidefeo/revealing-your-sources-ac5aaa9b02d4?source=rss-ee5787d4cd7f------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac5aaa9b02d4</guid>
            <category><![CDATA[links]]></category>
            <dc:creator><![CDATA[Ubi de Feo]]></dc:creator>
            <pubDate>Sat, 05 Mar 2016 21:08:23 GMT</pubDate>
            <atom:updated>2016-03-06T07:56:32.444Z</atom:updated>
            <content:encoded><![CDATA[<p>For the past 13 years or so I have been an avid consumer of news feeds, and kept finding new ones thanks to sources which became trustworthy to me (<a href="http://kottke.org/"><strong><em>kottke</em></strong></a> is one great example). I currently have about 40 sources which I check almost on a daily basis thanks to my weird inner clock which wakes me up at 6am.<br>I decided to share the most meaningful of them with everyone who’s interested, so here they are with some notes where necessary.</p><h4>Apple Related</h4><ul><li><a href="http://www.patentlyapple.com/"><strong><em>Patently Apple</em></strong></a>:<strong> </strong>a great one if you want the latest on patents from several big names in the industry, not just Apple</li><li><a href="http://appleinsider.com/"><strong><em>Apple Insider</em></strong></a>: mostly rumours and info about products. I skip a lot of content from this one.</li><li><a href="http://macrumors.com/"><strong><em>MacRumors</em></strong></a>: same as the previous one</li></ul><h4>Personal Blogs and interesting links</h4><ul><li><a href="http://kottke.org/"><strong><em>Jason Kottke</em></strong></a>: definitely one of my favourite sources as I said above.</li><li><a href="http://nerdcore.de/"><strong><em>Nerdcore</em></strong></a>: many of the latest-barely-yet-seen things I learn about (video, games, music, books, discoveries) come from here. It’s a blog but there’s international content and I guarantee it’s always fresh.</li></ul><h4>Technology</h4><ul><li><a href="http://the.taoofmac.com/"><strong><em>Rui Carmo’s “the Tao of Mac”</em></strong></a>: Although Rui works now at Microsoft, he’s been an incredible resource of tips and how-to’s for plenty of tech geeks. His wiki is a great resource for oh-so-many topics. I have sometimes exchanged some messages with him, and he’s into so many things I am surprised he even takes the time to reply.</li><li><a href="http://www.brendangregg.com/blog/"><strong><em>Brendan Gregg</em></strong></a>: a ton of Linux and system related information. Performance analysis, system administration, scripting, automation, you-name-it.</li></ul><h4>Stuff for Makers</h4><ul><li><a href="http://makezine.com/blog"><strong><em>Make Blog</em></strong></a></li><li><a href="http://hackaday.com/"><strong><em>HackADay</em></strong></a></li><li><a href="http://arduino.cc/"><strong><em>Arduino</em></strong></a></li><li><a href="http://blog.spitzenpfeil.org/wordpress"><strong><em>PWM Again — my 2µF</em></strong></a></li></ul><h4>Design and Craft</h4><ul><li><a href="http://core77.com/"><strong><em>Core77</em></strong></a>: an incredible resource for all kinds of designs and crafters.</li><li><a href="http://mmminimal.com/"><strong><em>mmminimal</em></strong></a></li><li><a href="http://www.yatzer.com/"><strong><em>Yatzer</em></strong></a></li><li><a href="http://www.booooooom.com/"><strong><em>BOOOOOOOM</em></strong></a></li></ul><h4>Interaction Design / Digital Arts and more</h4><ul><li><a href="http://creativeapplications.net/"><strong><em>Creative Applications</em></strong></a>: this requires no introduction. Not a lot of posts, just what counts.</li></ul><h4>Lifestyle</h4><ul><li><a href="http://notcot.org/"><strong><em>NotCot</em></strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac5aaa9b02d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[No man is an island]]></title>
            <link>https://medium.com/@ubidefeo/no-man-is-an-island-4081193ddecb?source=rss-ee5787d4cd7f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4081193ddecb</guid>
            <category><![CDATA[life]]></category>
            <category><![CDATA[manifesto]]></category>
            <dc:creator><![CDATA[Ubi de Feo]]></dc:creator>
            <pubDate>Sat, 05 Mar 2016 19:00:37 GMT</pubDate>
            <atom:updated>2017-06-04T08:10:07.002Z</atom:updated>
            <content:encoded><![CDATA[<p>Is any of our creative expression really fruit of our labour?<br>Internet and social networks act as the global hive mind many sci-fi writers have been dreaming about, constantly connecting humans and subliminally tickling at least two of our senses. Given the amount of information we’re exposed to nowadays, can we really say that we “create” or “invent” anything by ourselves?</p><p>In Isaac Newton’s letter to Robert Hooke (1676) we read [sic]:</p><blockquote>“What Des-Cartes did was a good step. You have added much several ways, especially in taking the colours of thin plates into philosophical consideration. If I have seen further it is by standing on the sholders of Giants.”</blockquote><p>While some believe Newton’s words meant to be <a href="http://anthonydwilliams.com/2008/01/21/the-truth-about-isaac-newton/"><strong><em>sarcastic towards the rival</em></strong></a>, others noted that, at the time of writing, the two scientists were on good terms, which would indicate those were in fact words of reverence. <br>Set aside the conflicting views on this particular occurrence, it is worth noting that five centuries earlier John of Salisbury had written [sic]:</p><blockquote>Bernard of Chartres used to say that we [the Moderns] are like dwarves perched on the shoulders of giants [the Ancients], and thus we are able to see more and farther than the latter.</blockquote><p>making it the first documented appearance of the “dwarf on the shoulders of a giant” analogy. <br>We might dwell upon Newton giving credit to the ones who preceded him (possibly in a sarcastic fashion) and yet using words he did not forge himself, but this is not what this story is about. This is the story of how I got to “invent” without ever inventing anything.</p><p><strong><em>note</em></strong>: this article first appeared on my personal website under the section <strong>blog</strong>, but the site turned out to be yet another online resource I would never update for lack of time and will probably be just a rarely updated portfolio.</p><p>When I was a child, I remember often running to my mother screaming “Mom, look what I have invented!”, proudly showing something I had made.<br>She very gently replied that I had “figured out” a way to my achievement, but the invention or discovery was to be attributed to someone else. It was her subtle way of teaching me the right expressions (I started “inventing” when I was about 6), while explaining me that the first person figuring out something was the one who deserved credit. She always told me that one day, maybe, I’d be “inventing” something myself. Today I see this as a lesson in humility.</p><p>I remember that, at some point in the mid 80’s, I was having a really hard time figuring out how binary numbers worked. I wanted to learn to code <a href="http://en.wikipedia.org/wiki/Sprite_(computer_graphics)"><strong><em>sprites</em></strong></a> and other things that required binary-encoded data.</p><p>As you may guess, there was no Google to ask to and the average 40-something math teacher from the time could not really explain me how <strong>2</strong> would suddenly turn into <strong>10</strong>. Add insult to injury, I grew up in a small town in the south of Italy with very few friends in general, and even fewer interested in computers. Most of these just wanted to play video-games.</p><p>I won’t deny having a mild interest for the leisure features of the device and can recall spending many hours playing <a href="http://en.wikipedia.org/wiki/Platformer"><strong><em>platformers</em></strong></a>, but I was mostly drawn to the C64 accompanying user manual for the “vast” amount of knowledge it contained about the machine. I was 14.</p><p>My main source of “new” knowledge were paper magazines and their pages choke-full of programs listings to type in, hoping no power surge would defy my efforts. Some of these programs were completely useless to me. What was a 12 years old kid supposed to do with an inventory for household insurance policies?<br>If I close my eyes I can see the countless lines of <strong>DATA</strong> disguising commands for my computer behind a numeric, encoded list of numbers. It was tough to understand, but eventually I figured it out… scratching my head over the manual, translated to italian: the only language I knew.</p><p>It wasn’t easy to accept that <strong>POKE 53280,0</strong> turned the outer side of my screen black, at least not without knowing why. I wish I could have bounced my ideas and shared the limited knowledge of <em>programming</em> with someone else. I would have loved to get better at that stuff with the help of a fellow geek (I ignored the existence of the word at the time).</p><p>On the bright side, my best friend had a C64 himself and a few *accessories*. One of these was a cartridge that allowed pausing the microprocessor to inspect the content of the computer’s <a href="http://en.wikipedia.org/wiki/Random_Access_Memory"><strong><em>RAM</em></strong></a>.<br>This offered a peek into how those infamous sprites were constructed and allowed me to change their appearance, as well as inject _<a href="http://en.wikipedia.org/wiki/Cheat_code#Cheat_codes"><strong><em>Cheat Codes</em></strong></a> into the game. Of course I didn’t get the whole thing, but I swear: that knowledge I never really mastered came in handy a couple of decades later.</p><p>The other gadget I was able to put my hands on was a <strong>Modem</strong>. My friend had 2, and he lent me one so I could hook it to the landline my parents paid for. After a few tries we were able to dial each other’s number and communicate through our machines. That was *groundbreaking* in my mind: we could type onto each other’s screen and even execute programs. At night we would spend hours doing what many years later came to be known to us as “chatting”. Our mothers weren’t too happy about that, but they let us have fun, probably thinking we were better off in our rooms *nerding out* than out on the streets.</p><p>Upon fiddling with my C64’s motherboard to add some <em>”features”</em>, I caused a short-circuit and fried my machine. <br>I come from a lower-mid class family, and we could not afford to buy another <strong>personal computer</strong>: that was the end of my computer career, or so I thought.</p><p>I would eventually own an <a href="http://en.wikipedia.org/wiki/Amiga_600"><strong><em>Amiga 600</em></strong></a> which I never used to write code. At the time I was more interested in music and loved to play around with <a href="http://en.wikipedia.org/wiki/Protracker"><strong><em>ProTracker</em></strong></a>. I exchanged music with my friends and learned to mix House records. I rarely would be by myself, and my music interests broadened.</p><p>My father had just bought a Vespa that was gonna be <strong>all mine</strong>. With this one our fleet would count three, one of which was used for our delivery service (my sister and I had begun working for the family business in our early teens). I was relentlessly searching for an activity that would feed my young maker’s needs, so I got interested in 2-strokes engines. It was the only type I had access to. <br>I was confident my dad wouldn’t remember me taking apart (and breaking to no avail) the C64 and the TV. For the first month or two I used my vehicle to drive around and gain confidence on the road, as well as meeting other kids who had scooters or mopeds. Many of their vehicles were much faster than mine and *way more performing*. <br>What secrets were they hiding?</p><p>It turned out to be no <em>secret</em> at all: their engines were hacked. Bigger carburetors, exhaust pipes with specially designed chambers allowing a better flow of exhaust gasses, thus contributing to better fluid dynamics.<br>Wait… I was about 15… what could I possibly know about those things?</p><p>I set myself to learn how an engine worked, but this time I was not alone: so many kids were taking apart their scooters, exchanging carburetors, slicing exhaust pipes to see what was inside and sharing information with one another. Had I found the right place for me? I believe I did.</p><p>I took my engine apart (not without any casualties), learned to use tools, started grinding down and/or sawing off parts of the cylinder and/or the piston. I moved to learning more about carburetors, special inlet hacks and a slew of other stuff. A few of <em>us</em> often gathered to take apart someone’s engine and hack the hell out of it, often cluelessly, learning by failure.<br>We had to learn fast, as some parts of an engine were not exactly a like a piece of code you can fix and re-compile: once broken, they may never work again. The continuous flow of information led some of us to design and build their own exhaust pipes or inlet systems. These were the people I was inspired by.</p><p>I dropped out of university not before having met a handful of incredible people who loved to share knowledge about poetry, writing, graffiti, hip-hop, electronic music and “recreational activities”. During a year in the Navy, my next step after a failed attempt at University, I had the chance to become friend with an engineer who really knew his way around the <strong><em>Windows Terminal</em></strong>. We often voluntarily <strong><em>broke</em></strong> the officer’s computer by moving startup files around, so he would let us off duty to fix whatever there was wrong with that machine from hell. This was useful to keep my interest in computers alive during this year away from my hometown.</p><p>When I returned, I got a freelance job in a small design/pre-press studio.<br>My task was typing manuscripts into a computer. The wage was ridiculous, but I was there to learn.</p><p>I could have worked from home but I’d be in the studio every time I could, as it gave me the opportunity to work around people who knew Photoshop, Corel Draw, Quark Express and Pagemaker, this last one had just been acquired by Adobe from previous owner <strong><em>Aldus</em></strong>. I liked “Aldus Pagemaker” better, made it feel as if an old guy, said Aldus, would manually compose the layout before printing a page.<br>The studio owners knew how to process files, create assets for offset printing and much more. Most of all, they would share this knowledge with me and let me use their computers and software. I learned a lot from them, but at some point I felt I needed more, possibly different, input: creating on a computer could mean much more, and someone, somewhere, was doing what I wanted to learn, I just didn’t know what it was.</p><p>It wasn’t long before I left again, this time in search of fortune and more interests in Milan, almost one thousand kilometers (620 miles) away from what at the time was home.</p><p>With no prior knowledge of 3d I embarked in a real adventure and joined a master in 3d modeling and animation with <a href="http://en.wikipedia.org/wiki/Softimage"><strong><em>SoftImage</em></strong></a>, which at the time I believed was pronounced the same as “Soft Image”. I ended up in a class with a bunch of peculiar individuals, each one with a different background, sharing an interest in learning 3d character design and animation. The teachers weren’t less unordinary for a small town boy.</p><p>I remember a few months of great interactions and exchanges, which led to extending my skill-set as a computer dude and as a human. I soon drifted away from 3d and got stranded onto a fairly unknown shore: Web and CD-ROM production.</p><p>During my second job in the field I hit a wall: there seemed to be people who didn’t really want to share the knowledge I was craving. Suddenly, in the workplace, the atmosphere was different, competitive, secretive.</p><p>I resorted to using Internet more and more to exchange information and learn from hundreds of people who cared about documenting their efforts in these incredibly interesting new fields: online/offline interactive experiences, games design and programming, computer vision and much, much more. Most of my contacts were fellow curious humans living somewhere else in the world.</p><p>I wanted to know more about programming visuals, and was lucky to have a designer partner who had incredible ideas I could plug my code into. Together we created some beautiful work for ourselves and our clients, ending up winning international prizes and being invited to conferences. I ended up coding for work that was showcased all over the world, although most of the time not bearing my name. I believe at the time code and coders work wasn’t as appealing as the visual nature of interactive pieces.</p><p>I had met some great people in Milan, but I was happy to join my partner on a trip to Amsterdam to work on a campaign pitch for an international client, which the agency later won. This brought us to the north of Europe in just a few months, to start a life there, where we both still live and work 12 years later.</p><p>I spent a bit over two years working in advertising, but my creative persona lacked interaction with other technologists who could challenge me on other levels. I kept collaborating with other creative coders around the world, and felt like I was closer to them than ever: having left Italy was like being part of the rest of the world.</p><p>Over the past ten years I’ve been extending my knowledge to other fields I was curious about, and countless people have helped me to become interested in things I ignored before. I could not count how many small and big projects I’ve worked on, but I’d stake my life on saying that I couldn’t have done any of that work hadn’t I learned from someone else’s experience, and I wouldn’t be living here wasn’t it for someone else in my life.</p><p>In 2010 I joined forces with six friends to kick-start a creative collective here in Amsterdam and rented a space where we, and others, could pursue our interests: painting, sculpture, photography, woodwork, graphic and motion design, video, illustration, technology, music and whatnot. We started <a href="http://hellosavants.com/"><strong><em>”Hello, Savants!”</em></strong></a> to have a place where we could work on commercial projects as well as our own experiments. Sharing a space got me out of the shell, and since then I have dedicated most of my time to projects that allowed me to learn from others and with others. It has been the most rewarding experience of my life so far.</p><p>For all of the above, and many other reasons, I’ve always shared information about my work, no matter the level of complexity or general public interest. I have often looked for ways to teach others what I had learned, and donated thousands of my hours to making sure I could devise easy ways to teach myself first, and then others, all I could understand. I used to blog and write tutorials, and this very website is built for the purpose of having a home for my articles about everything I am curious about, in the hope of helping others save some time and effort.</p><p>I am a big supporter of Open Source and sometimes I work on projects I cannot disclose, but the most fun I have is when I play with things I’ll later be able to share, in the same spirit that allowed me to become the hacker/maker/designer/technologist I am today.</p><p>I believe that, nowadays, discovering something “by oneself” means being found in a water pit at the bottom of a canyon having survived two decades feeding on roots and rats while developing a groundbreaking theory in quantum mechanics and carefully carving it in stone… probably in the hope that someone will find it.</p><p>Today nobody begins working on anything without researching papers or using Google, Bing, Wolfram and the likes. We are *the Moderns* who can see farther and clearer, as we’re not burdened by having to re-discover what we inherited from *the Ancients*. We have the luxury of fast access to a plethora of information created by others and published in the open. We are nodes of this creative, collective hive mind.</p><p>Always thank the people who help you achieve your goals and credit the ones you learn from. Render your deeds and share your results (unless you’re tied to an NDA, of course).</p><h4>Credits</h4><p>I deliberately did not use names in this story, as I thought it would have been distracting for the reader, so here’s a list of people who were, and/or still are, involved.</p><p>As you may assume, I owe a lot to my family, but there’s a long list of people who contributed to who/what I am today: <br>Claudio Pisciottano, the mechanics, my friends at University of Salerno, Alessandro Morinelli, the late Pasquale Volpe, Giancarlo Leccese, the Softimage Master people (so many), Michela Slomp, Niko Stumpo, Quam &gt; Nurun Italia when I worked there, Charles Forman, Jason Gessner, Simone Legno, Giuseppe Masi, Riccardo Fabbri, Maria Aiello and the Nohup team, Diego Vurro, Ralph Hauwert, Salvatore Iodice, my friends at “Hello, Savants!”, the guys from Mediamatic, Massimo Banzi, Gianluca Martino, the Arduino Community, the openFrameworks Community, Dirk Spandermaan, Rui Carmo, Dani Montesinos, Alice Mela, Dirk Van Oosterbosch, Axel Roest, Antti Kupila, every student I had at my workshops, everyone who gave me feedback on my tutorials, everyone who develops software and hardware and shares it with the world.</p><p>I hope this list will never find an end, like my desire to learn new things.</p><p>This article would have never been possible without the precious feedback of Angelica and Charles, who made sure I would be writing something better than my first draft.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4081193ddecb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Arduino + cheap i2c LCD Backpack]]></title>
            <link>https://medium.com/@ubidefeo/arduino-cheap-i2c-wire-lcd-backpack-4335927e6887?source=rss-ee5787d4cd7f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4335927e6887</guid>
            <category><![CDATA[i2c]]></category>
            <category><![CDATA[arduino]]></category>
            <category><![CDATA[lcd]]></category>
            <dc:creator><![CDATA[Ubi de Feo]]></dc:creator>
            <pubDate>Wed, 06 Jan 2016 17:12:40 GMT</pubDate>
            <atom:updated>2016-01-08T14:07:53.745Z</atom:updated>
            <content:encoded><![CDATA[<p>So you bought one (or more) of these i2c LCD backpacks and, despite having gone through several code examples downloaded here and there, you still can’t get it to work: glitchy backlight, meaningless random characters or… just the void.<br>Your brain is telling you “You got a gift from China with fake ICs” but you still want to believe there’s good in people, so you spend a little more time searching the web for someone who has your <em>exact same problem</em> and you end up here. How lucky!<br>Read along, as I tell you what I found out about these very useful little boards and got mine to work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mCQ4Y4zmTUG97i4s8MSkQw.jpeg" /></figure><p>While on a shopping spree on EBay I ended up purchasing a couple of i2c backpacks for HD44780 based LCDs. These controller boards are based on the <a href="http://www.nxp.com/documents/data_sheet/PCF8574_PCF8574A.pdf">PCF8574* by NXP</a>. It took me a bit to figure out why I couldn’t make them work. Hopefully this post will save someone’s time (not really sure, though, as I can be quite prolix), and teach something to some struggling beginner.</p><h4>The Metal Side Of Life</h4><p>Liquid Crystal Displays, from here on LCD(s), are a really useful and interesting thing to have in your lab, but out of the box you need a lot of pins (at least 6 if you only write to the display) to make them work as well as some other components and wiring on the side. In the next photo you can see one I hooked up in 4 bit mode using 2 pins for Register Control and 4 to latch data in using the <em>LiquidCrystal</em> library from Arduino.<br>That seems like a lot of pins, so I decided to finally solder one of <a href="http://tronixlabs.com/display/lcd/serial-i2c-backpack-for-hd44780-compatible-lcd-modules-australia/"><strong>these backpacks</strong></a><strong> </strong>to control the display over the i2c port.<br>Using just two pins for i2c (rather than the 6/10 needed for the 4/8 bit Parallel Interface and Register Control in Write-Only configuration) can save you a lot of jumper wires as well as time, allowing you to use your precious Arduino pins for other purposes. Basically the way this works is by <em>outsourcing</em> the logic behaviour of those pins to an external component. The sequence of logic levels (HIGH/LOW) is pushed to the PCF8574* over its i2c interface. This way you don’t <strong>digitalWrite()/digitalRead()</strong> on your Arduino but ask another device to do it instead, using a communication protocol to control such device. But let’s not get lost in things I’ll probably cover some other time… this is not the place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uWYNZE7NyAGJvf4Rb4Vpjw.jpeg" /><figcaption>Broadly used 4bit parallel interface mode for HD44780 based LCD. This example shows a Write-Only configuration, hence you only see 8 wires (including power).</figcaption></figure><p>I sometimes run out of available IO on my prototypes, hence using a Serial Interface such as i2c is sort of a life-saver, especially because often my SPI port is busy doing else and would anyway require 4 pins. If you don’t need to transfer data at high rates (SPI is good for that), you can use a serial display to show debug information while you’re working on some UART Serial Communication Protocols and can’t just <strong>Serial.write()</strong> your debug info to a console. I know I could use Arduino boards with two UART interfaces but I really like the ATMega328 and 32U4, and in my specific case the Serial Protocol can be quite time critical at high speeds (more on this in the future).</p><p>Once I got one of these hooked up I immediately turned to the web to know how to control it, and there seems to be a lot of information but it’s a bit scattered around, so I gathered some resources, figured out a few kinks which made me waste a bit of time, and decided it would be a good idea to post this somewhere for future reference and to help a few fellow makers.<br>Setting it up is quite straight forward once you figure out how this backpack interfaces with the data and control pins of the HD44780.</p><p>The <a href="http://www.nxp.com/documents/data_sheet/PCF8574_PCF8574A.pdf"><strong><em>PCF8574*</em></strong></a> <em>Remote 8-bit I/O expander for I2C-bus with interrupt</em><strong> </strong>is used to control the HD44780 using only the highest 4 bits of its data bus (D4, D5, D6, D7), and uses the other 4 IO pins for EN, RS, R/W as well as controlling the status of the backlight LED (which can be hardware disabled on some backpacks via means of a jumper).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lpbJ1FAj-vMZUdBzN2Wr4A.png" /></figure><p>Without digging too much into how the HD44780 works (there’s plenty of documentation if you look that up), I’ll try and go through how I set it up and got it to work. Let it suffice to know that this is what the blocks of pins illustrated above are used for:</p><pre>Power: Main logic power (+5v) and <br>Contrast: Usually connected to a potentiometer voltage divider<br>Register Control: Set HIGH/LOW depending on desired function<br>Not Used [D0-D4]: Low byte section for 8 bit data mode only<br>Data Control: High byte section for 4 bit data mode (also used in 8 bit mode)<br>LED Power: Backlight voltage (+5V)</pre><p>In a parallel setup the <em>LiquidCrystal</em> library would take care of flipping these pins HIGH or LOW to shift data into the controller. This task is taken over by the PCF8574* chip, which will transform the data pushed over i2c by a <strong>modified</strong> <em>LiquidCrystal</em> library into a parallel array of logic levels (bits) and latch the data in. This setup, using only 4 bits, is a few <em>microseconds </em>(µS) slower than using the 8 bit mode… do you really care?</p><blockquote>Always test breakout boards and expansion modules on a breadboard BEFORE you solder them somewhere. Believe me, it’s worth your time.</blockquote><p>Another interesting thing about these IO expanders is that they come in two flavours, hence the notation PCF8574*. This chip comes into two main versions (regardless of the package): PCF8574 and PCF8574A. The A version differs only in matter of possible i2c address range, exposing a default address of 39 (27 hex) for the former and 63 (3F hex) for the latter. As noted in the example code following, you can use the i2c_scanner utility sketch to find out which one is yours, but if you see an “A” on the chip markings you’ll know that your base address is 63 (3F hex).<br>While this may seem like an annoyance, if you think for a second you realise that you can have both chips on the same i2c bus and talk to them without conflicts. Even better, part of the i2c address is configurable with 3 pins, which gives you the opportunity to have 4 of each on the same bus, with 8 different addresses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WcfTwhr5S0IvlyYUEFIjhw.jpeg" /></figure><p>Do the math and you’ll quickly realise that you have (2 chips) * (4 addresses) * (8 IO ports) = 64 extra Input/Output pins that you can read and write from a single Arduino board, all just learning how to use i2c. In our specific case, this gives you the chance to have 8 of these displays connected to your board. Make sure you power them externally and not through the Arduino 5V pin.<br>I’ll write something about port expanders at some point, but now let’s move on to…</p><h4>The Code Side Of Things</h4><p>First thing first: you won’t be able to make this work using the standard Arduino <strong>LiquidCrystal.h</strong> library but will have to use the extended one by <a href="https://bitbucket.org/fmalpartida/">Francisco Malpartida</a> which can be found here <a href="https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home#!downloading-and-installation"><strong><em>https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home#!downloading-and-installation</em></strong></a>. Once downloaded place the extracted folder in your <em>libraries</em> folder.</p><p>This library adds a few more classes including <strong>LiquidCrystal_I2C</strong> (which we will use) and other variants (ByVac and backpacks/displays with shift registers as controllers) with some interesting overloaded constructors. There is an example (<strong>HelloWorld_i2c.pde</strong>) which may not work out of the box for a couple of reasons:</p><ul><li>wrong i2c address</li><li>confusing BACKLIGHT_PIN usage</li></ul><p>The <strong>.pde </strong>extension will probably tell you that this example is old and hasn’t been checked in a while).</p><p>Let’s move on to understand something about these backpacks. I have not traced the schematics because it’s quite intuitive how the PCF8574* is used here.</p><p>With its 8 IO pins (“<em>quasi-bidirectional ports</em>” is how they are defined in the datasheet) it can control (read/write) 8 logic levels, and since the HD44780 requires at least 4 data pins for its 4 bit operation mode and 3 control pins for registers operations, it’s quite logical that 7 of these IO pins are used for data and control, and the one left out controls a MOSFET to activate the backlight (there is an SMD MOSFET on the PCB close to the LED jumper). This allows you to turn the backlight on and off with a single command</p><pre><strong><em>setBacklight( uint8_t value )</em></strong></pre><p>Any non-zero value will turn it on.</p><p>The library example <em>HelloWorld_i2c.pde </em>did not work with the backpack because of a different way to control the backlight using Arduino pin 13. I deduce this was coded to work with a bare chip, connecting the backlight to an Arduino physical pin via a MOSFET and controlling it with <strong>digitalWrite()</strong>.<br>One thing that pushed me to investigate this further was the <em>overloaded constructor </em>(don’t get scared if you don’t know what that is) I found in the library source code. When you can’t find an answer online, checking out the code can yield great results, although, as a beginner, you may not really enjoy reading C++:</p><pre>lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin,Bl_pin, POSITIVE);</pre><p>Here’s my take on how to use the <strong><em>LiquidCrystal_I2C</em></strong> library and what the configuration options stand for. We’ll use the above mentioned <em>overloaded constructor</em> to initialise the object passing every single pin of the controller and assigning it a functionality. <br>Since Medium sucks at displaying code, I created a gist. Some comments are key to understanding some of the inner workings.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5a9ba2f2c1077cbdbe536156087821a5/href">https://medium.com/media/5a9ba2f2c1077cbdbe536156087821a5/href</a></iframe><p>That’s about it. I hope you learned something new reading through my ramblings. Questions are welcome in the comments section.<br>See you next time :)</p><h4>References</h4><p>Hitachi HD44780 LCD Controller: <a href="https://en.wikipedia.org/wiki/Hitachi_HD44780_LCD_controller">https://en.wikipedia.org/wiki/Hitachi_HD44780_LCD_controller</a></p><p>Tronixlab’s tutorial PCF8574* backpacks: <a href="http://www.instructables.com/id/Using-PCF8574-backpacks-with-LCD-modules-and-Ardui/">http://www.instructables.com/id/Using-PCF8574-backpacks-with-LCD-modules-and-Ardui/</a></p><p>Arduino.cc’s great list of LCD resources: <a href="http://playground.arduino.cc/Code/LCD">http://playground.arduino.cc/Code/LCD</a></p><p>PCF8574 LCD backpacks (mostly knock-offs) on EBay: <a href="http://www.ebay.com/sch/i.html?_from=R40&amp;_trksid=p2050601.m570.l1313.TR6.TRC2.A0.H1.Xpcf8574+LCD+backpack.TRS0&amp;_nkw=pcf8574+LCD+backpack&amp;_sacat=0">http://www.ebay.com/sch/i.html?_from=R40&amp;_trksid=p2050601.m570.l1313.TR6.TRC2.A0.H1.Xpcf8574+LCD+backpack.TRS0&amp;_nkw=pcf8574+LCD+backpack&amp;_sacat=0</a></p><h4>Downloads</h4><p>Francisco Malpartida’s <em>New LiquidCrystal </em>libary: <a href="https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home">https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home</a></p><h4>Bonus</h4><p>These boards are labeled as LCD backpack, but remember that they’re a sort of breakout board for a PCF8574*, which means you can use them as an 8 port expander with your microcontroller by just writing and reading from it.<br>The datasheet will tell you everything you need to know, but I’ll probably write another post on using these for other purposes than driving LCDs :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4335927e6887" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>