MACRO EVENT # 11   'DS1802'  Digital Volume Control Driver
This Macro is used to clock serial data into a Dallas Semiconductors DS1802 Digitally controlled volume control. It uses one HomeVision variable called (Volume) and two digital output lines called (DVC Data) & (DVC Clock). Each bit of the variable is tested and used to set the data line to the required level. After a short delay to allow the data line to stabilise, the clock line is pulsed to clock the data into the DS1802.
If
    Var #15 (Volume) bit 0 is set
Then
  Set output port C-3 (DVC Data) high
Else
  Set output port C-3 (DVC Data) low
End If
Delay for 0.001 seconds
Pulse output port C-2 (DVC Clock) high for 0.001 seconds

Test bit 0 for "0" or "1"


Set DATA line to same value


Allow DATA line to stabilise
Pulse CLOCK line
If
  Var #15 (Volume) bit 1 is set
Then
  Set output port C-3 (DVC Data) high
Else
  Set output port C-3 (DVC Data) low
End If
Delay for 0.001 seconds
Pulse output port C-2 (DVC Clock) high for 0.001 seconds

Test bit 1 for "0" or "1"


Set DATA line to same value


Allow DATA line to stabilise
Pulse CLOCK line
If
  Var #15 (Volume) bit 2 is set
Then
  Set output port C-3 (DVC Data) high
Else
  Set output port C-3 (DVC Data) low
End If
Delay for 0.001 seconds
Pulse output port C-2 (DVC Clock) high for 0.001 seconds

Test bit 2 for "0" or "1"


Set DATA line to same value


Allow DATA line to stabilise
Pulse CLOCK line
If
  Var #15 (Volume) bit 3 is set
Then
  Set output port C-3 (DVC Data) high
Else
  Set output port C-3 (DVC Data) low
End If
Delay for 0.001 seconds
Pulse output port C-2 (DVC Clock) high for 0.001 seconds

Test bit 3 for "0" or "1"


Set DATA line to same value


Allow DATA line to stabilise
Pulse CLOCK line
If
  Var #15 (Volume) bit 4 is set
Then
  Set output port C-3 (DVC Data) high
Else
  Set output port C-3 (DVC Data) low
End If
Delay for 0.001 seconds
Pulse output port C-2 (DVC Clock) high for 0.001 seconds

Test bit 4 for "0" or "1"


Set DATA line to same value


Allow DATA line to stabilise
Pulse CLOCK line
If
  Var #15 (Volume) bit 5 is set
Then
  Set output port C-3 (DVC Data) high
Else
  Set output port C-3 (DVC Data) low
End If
Delay for 0.001 seconds
Pulse output port C-2 (DVC Clock) high for 0.001 seconds

Test bit 5 for "0" or "1"


Set DATA line to same value


Allow DATA line to stabilise
Pulse CLOCK line
If
  Var #15 (Volume) bit 6 is set
Then
  Set output port C-3 (DVC Data) high
Else
  Set output port C-3 (DVC Data) low
End If
Delay for 0.001 seconds
Pulse output port C-2 (DVC Clock) high for 0.001 seconds

Test bit 6 for "0" or "1"


Set DATA line to same value


Allow DATA line to stabilise
Pulse CLOCK line
If
  Var #15 (Volume) bit 7 is set
Then
  Set output port C-3 (DVC Data) high
Else
  Set output port C-3 (DVC Data) low
End If
Delay for 0.001 seconds
Pulse output port C-2 (DVC Clock) high for 0.001 seconds

Test bit 7 for "0" or "1"


Set DATA line to same value


Allow DATA line to stabilise
Pulse CLOCK line

Return to Macros HomeVision Main Index Links

Website Content and Design is protected under Copyright by Keith Doxey ©2000
This page last updated : 5th October 2000