Program Listing:
10 REM Domino - LTC1257 DAC Program
20 REM *LD = Port1.4, CLK = Port1.5, DIN = Port1.6
30 LD = 10h : CK = 20h : DA = 40h
40 PORT1 = PORT1 .OR. LD : REM raise *LD
50 PORT1 = PORT1 .AND. (0FFh-CK) : REM drop CLK
60 PORT1 = PORT1 .AND. (0FFh-DA) : REM drop DIN
70 INPUT "Enter desired output voltage: ",V
80 V = V/(5/4095)
90 FOR X = 11 TO 0 STEP -1
95 REM TEST VALUE, IF BIT=1 THEN CLOCK A 1, ELSE CLOCK A 0
100 IF (V.AND.2**X)<>0 THEN GOSUB 2000 ELSE GOSUB 1000
110 NEXT X
120 GOSUB 3000
130 PRINT
140 GOTO 70
1000 PORT1 = PORT1 .AND. (0FFh-CK) : REM drop CLK
1010 PORT1 = PORT1 .AND. (0FFh-DA) : REM drop Din
1020 PORT1 = PORT1 .OR. CK : REM raise CLK
1030 RETURN
2000 PORT1 = PORT1 .AND. (0FFh-CK) : REM drop CLK
2010 PORT1 = PORT1 .OR. DA : REM raise Din
2020 PORT1 = PORT1 .OR. CK : REM raise CLK
2030 RETURN
3000 PORT1 = PORT1 .AND. (0FFh-LD) : REM drop *LD
3010 PORT1 = PORT1 .OR. LD : REM raise *LD
3020 RETURN