Searching \ for 'Routine for display' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/index.htm?key=routine+display
Search entire site for: 'Routine for display'.

Truncated match.
PICList Thread
'Routine for display'
1999\02\13@130731 by ke

flavicon
face
part 0 1697 bytes
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
<META content='"MSHTML 4.72.2106.6"' name=GENERATOR>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT color=#000000 size=2>Hi !</FONT></DIV>
<DIV><FONT color=#000000 size=2>Are there any who has a simple routine to
get</FONT></DIV>
<DIV><FONT color=#000000 size=2></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000
size=2>Ones&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
on digit 1</FONT></DIV>
<DIV><FONT color=#000000
size=2>Tens&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
on digit 2</FONT></DIV>
<DIV><FONT color=#000000
size=2>Hundreds&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on digit
3</FONT></DIV>
<DIV><FONT color=#000000
size=2>Thousands&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on digit
4</FONT></DIV>
<DIV><FONT color=#000000 size=2>displayed on four LED-displays output from
16F84?</FONT></DIV>
<DIV><FONT color=#000000 size=2></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000 size=2>Grateful for help!</FONT></DIV>
<DIV><FONT color=#000000 size=2>&Aring;ke</FONT></DIV></BODY></HTML>

</x-html>

1999\02\13@135418 by Joe and Pam

picon face
ke wrote:
>
> Hi !
> Are there any who has a simple routine to get
>
> Ones                on digit 1
> Tens                 on digit 2
> Hundreds          on digit 3
> Thousands        on digit 4
> displayed on four LED-displays output from 16F84?
>
> Grateful for help!
> ke
Probably a jump table for the digits called from a display routine.

1999\02\14@063259 by paulb

flavicon
face
ke wrote:

> Are there any who has a simple routine to get

> Ones         on digit 1
> Tens         on digit 2
> Hundreds     on digit 3
> Thousands    on digit 4

> displayed on four LED-displays output from 16F84?

 OK, here we go again.

# In what form are the digits to start with?  Four separate registers
in the PIC?  Packed BCD in two bytes?  A two-byte binary value limited
to decimal 9999?

# What are the four displays?  Multiplexed 7-segment?  Common cathode
or common anode?  How much current per segment do you want?  Do you want
to use 8 wires (no DP?), 9, 10, or 12?  Alternately are you using
latched BCD displays?  Latched ASCII?  Have you designed the circuit
yet?  Have you decided on the components yet?
--
 Cheers,
       Paul B.

1999\02\14@161729 by Gerhard Fiedler

picon face
At 22:28 02/14/99 +1000, Paul B. Webster VK2BZC wrote:
> # What are the four displays?  Multiplexed 7-segment?  Common cathode
>or common anode?  How much current per segment do you want?  Do you want
>to use 8 wires (no DP?), 9, 10, or 12?  Alternately are you using
>latched BCD displays?  Latched ASCII?  Have you designed the circuit
>yet?  Have you decided on the components yet?

now you slightly surprised me. 4 multiplexed 7-segment digits (even without
dp) on 8 wires? without heavy encoding/decoding/latching? i'd understand 9
wires, using a 2-to-4 decoder, but 8?

ge

1999\02\14@163352 by ryan pogge

flavicon
face
just use a MAX7219.
always works for me

>At 22:28 02/14/99 +1000, Paul B. Webster VK2BZC wrote:
>> # What are the four displays?  Multiplexed 7-segment?  Common cathode
>>or common anode?  How much current per segment do you want?  Do you want
>>to use 8 wires (no DP?), 9, 10, or 12?  Alternately are you using
>>latched BCD displays?  Latched ASCII?  Have you designed the circuit
>>yet?  Have you decided on the components yet?
>
>now you slightly surprised me. 4 multiplexed 7-segment digits (even without
>dp) on 8 wires? without heavy encoding/decoding/latching? i'd understand 9
>wires, using a 2-to-4 decoder, but 8?
>
>ge

1999\02\14@175307 by Regulus Berdin

picon face
Hi,

"ke" wrote:
> Are there any who has a simple routine to get
>
> Ones                on digit 1
> Tens                 on digit 2
> Hundreds          on digit 3
> Thousands        on digit 4
> displayed on four LED-displays output from 16F84?
>
> Grateful for help!

What you need is a binary to BCD converter.

Here is a 16 bit version:

bin2bcd:
       movlw   .16
       movwf   ctr
       clrf    bcd1
       clrf    bcd2
       clrf    bcd3
       goto    start

adjdec:
       movlw   0x33
       addwf   bcd1,f
       addwf   bcd2,f
       addwf   bcd3,f

       movlw   0x03
       btfss   bcd1,3
        subwf  bcd1,f
       btfss   bcd2,3
        subwf  bcd2,f
       btfss   bcd3,3
        subwf  bcd3,f

       movlw   0x30
       btfss   bcd1,7
        subwf  bcd1,f
       btfss   bcd2,7
        subwf  bcd2,f
       btfss   bcd3,7
        subwf  bcd3,f

