Re: [bascom] How to display 8 bit data in 7segment displays


From guy daelen <guy.daelen@skynet.be>
Date Sat, 05 Jan 2002 20:25:00 +0100

At 23:04 5/01/02 +0530, you wrote:
hi all,
 
I'm looking for a simple way to display 8 bit data (numbers 0-255) in three 7 segment LED Displays.
The BCD to 7segment encoders have only 4 bit data input.How to implement this?

you can use a pic....(no,this is a joke)
you can use an eprom,8 bits data ->A0...A7   ; A8;A9 come from a 2 bits counter who drive also up to 4 transistors to drive 7 segments common,
 and output  of eprom (with buffer-uln2803) to segments- multiplexing of course

but i think you use bascom...... so drive  8segments (7 + digital point) with a port and common with  4 other bits  .......and program multiplexing
-if you want you can also send 4 bits to a bcd-> 7 segments  decoders

http://www.mcselec.com/an12.htm
http://www.chipcenter.com/circuitcellar/september01/ancil-0901/c0901nrf2.htm;$sessionid$JDAIUXYAALIADJ4Y5XDCFEQ

you can also use saa 1064 if you want to use very few bits(2) .it works very well with bascom(I2C)
(i am nor sure all variable are dimensioned )- print is for test
'--------saa1064 -------
sub aff1064(affich)
'Local I As Byte
'Local Pr As String * 4
'Local P2 As String * 8
'Local P1 As String * 1
'Local N(4) As Byte
$eeprom
Saa1064:
Data &H77 , &H12 , &H6B , &H5B , &H1E , &H5D , &H7D , &H13 , &H7F , &H5F
'I2creceive Ad1064 , i
'Print "status saa1064=" ; i
'Print "affich " ; Affich
Pr = Str(affich )
P2 = K + Pr
Pr = Right(p2 , 4)
For I = 1 To 4
P1 = Mid(pr , I , 1)
N(i) = Asc(p1)
N(i) = N(i) - 48                'ascii to value
N(i) = Lookup(n(i) , Saa1064)
Next I
'send i2c
I2cstart
I2cwbyte Ad1064
I2cwbyte 0
I2cwbyte &HF7                   'see saa1064 data sheet
I2cwbyte N(1)
I2cwbyte N(2)
I2cwbyte N(3)
I2cwbyte N(4)
I2cstop
 Return

i hope this help you

guy