<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: LED Clock: Serial Communication, MAX232, and Programming the LogoChip UART</title>
	<atom:link href="http://www.neufeld.newton.ks.us/electronics/?feed=rss2&#038;p=109" rel="self" type="application/rss+xml" />
	<link>http://www.neufeld.newton.ks.us/electronics/?p=109</link>
	<description></description>
	<lastBuildDate>Sun, 08 Dec 2024 17:19:24 -0600</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
	<item>
		<title>By: russ_hensel</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=109&#038;cpage=1#comment-21429</link>
		<dc:creator>russ_hensel</dc:creator>
		<pubDate>Sat, 09 Feb 2008 16:19:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=109#comment-21429</guid>
		<description>As an option to the RS232 chip put the translation in the cable, use the cable over and over, smaller board, total translation chips 1.  Make has the most inexpensive version, almost as cheap as the parts: http://store.makezine.com/ProductDetails.asp?ProductCode=BBBP4  or for usb translation: http://store.makezine.com/ProductDetails.asp?ProductCode=TTL232R 

I first saw the idea at: http://www.piclist.com/techref/io/serial/RCL1.htm 


russ_hensel</description>
		<content:encoded><![CDATA[<p>As an option to the RS232 chip put the translation in the cable, use the cable over and over, smaller board, total translation chips 1.  Make has the most inexpensive version, almost as cheap as the parts: <a href="http://store.makezine.com/ProductDetails.asp?ProductCode=BBBP4" rel="nofollow">http://store.makezine.com/ProductDetails.asp?ProductCode=BBBP4</a>  or for usb translation: <a href="http://store.makezine.com/ProductDetails.asp?ProductCode=TTL232R" rel="nofollow">http://store.makezine.com/ProductDetails.asp?ProductCode=TTL232R</a> </p>
<p>I first saw the idea at: <a href="http://www.piclist.com/techref/io/serial/RCL1.htm" rel="nofollow">http://www.piclist.com/techref/io/serial/RCL1.htm</a> </p>
<p>russ_hensel</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tobie</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=109&#038;cpage=1#comment-20743</link>
		<dc:creator>Tobie</dc:creator>
		<pubDate>Thu, 06 Sep 2007 08:52:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=109#comment-20743</guid>
		<description>Hi Keith, I&#039;m building a domestic sensor network, and it&#039;s a bit mysterious to the user what each node is doing! The aim of the interface is to show live sensor data (using the bar graph as output of an analogue sensor) and the incrementation of &#039;events&#039; which are triggered when the sensor tips a certain threshold - the 7 segment LEDs acts as a counter for the events.

These displays are piggy-backing on motes, connecting through a DF9 socket (http://www.hirose.co.jp/cataloge_hp/e54000041.pdf) on the mote. The board I&#039;m building is like a parasite which looks at the motes sensors, hopefully without disturbing the mote&#039;s function which has off-the shelf firmware. Each node is runing off a power supply so I don&#039;t have to worry about all that stuff!

Here&#039;s a link to the project: http://www.goldsmiths.ac.uk/interaction/health.html

I&#039;m a designer rather than an engineer, but I get there in the end, but not without kind help along the way!

I&#039;m going to insert some assembler code for the interval, I recall now a snippit on the pic basic forum which did something similar.</description>
		<content:encoded><![CDATA[<p>Hi Keith, I&#8217;m building a domestic sensor network, and it&#8217;s a bit mysterious to the user what each node is doing! The aim of the interface is to show live sensor data (using the bar graph as output of an analogue sensor) and the incrementation of &#8216;events&#8217; which are triggered when the sensor tips a certain threshold &#8211; the 7 segment LEDs acts as a counter for the events.</p>
<p>These displays are piggy-backing on motes, connecting through a DF9 socket (<a href="http://www.hirose.co.jp/cataloge_hp/e54000041.pdf" rel="nofollow">http://www.hirose.co.jp/cataloge_hp/e54000041.pdf</a>) on the mote. The board I&#8217;m building is like a parasite which looks at the motes sensors, hopefully without disturbing the mote&#8217;s function which has off-the shelf firmware. Each node is runing off a power supply so I don&#8217;t have to worry about all that stuff!</p>
<p>Here&#8217;s a link to the project: <a href="http://www.goldsmiths.ac.uk/interaction/health.html" rel="nofollow">http://www.goldsmiths.ac.uk/interaction/health.html</a></p>
<p>I&#8217;m a designer rather than an engineer, but I get there in the end, but not without kind help along the way!</p>
<p>I&#8217;m going to insert some assembler code for the interval, I recall now a snippit on the pic basic forum which did something similar.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith Neufeld</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=109&#038;cpage=1#comment-20738</link>
		<dc:creator>Keith Neufeld</dc:creator>
		<pubDate>Wed, 05 Sep 2007 18:20:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=109#comment-20738</guid>
		<description>Tobie, excellent!  Glad it&#039;s working now.

NOP is &quot;no operation,&quot; an opcode in many assembly languages to do nothing for one clock cycle.  Some higher-level languages, particularly for embedded systems programming, use it also, to cause a short delay.

For example, LogoChip Logo, the language I&#039;ve been using on PIC microcontrollers, has &lt;code&gt;wait n&lt;/code&gt; (&lt;em&gt;n&lt;/em&gt; intervals of .1 second) and &lt;code&gt;mwait n&lt;/code&gt; (&lt;em&gt;n&lt;/em&gt; &#956;s); and also &lt;code&gt;no-op&lt;/code&gt;, which waits for one cycle in the virtual machine -- about 13 ns, if I recall correctly.

I don&#039;t know Picbasic, but you might look for a &lt;code&gt;NOP&lt;/code&gt; or &lt;code&gt;no-op&lt;/code&gt; in it.  If not, your &lt;code&gt;PAUSEUS&lt;/code&gt; should be more than adequate.

So . . . what are you building with a bar-graph and two digits? :-)</description>
		<content:encoded><![CDATA[<p>Tobie, excellent!  Glad it&#8217;s working now.</p>
<p>NOP is &#8220;no operation,&#8221; an opcode in many assembly languages to do nothing for one clock cycle.  Some higher-level languages, particularly for embedded systems programming, use it also, to cause a short delay.</p>
<p>For example, LogoChip Logo, the language I&#8217;ve been using on PIC microcontrollers, has <code>wait n</code> (<em>n</em> intervals of .1 second) and <code>mwait n</code> (<em>n</em> &mu;s); and also <code>no-op</code>, which waits for one cycle in the virtual machine &#8212; about 13 ns, if I recall correctly.</p>
<p>I don&#8217;t know Picbasic, but you might look for a <code>NOP</code> or <code>no-op</code> in it.  If not, your <code>PAUSEUS</code> should be more than adequate.</p>
<p>So . . . what are you building with a bar-graph and two digits? <img src='http://www.neufeld.newton.ks.us/electronics/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tobie</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=109&#038;cpage=1#comment-20737</link>
		<dc:creator>Tobie</dc:creator>
		<pubDate>Wed, 05 Sep 2007 17:04:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=109#comment-20737</guid>
		<description>It&#039;s alive! Keith that&#039;s a huge help, I can make sense of the block diagram and understand what the heck is going on now.

Picbasic has a PAUSEUS to create a microsecond pause, I guess this is x10 the 100ns you and the datasheet suggest for the Latch pulse width  - infact my PIC is using a 20 MHz clock to I only need 50ns.

So my last question is, what is this NOP you mention to create a delay?</description>
		<content:encoded><![CDATA[<p>It&#8217;s alive! Keith that&#8217;s a huge help, I can make sense of the block diagram and understand what the heck is going on now.</p>
<p>Picbasic has a PAUSEUS to create a microsecond pause, I guess this is x10 the 100ns you and the datasheet suggest for the Latch pulse width  &#8211; infact my PIC is using a 20 MHz clock to I only need 50ns.</p>
<p>So my last question is, what is this NOP you mention to create a delay?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith Neufeld</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=109&#038;cpage=1#comment-20734</link>
		<dc:creator>Keith Neufeld</dc:creator>
		<pubDate>Wed, 05 Sep 2007 14:15:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=109#comment-20734</guid>
		<description>I tie the output enable pin (/OE) low (active) in hardware.  If I want all lights off, I just set all bits to 0.  So I have common SDI and CK throughout, and a latch enable for each parallel section.  4 pins for 2 drivers.

I&#039;d suggest two fixes for your code.  First, as you noted already, make two latch lines.

Second, leave /OE low all the time.  When you raise it high, you&#039;re turning off the LEDs.  Just strobe the latch high for at least 100ns when you want to latch the new data you&#039;ve shifted in.

So:

&lt;code&gt;
 ‘enable driver for 10-bit bar
LOW enable1_6276
LOOKUP2 barIndex, [0,1,3,7,15,31,63,127,255,511,1023], bits_bar
&lt;strike&gt;&lt;font color=red&gt;LOW latch_6276&lt;/font&gt;&lt;/strike&gt;
LOW clock_6276
’shift data out
SHIFTOUT data_6276, clock_6276, MSBFIRST, [bits_bar\10]
HIGH latch_6276
&lt;font color=red&gt;&lt;em&gt;Add 100ns delay here -- maybe a few NOPs&lt;/em&gt;&lt;/font&gt;
&lt;font color=red&gt;LOW latch_6276&lt;/font&gt;
&lt;strike&gt;&lt;font color=red&gt;HIGH enable1_6276&lt;/font&gt;&lt;/strike&gt;
&lt;/code&gt;

And then a similar change for your two-digit driver.

What&#039;s happening right now is that you&#039;re shifting bar-graph bits into &lt;em&gt;both&lt;/em&gt; the bar-graph and two-digit displays and latching it to both outputs, then shifting two-digit bits into both displays and latching to both outputs.  You want to latch bar-graph data only into the bar-graph driver output, and two-digit data only into the two-digit output.

Page 2 of the &lt;a href=&quot;http://www.allegromicro.com/en/Products/Part_Numbers/6276/6276.pdf&quot; rel=&quot;nofollow&quot;&gt;datasheet&lt;/a&gt; has a nice diagram showing the serial-parallel shift register separate from the output latch.</description>
		<content:encoded><![CDATA[<p>I tie the output enable pin (/OE) low (active) in hardware.  If I want all lights off, I just set all bits to 0.  So I have common SDI and CK throughout, and a latch enable for each parallel section.  4 pins for 2 drivers.</p>
<p>I&#8217;d suggest two fixes for your code.  First, as you noted already, make two latch lines.</p>
<p>Second, leave /OE low all the time.  When you raise it high, you&#8217;re turning off the LEDs.  Just strobe the latch high for at least 100ns when you want to latch the new data you&#8217;ve shifted in.</p>
<p>So:</p>
<p><code><br />
 ‘enable driver for 10-bit bar<br />
LOW enable1_6276<br />
LOOKUP2 barIndex, [0,1,3,7,15,31,63,127,255,511,1023], bits_bar<br />
<strike><font color=red>LOW latch_6276</font></strike><br />
LOW clock_6276<br />
’shift data out<br />
SHIFTOUT data_6276, clock_6276, MSBFIRST, [bits_bar\10]<br />
HIGH latch_6276<br />
<font color=red><em>Add 100ns delay here -- maybe a few NOPs</em></font><br />
<font color=red>LOW latch_6276</font><br />
<strike><font color=red>HIGH enable1_6276</font></strike><br />
</code></p>
<p>And then a similar change for your two-digit driver.</p>
<p>What&#8217;s happening right now is that you&#8217;re shifting bar-graph bits into <em>both</em> the bar-graph and two-digit displays and latching it to both outputs, then shifting two-digit bits into both displays and latching to both outputs.  You want to latch bar-graph data only into the bar-graph driver output, and two-digit data only into the two-digit output.</p>
<p>Page 2 of the <a href="http://www.allegromicro.com/en/Products/Part_Numbers/6276/6276.pdf" rel="nofollow">datasheet</a> has a nice diagram showing the serial-parallel shift register separate from the output latch.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tobie</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=109&#038;cpage=1#comment-20733</link>
		<dc:creator>Tobie</dc:creator>
		<pubDate>Wed, 05 Sep 2007 12:05:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=109#comment-20733</guid>
		<description>Thanks Keith,

So in parallel, each A6276 needs its own Latch Enable (pin4) and its own output enable (pin21), then a common SDI and clock. Thats 6 pins for 2 drivers?

Here&#039;s the code that is broke:

controlLEDdrivers:
    
    &#039;enable driver for 10-bit bar
    LOW enable1_6276
    LOOKUP2 barIndex, [0,1,3,7,15,31,63,127,255,511,1023], bits_bar
    LOW latch_6276
    LOW clock_6276
    &#039;shift data out
    SHIFTOUT data_6276, clock_6276, MSBFIRST, [bits_bar\10]
    HIGH latch_6276
    HIGH enable1_6276
    
    &#039;enable driver for 7 segment displays
    LOW enable2_6276
    LOOKUP2 dig1Index, [252,96,218,242,102,182,190,224,254,246], bits_dig1
    LOOKUP2 dig2Index, [252,96,218,242,102,182,190,224,254,246], bits_dig2
    bits_dig.byte1 = bits_dig1 
    bits_dig.byte0 = bits_dig2
    LOW latch_6276
    LOW clock_6276
    &#039;shift data out
    SHIFTOUT data_6276, clock_6276, LSBFIRST, [bits_dig\16]
    HIGH latch_6276
    HIGH enable2_6276
    
return

If I were to use 2 pins for the latches (&quot;latch1_6276&quot; and &quot;latch2_6276&quot; for example) things would work?

Well I&#039;m trying it now...

thanks again, Tobie</description>
		<content:encoded><![CDATA[<p>Thanks Keith,</p>
<p>So in parallel, each A6276 needs its own Latch Enable (pin4) and its own output enable (pin21), then a common SDI and clock. Thats 6 pins for 2 drivers?</p>
<p>Here&#8217;s the code that is broke:</p>
<p>controlLEDdrivers:</p>
<p>    &#8216;enable driver for 10-bit bar<br />
    LOW enable1_6276<br />
    LOOKUP2 barIndex, [0,1,3,7,15,31,63,127,255,511,1023], bits_bar<br />
    LOW latch_6276<br />
    LOW clock_6276<br />
    &#8216;shift data out<br />
    SHIFTOUT data_6276, clock_6276, MSBFIRST, [bits_bar\10]<br />
    HIGH latch_6276<br />
    HIGH enable1_6276</p>
<p>    &#8216;enable driver for 7 segment displays<br />
    LOW enable2_6276<br />
    LOOKUP2 dig1Index, [252,96,218,242,102,182,190,224,254,246], bits_dig1<br />
    LOOKUP2 dig2Index, [252,96,218,242,102,182,190,224,254,246], bits_dig2<br />
    bits_dig.byte1 = bits_dig1<br />
    bits_dig.byte0 = bits_dig2<br />
    LOW latch_6276<br />
    LOW clock_6276<br />
    &#8216;shift data out<br />
    SHIFTOUT data_6276, clock_6276, LSBFIRST, [bits_dig\16]<br />
    HIGH latch_6276<br />
    HIGH enable2_6276</p>
<p>return</p>
<p>If I were to use 2 pins for the latches (&#8220;latch1_6276&#8243; and &#8220;latch2_6276&#8243; for example) things would work?</p>
<p>Well I&#8217;m trying it now&#8230;</p>
<p>thanks again, Tobie</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith Neufeld</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=109&#038;cpage=1#comment-20732</link>
		<dc:creator>Keith Neufeld</dc:creator>
		<pubDate>Wed, 05 Sep 2007 11:50:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=109#comment-20732</guid>
		<description>Tobie, the latch enable tells &lt;em&gt;each&lt;/em&gt; A6276 when it&#039;s time to take the bits it&#039;s holding internally and put them onto the output.  Until you strobe the latch enable, the new data bits are only held internally.

If you want to use two A6276s, you can hook them up in two ways: series or parallel.

In series, the first chip&#039;s serial data out (SDO) should connect to the second chip&#039;s serial data in (SDI), the clock (CK) signal should connect to both chips, and the latch enable (L) should connect to both chips.  Then any time you want to update a signal somewhere, you need to shift out 32 bits of data (enough to fill the entire pipeline of both chips) and then latch it.  This is how I drive the two A6276s within one of my clock&#039;s digits.

In parallel, you connect your PIC to both chip&#039;s SDI lines and clock lines, and connect a separate pin to each chip&#039;s latch enable line.  You only have to clock out sixteen bits of data at a time, enough to fill one chip.  &lt;em&gt;Both chips will have the new data in their buffers&lt;/em&gt;, but only the one you latch will then use it to drive its output.  This is how I connect the six pairs of A6276s for my clock&#039;s six digits.</description>
		<content:encoded><![CDATA[<p>Tobie, the latch enable tells <em>each</em> A6276 when it&#8217;s time to take the bits it&#8217;s holding internally and put them onto the output.  Until you strobe the latch enable, the new data bits are only held internally.</p>
<p>If you want to use two A6276s, you can hook them up in two ways: series or parallel.</p>
<p>In series, the first chip&#8217;s serial data out (SDO) should connect to the second chip&#8217;s serial data in (SDI), the clock (CK) signal should connect to both chips, and the latch enable (L) should connect to both chips.  Then any time you want to update a signal somewhere, you need to shift out 32 bits of data (enough to fill the entire pipeline of both chips) and then latch it.  This is how I drive the two A6276s within one of my clock&#8217;s digits.</p>
<p>In parallel, you connect your PIC to both chip&#8217;s SDI lines and clock lines, and connect a separate pin to each chip&#8217;s latch enable line.  You only have to clock out sixteen bits of data at a time, enough to fill one chip.  <em>Both chips will have the new data in their buffers</em>, but only the one you latch will then use it to drive its output.  This is how I connect the six pairs of A6276s for my clock&#8217;s six digits.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tobie</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=109&#038;cpage=1#comment-20731</link>
		<dc:creator>Tobie</dc:creator>
		<pubDate>Wed, 05 Sep 2007 11:37:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=109#comment-20731</guid>
		<description>Hi Keith,

I see you have made extensive Allegro&#039;s A6276 LED driver.

I&#039;m having some problems addressing multiple A6276s. Singly I can get either to play nicely, but otherwise I get mess on the LEDs. One driver had a 10 bar display, the other has x2 seven segment arrays.

I think I don&#039;t fully understand how and when the latch enable should be used - I&#039;m using picbasic pro with a 16F876.

best wishes,
Tobie</description>
		<content:encoded><![CDATA[<p>Hi Keith,</p>
<p>I see you have made extensive Allegro&#8217;s A6276 LED driver.</p>
<p>I&#8217;m having some problems addressing multiple A6276s. Singly I can get either to play nicely, but otherwise I get mess on the LEDs. One driver had a 10 bar display, the other has x2 seven segment arrays.</p>
<p>I think I don&#8217;t fully understand how and when the latch enable should be used &#8211; I&#8217;m using picbasic pro with a 16F876.</p>
<p>best wishes,<br />
Tobie</p>
]]></content:encoded>
	</item>
</channel>
</rss>