start:
       rlf     bin2,f
       rlf     bin1,f
       rlf     bcd3,f
       rlf     bcd2,f
       rlf     bcd1,f
       decfsz  ctr,f
        goto   adjdec

       return

1s digit will be on the lower nibble of bcd3, 10s on the upper nibble of
bcd3 and 100s and 1000s will be on the lower and upper nibbles of bcd2,
respectively.  The lower nibble will contain 10,000s up to 6.

regards,
Reggie

1999\02\14@183308 by paulb

flavicon
face
I've entered into discussion with ke, and it appears his actual
problem is making multiplexing work.  Regulus' offering is not required
at this point, many thanks!  We'll see how ke goes.

Ryan Pogge wrote:

> just use a MAX7219.  always works for me

 .. and that is certainly a neat way to do it, but most people, ke
evidently included, like to reduce the chip count and thereby cost to
the absolute minimum.  (How much *is* a MAX7219 and how many sets of PIC
plus four transistors and eight resistors will the same money buy?)

 If the PIC is *only* being used to drive the display, and has these
nice output drivers capable of 10mA each (up to 8 at a time), it does
seem excessive to use 2 chips where one could do.

Gerhard Fiedler wrote:

>  Now you slightly surprised me. 4 multiplexed 7-segment digits (even
> without dp) on 8 wires? without heavy encoding/decoding/latching?  I'd
> understand 9 wires, using a 2-to-4 decoder, but 8?

 Ah!  *Someone* took the bait!  I actually proposed *eight* digits
without DP on 8 wires, 9 digits and I/O lines if you include DP.

 I've discussed this in detail on this list a couple of times before
IIRC.  I really must put it on my web site.  It makes use of the fact
that *each* PIC output can either pull down (drive segments on common
anode displays) or pull up (drive a common anode via an NPN buffer
transistor e.g. BC337).  OK?
--
 Cheers,
       Paul B.

1999\02\15@054655 by Gerhard Fiedler

picon face
At 10:27 02/15/99 +1000, Paul B. Webster VK2BZC wrote:
>  Ah!  *Someone* took the bait!  I actually proposed *eight* digits
>without DP on 8 wires, 9 digits and I/O lines if you include DP.
>
>  I've discussed this in detail on this list a couple of times before
>IIRC.  I really must put it on my web site.  It makes use of the fact
>that *each* PIC output can either pull down (drive segments on common
>anode displays) or pull up (drive a common anode via an NPN buffer
>transistor e.g. BC337).  OK?

aaahh, ok :-))  it's a really comfortable feeling that at least =some=
people out there are smarter than me :))

but you couldn't use one of the nice modules i like (for ease of wiring)
which have not only (digit) common anodes, but also (segment) common
cathodes, could you? and you have to spend some additional "smarts" in
firmware, since the segment assignments change from digit to digit. but
i'll keep that one in mind, you bet... (should i put a notice on the board
if i use it? :)

and as far as the specialized 7-segment driver chips go -- i really can't
see much reason to use one of them when you can have a pic (or some other
cheap micro along the lines) do it for so much less and so much more
flexible, both in terms of what to display (ever wanted all of a sudden a
couple of wierd debugging characters in addition to the 10 numbers on a
display and your driver only does bcd?) as well as in terms of how to
interface to the rest: choose from spi, i2c, async serial (which is
basically a one-wire interface -- wouldn't know of any dedicated display
driver that does this), ...

ge

1999\02\15@072253 by paulb

flavicon
face
Gerhard Fiedler wrote:

> but you couldn't use one of the nice modules I like (for ease of
> wiring) which have not only (digit) common anodes, but also (segment)
> common cathodes, could you?

 Indeed you can't.

> and you have to spend some additional "smarts" in firmware, since the
> segment assignments change from digit to digit. but i'll keep that one
> in mind, you bet...

 The "smarts" aren't too difficult.  Essentially, you wire the digits
with what I term "exception" coding where the segment whose line has
been used as the digit drive is driven by the "extra" line.
viz: d abcDefgp
    e abcdDfgp
    f abcdeDgp

 Of course the digit driven by the "extra" line is the only one for
which all the segments go to their own lines.  D abcdefgp

 You have a segment bit pattern (active low) you want to write to the
digit, and you have a digit mask containing a single "1" in the position
corresponding to that digit.  Assuming PIC conventions, common anode:

 Tris_B = segments .and. .not. digit
 Port_B = digit
 Tris_A.extr = (segments .and. digit) .and. (digit .ne. 0)
 Port_A.extr = (digit .eq. 0)

 You could also wire so the lines are "shifted" aside from the one used
for the digit, ( a bcDdefgp ) or so that the lines to each digit rotate
in sequence from the digit select line ( e fgpDabcd ).  The former of
these is quite diffiuclt to code for, the latter fairly easy.

> (should i put a notice on the board if i use it? :)

 Not sure.  Alan King <spam_OUTshadedemonTakeThisOuTspammindspring.com> wrote me privately
