Ha,
, a little research and I found the solution for using 16V8.
The trick is to do the equations with negative logic instead of positive logic and then later invert the output pins. In our case, there are fewer terms. Imagine using a common anode display. At 0 the LED lights up, at 1 it doesn't. (Afterwards we can simply flip the polarity of the pin for our common cathode display.)
For the inverse case, there are simply far fewer equations.
Code:
/* *************** INPUT PINS *********************/
PIN 1 = CLK;
PIN 2 = AIA;
PIN 3 = AIB;
PIN 4 = AIC;
PIN 5 = AID;
PIN 6 = BIA;
PIN 7 = BIB;
PIN 8 = BIC;
PIN 9 = BID;
/* *************** OUTPUT PINS *********************/
PIN 19 = OEAB ;
PIN 18 = !E ;
PIN 17 = !B ;
PIN 16 = !C ;
PIN 15 = !A ;
PIN 14 = !D ;
PIN 13 = !F ;
PIN 12 = !G ;
/* ************* Declarations **********************/
FIELD AADD = [CLK,AID,AIC,AIB,AIA] ;
FIELD BADD = [CLK,BID,BIC,BIB,BIA] ;
FIELD OUTPUT = [A,B,C,D,E,F,G] ;
/********* EQUATIONS ****************/
OEAB = !CLK;
/* 7-Segment A */
TABLE AADD => OUTPUT {
'b'00000=>'b'00000011 ; /* 0 */
'b'00001=>'b'10011111 ; /* 1 */
'b'00010=>'b'00100101 ; /* 2 */
'b'00011=>'b'00001101 ; /* 3 */
'b'00100=>'b'10011001 ; /* 4 */
'b'00101=>'b'01001001 ; /* 5 */
'b'00110=>'b'01000001 ; /* 6 */
'b'00111=>'b'00011111 ; /* 7 */
'b'01000=>'b'00000001 ; /* 8 */
'b'01001=>'b'00011001 ; /* 9 */
'b'01010=>'b'00010001 ; /* A */
'b'01011=>'b'11000001 ; /* B */
'b'01100=>'b'01100011 ; /* C */
'b'01101=>'b'10000101 ; /* D */
'b'01110=>'b'01100001 ; /* E */
'b'01111=>'b'01110001 ; /* F */
}
/* 7-Segment B */
TABLE BADD => OUTPUT {
'b'10000=>'b'00000011 ; /* 0 */
'b'10001=>'b'10011111 ; /* 1 */
'b'10010=>'b'00100101 ; /* 2 */
'b'10011=>'b'00001101 ; /* 3 */
'b'10100=>'b'10011001 ; /* 4 */
'b'10101=>'b'01001001 ; /* 5 */
'b'10110=>'b'01000001 ; /* 6 */
'b'10111=>'b'00011111 ; /* 7 */
'b'11000=>'b'00000001 ; /* 8 */
'b'11001=>'b'00011001 ; /* 9 */
'b'11010=>'b'00010001 ; /* A */
'b'11011=>'b'11000001 ; /* B */
'b'11100=>'b'01100011 ; /* C */
'b'11101=>'b'10000101 ; /* D */
'b'11110=>'b'01100001 ; /* E */
'b'11111=>'b'01110001 ; /* F */
}
At the moment this is only theoretical, but after work, i can prove this with real hardware...
actual output from cupl:
Code:
Pin Variable Pterms Max Min
Pol Name Ext Pin Type Used Pterms Level
--- -------- --- --- ---- ------ ------ -----
! A 15 V 8 8 4
AADD 0 F - - -
AIA 2 V - - -
AIB 3 V - - -
AIC 4 V - - -
AID 5 V - - -
! B 17 V 6 8 4
BADD 0 F - - -
BIA 6 V - - -
BIB 7 V - - -
BIC 8 V - - -
BID 9 V - - -
! C 16 V 8 8 4
CLK 1 V - - -
! D 14 V 6 8 4
! E 18 V 8 8 4
! F 13 V 6 8 4
! G 12 V 1 8 4
OEAB 19 V 1 8 4
OUTPUT 0 F - - -
_________________
don't count on me, i'm engineer (Animotion)
my arduino pages:
http://rcarduino.de