<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/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/"><channel><title>Multiplexed 7 segment display scanning</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/40613/multiplexed-7-segment-display-scanning</link><description> 
I am using 6 7-segment displays which are multiplexed using a 3:8
multiplexer. I am displaying ADC readings on the display. I am unable
to find a point wherein the display would not flicker but show
continuous reading (ADC: ADS1230, uC: 89V51RD2, Communication</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Multiplexed 7 segment display scanning</title><link>https://community.arm.com/thread/107746?ContentTypeID=1</link><pubDate>Mon, 16 Jun 2014 10:24:06 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6f961f70-4691-414e-838b-8cfb0ab6a979</guid><dc:creator>&amp;#178;erik malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;quot;Does this code seem good?&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
I wonder if receiveADC() does&lt;/p&gt;

&lt;p&gt;
my GUESS is that you are loopwaiting there&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multiplexed 7 segment display scanning</title><link>https://community.arm.com/thread/120356?ContentTypeID=1</link><pubDate>Mon, 16 Jun 2014 09:32:59 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:3980150c-5d6a-404a-afbd-2797c561f9e8</guid><dc:creator>Westonsupermare Pier</dc:creator><description>&lt;p&gt;&lt;p&gt;
No idea, I don&amp;#39;t have your hardware, what does your testing
show?&lt;/p&gt;

&lt;p&gt;
Why don&amp;#39;t you mask on the bits to P2 in manner that doesn&amp;#39;t
interfere with unrelated bits?&lt;/p&gt;

&lt;pre&gt;
P2 = (P2 &amp;amp; ~((1&amp;lt;&amp;lt;5) | (1&amp;lt;&amp;lt;6) | (1&amp;lt;&amp;lt;7))) | DigitSelect[currentDigit];
&lt;/pre&gt;
&lt;pre&gt;
P2 = (P2 &amp;amp; 0x1F) | DigitSelect[currentDigit];
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multiplexed 7 segment display scanning</title><link>https://community.arm.com/thread/107747?ContentTypeID=1</link><pubDate>Mon, 16 Jun 2014 01:50:23 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:5086b5d1-ed1e-4670-85ab-14d176834d4a</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
&amp;quot;Does this code seem good?&amp;quot;&lt;/p&gt;

&lt;p&gt;
Shouldn&amp;#39;t the question be: do this code run good? What result did
you get when you tested?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multiplexed 7 segment display scanning</title><link>https://community.arm.com/thread/81963?ContentTypeID=1</link><pubDate>Sun, 15 Jun 2014 23:17:59 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6bd27c17-1f57-4e66-9c48-07d63f128f07</guid><dc:creator>Ruchik Vora</dc:creator><description>&lt;p&gt;&lt;p&gt;
Does this code seem good?&lt;/p&gt;

&lt;pre&gt;
void timer_init()
{
        TMOD = 0x01;            // mode1 of Timer0
        TH0 = 0xE0;             // initial values loaded to timer
        TL0 = 0xBF;
        IEN0 = 0x82;            // enable interrupt
        TR0 = 1;
}

void holdResult(int adcresult)
{
        char count = 0;
        while(adcresult)
        {
                digits[count++] = (char)(adcresult % 10);
                adcresult/=10;
        }
        totalDigits = count - 1;
}

void showDigit()
{
        if(currentDigit &amp;gt; totalDigits)
                currentDigit = 0;
        //P2 &amp;amp;= ~((1&amp;lt;&amp;lt;5) | (1&amp;lt;&amp;lt;6) | (1&amp;lt;&amp;lt;7));
        P2 = DigitSelect[currentDigit];
        P0 = ActualDigit[digits[currentDigit++]];
}

void timer(void) interrupt 1            //interrupt no. 1 for Timer 0
{
        showDigit();
        TH0=0xE0;               // initial values loaded to timer
        TL0=0xBF;
}

void main()
{
    P0 = 0xFF;
                P2 &amp;amp;= ~((1&amp;lt;&amp;lt;5) | (1&amp;lt;&amp;lt;6) | (1&amp;lt;&amp;lt;7));
                init_master();
                timer_init();
                while(1)
                {
                        adc_result = receiveADC();
                        holdResult(adc_result);
                }
}
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multiplexed 7 segment display scanning</title><link>https://community.arm.com/thread/120359?ContentTypeID=1</link><pubDate>Sat, 14 Jun 2014 13:32:43 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2d60ecc3-6014-4482-8a6c-3602898a2466</guid><dc:creator>&amp;#178;erik malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
yes, 120 HZ min, for a display, but as a note LED lighting (which
I just did) run, typically @ 1200, thus the goof&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multiplexed 7 segment display scanning</title><link>https://community.arm.com/thread/107744?ContentTypeID=1</link><pubDate>Sat, 14 Jun 2014 11:31:29 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:3205bc32-117f-450c-a9e2-78ee05e2f6cf</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
Did you mean 120Hz ?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multiplexed 7 segment display scanning</title><link>https://community.arm.com/thread/93211?ContentTypeID=1</link><pubDate>Sat, 14 Jun 2014 10:21:33 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:84c7f04c-b92c-4f50-abdc-6f041f4ed65a</guid><dc:creator>&amp;#178;erik malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
I did some flicker analysis a while ago&lt;br /&gt;
60Hz everyone see flicker&lt;br /&gt;
100Hz some see flicker&lt;br /&gt;
1200Hz none see flicker&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multiplexed 7 segment display scanning</title><link>https://community.arm.com/thread/62899?ContentTypeID=1</link><pubDate>Sat, 14 Jun 2014 09:23:35 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f48a9e86-33d5-4edf-b988-7a793d0cb096</guid><dc:creator>Westonsupermare Pier</dc:creator><description>&lt;p&gt;&lt;p&gt;
You could start by not turning them off all the while, and
modifying P2 in a single operation&lt;/p&gt;

&lt;p&gt;
Consider having a holding register for the display digits, and
cycling through that in an interrupt periodically.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>