that he has been using this system with extensions for input as well
(pushbuttons in series with ordinary diodes).  Perhaps he might pipe up
and say where he got it from?  I'm sure someone must have been using it
before I thought it out.  Originality is difficult.

> as far as the specialized 7-segment driver chips go -- i really can't
> see much reason to use one of them when you can have a pic (or some
> other cheap micro along the lines) do it for so much less

 It would seem so.  Anyone know the prices of the "other" drivers?

> and so much more flexible, both in terms of what to display (ever
> wanted all of a sudden a couple of wierd debugging characters in
> addition to the 10 numbers on a display and your driver only does
> bcd?)

 I rather like playing with rotating beacons (over one or two digits),
climbing "rungs", alphabetics etc.
--
 Cheers,
       Paul B.

1999\02\15@140534 by ke

flavicon
face
-----Original Message-----
From: Regulus Berdin <.....rberdinKILLspamspam@spam@BIGFOOT.COM>
To: PICLISTspamKILLspamMITVMA.MIT.EDU <.....PICLISTKILLspamspam.....MITVMA.MIT.EDU>
Date: den 14 februari 1999 23:57
Subject: Re: Routine for display


Hi,

"ke" wrote:
> Are there any who has a simple routine to get
>
> Ones                on digit 1
> Tens                 on digit 2
> Hundreds          on digit 3
> Thousands        on digit 4
> displayed on four LED-displays output from 16F84?
>
> Grateful for help!

What you need is a binary to BCD converter.

Here is a 16 bit version:

bin2bcd:
       movlw   .16
       movwf   ctr
       clrf    bcd1
       clrf    bcd2
       clrf    bcd3
       goto    start

adjdec:
       movlw   0x33
       addwf   bcd1,f
       addwf   bcd2,f
       addwf   bcd3,f

       movlw   0x03
       btfss   bcd1,3
        subwf  bcd1,f
       btfss   bcd2,3
        subwf  bcd2,f
       btfss   bcd3,3
        subwf  bcd3,f

       movlw   0x30
       btfss   bcd1,7
        subwf  bcd1,f
       btfss   bcd2,7
        subwf  bcd2,f
       btfss   bcd3,7
        subwf  bcd3,f

start:
       rlf     bin2,f
       rlf     bin1,f
       rlf     bcd3,f
       rlf     bcd2,f
       rlf     bcd1,f
       decfsz  ctr,f
        goto   adjdec

       return

1s digit will be on the lower nibble of bcd3, 10s on the upper nibble of
bcd3 and 100s and 1000s will be on the lower and upper nibbles of bcd2,
respectively.  The lower nibble will contain 10,000s up to 6.

regards,
Reggie


Thanks but I have four separate registers which counting 0-9
in decimal and displays from a segtable.
Any ideas to multiplexed the digits?

Regards
keN

1999\02\15@191254 by Gerhard Fiedler

picon face
At 23:18 02/15/99 +1000, Paul B. Webster VK2BZC wrote:
>  The "smarts" aren't too difficult.

indeed, your "exception" coding is pretty nice, too.

>I'm sure someone must have been using it
>before I thought it out.  Originality is difficult.

this seems to be true for most circuit ideas. that's why i was surprised to
find that they actually put patents on some circuits. but i guess that's
not really relevant in most cases. at least i don't have an idea (and
actually don't really care a lot about) whether some circuit i'm designing
is patented or not.

ge

1999\02\17@122250 by Adam Bryant

flavicon
face
Another option is a specialized driver IC.  Maxim has one made specifically
for this purpose.  You clock in data from your microcontroller serially and
it handles multiplexing, refreshes, etc.  Don't recall the part number
off-hand, but you could do a search at <http://www.maxim-ic.com>.

Another of my $.02 worth,
Adam





EraseMElistsspam_OUTspamTakeThisOuTHOME.COM on 02/14/99 02:16:07 PM

Please respond to PICLISTspamspam_OUTMITVMA.MIT.EDU

To:   @spam@PICLISTKILLspamspamMITVMA.MIT.EDU
cc:    (bcc: Adam Bryant/PEAK/MOORE)
Subject:  Re: Routine for display




At 22:28 02/14/99 +1000, Paul B. Webster VK2BZC wrote:
> # What are the four displays?  Multiplexed 7-segment?  Common cathode
>or common anode?  How much current per segment do you want?  Do you want
>to use 8 wires (no DP?), 9, 10, or 12?  Alternately are you using
>latched BCD displays?  Latched ASCII?  Have you designed the circuit
>yet?  Have you decided on the components yet?
now you slightly surprised me. 4 multiplexed 7-segment digits (even without
dp) on 8 wires? without heavy encoding/decoding/latching? i'd understand 9
wires, using a 2-to-4 decoder, but 8?
ge

1999\02\17@123658 by ryan pogge

flavicon
face
um, 7219!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I suggested this also but it seems it costs too much for their use.

{Quote hidden}

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...