<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>[protofusion] &#187; osram</title> <atom:link href="http://protofusion.org/wordpress/tag/osram/feed/" rel="self" type="application/rss+xml" /><link>http://protofusion.org/wordpress</link> <description>Generally Interesting</description> <lastBuildDate>Sat, 19 May 2012 17:48:20 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>The OSRAM SLG2016 and AVR</title><link>http://protofusion.org/wordpress/2010/10/the-osram-slg2016-and-avr/</link> <comments>http://protofusion.org/wordpress/2010/10/the-osram-slg2016-and-avr/#comments</comments> <pubDate>Sun, 17 Oct 2010 21:33:39 +0000</pubDate> <dc:creator>Ethan Zonca</dc:creator> <category><![CDATA[AVR]]></category> <category><![CDATA[attiny88]]></category> <category><![CDATA[osram]]></category> <category><![CDATA[slg 2016]]></category> <category><![CDATA[slg2016]]></category> <category><![CDATA[tiny88]]></category><guid
isPermaLink="false">http://protofusion.org/wordpress/?p=531</guid> <description><![CDATA[I happened to scavenge a couple of SLG2016&#8242;s from some old workstation debug displays. After finally locating a datasheet, I ]]></description> <content:encoded><![CDATA[<p><a
href="http://pf-wordpress.s3.amazonaws.com/wordpress/wp-content/uploads/2010/07/slg2016-macro.jpg" rel="lightbox[531]"><img
class="alignnone size-large wp-image-545" title="SLG2016 LED Display" src="http://pf-wordpress.s3.amazonaws.com/wordpress/wp-content/uploads/2010/07/slg2016-macro-500x375.jpg" alt="" width="500" height="375" /></a></p><p>I happened to scavenge a couple of SLG2016&#8242;s from some old workstation debug displays. After finally locating a datasheet, I realized that they used the standard ASCII charset, so they are extremely easy to drive. <em>Note: The SLG2016 differs from the SLR2016, SLO2016, and SLY2016 only by LED color.</em></p><p><em><span
id="more-531"></span></em></p><p><a
href="http://pf-wordpress.s3.amazonaws.com/wordpress/wp-content/uploads/2010/07/attiny88-macro.jpg" rel="lightbox[531]"><img
class="alignnone size-large wp-image-542" title="ATTINY88 on solderless breadboard" src="http://pf-wordpress.s3.amazonaws.com/wordpress/wp-content/uploads/2010/07/attiny88-macro-500x375.jpg" alt="" width="500" height="375" /></a></p><p>The only downside to these displays is that they use quite a few pins (7 data lines, 2 digit select lines, write line, and optional blanking line). For now, I&#8217;m driving the display with all pins in parallel on a tiny88 which has plenty of pins; however I plan on using a shift register to cut down on data bus pin usage in the future. The displays only need the data lines to be held stable during a write cycle, making shift registers well-suited to this task.</p><p><a
href="http://pf-wordpress.s3.amazonaws.com/wordpress/wp-content/uploads/2010/07/buspirate-macro.jpg" rel="lightbox[531]"><img
class="size-large wp-image-544 alignnone" title="The Bus Pirate with probe cable attached" src="http://pf-wordpress.s3.amazonaws.com/wordpress/wp-content/uploads/2010/07/buspirate-macro-500x375.jpg" alt="" width="500" height="375" /></a></p><p>To flash the attiny88, I&#8217;m using a <a
href="http://dangerousprototypes.com/category/bus-pirate/" target="_blank">Bus Pirate</a> (pictured above) flashed with the STK500v2 emulation firmware. This allows me to use avr-gcc with AVR Studio to program the chip.</p><p>Here is some code I used to test the displays, using PORTD for data lines, and the 2 LSB&#8217;s of PORTC for digit select lines. This is the first time I&#8217;ve worked with AVRs outside of the Arduino environment, so pardon any flagrant errors and drop me a comment if you have any suggestions.</p><pre class="brush: cpp; title: ; notranslate">
#define F_CPU 1000000UL

#include &lt;avr/io.h&gt;
#include &lt;util/delay.h&gt;
#include &lt;string.h&gt;
#include &lt;stdlib.h&gt;

void wr();
void wrChar(char toWrite, int dig);
void wrWord(char *word);
void scrollWord(char *word);
void delay_ms(uint16_t ms);

int main (void){
  DDRC=0xFF;
  DDRD=0xFF;
  PORTD=0x00;
  PORTC=0x00;

  // Loop through a few strings for testing
  while(1){
    wrWord(&quot;Helo&quot;);
    delay_ms(500);
    wrWord(&quot;*?%$&quot;);
    delay_ms(500);
  }
}

// Toggle write pin (PC0)
void wr() {
  PORTD &amp;= ~(1&lt;&lt;7);
  delay_ms(1);
  PORTD |= (1&lt;&lt;7);
}

// Write char to position
void wrChar(char toWrite, int pos){
  PORTC = pos;  // Set digit select lines
  PORTD = toWrite;  // Set data lines
  wr();  // Toggle write pin
}

// Write 4-char word
void wrWord(char *word){
  for(int i=3; i&gt;=0; i--){
    wrChar(word[i], 3-i);
  }
}

// Generic delay function
void delay_ms(uint16_t ms) {
  while (ms) {
    _delay_ms(1);
    ms--;
  }
}
</pre>]]></content:encoded> <wfw:commentRss>http://protofusion.org/wordpress/2010/10/the-osram-slg2016-and-avr/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Object Caching 336/339 objects using disk: basic
Content Delivery Network via Amazon Web Services: S3: pf-wordpress.s3.amazonaws.com

Served from: protofusion.org @ 2012-05-22 09:10:45 -->
