| MACRO EVENT # 12 'Set Volume' Set Volume Levels | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| This Macro is used to set the volume levels of the DS1802 Digitally controlled volume control. It uses three HomeVision variables called (Volume), (Volume Zone1) and (Volume Zone2) and one digital output line called (DVC Enable). The DS1802 contains seperate data registers for the left and right volume controls. In my particular application I am not implementing a Stereo Balance function as I have never found it neccessary to move my Balance control off centre. Because of this I send the same value twice to set left and right to the same level. Also I have cascaded two DS1802's for a 2 Zone system. By cascading the DS1802's it is possible to control multiple chips using only 3 control line, CLOCK, DATA and ENABLE. The data is clocked through the data registers of all the chips so this macro sends the values for all zones. This macro starts by enabling the serial interface and then passing the required volume levels to the DS1802 Macro. After all the data has been sent the serial interface is disabled which causes the new data to be loaded into the volume controls. | |||||||||
| Set output port C-1 (DVC Enable) high Var #15 (Volume) = var #13 (Volume Zone1) Do macro #11 (DS1802) once Do macro #11 (DS1802) once Var #15 (Volume) = var #14 (Volume Zone2) Do macro #11 (DS1802) once Do macro #11 (DS1802) once Set output port C-1 (DVC Enable) low |
Enable DVC serial interface Get required volume for Zone 1 Set Zone 1 Left Volume Set Zone 1 Right Volume Get required volume for Zone 2 Set Zone 2 Left Volume Set Zone 2 Right Volume Disable DVC serial interface |
||||||||
Website Content and Design is protected under Copyright by Keith Doxey
©2000 |
|||||||||