diff options
author | Mike <mjc@avtechpulse.com> | 2000-01-01 00:37:54 +0900 |
---|---|---|
committer | Mike <mjc@avtechpulse.com> | 2000-01-01 00:37:54 +0900 |
commit | 5fb7eccd0d238a976758dd1e33ef18931b83b91f (patch) | |
tree | 092bc4723819b170060b292d9295c574e16dd7ad /device-functions.c | |
parent | dd925747f7ac9fad9bb95920dc7b07db48c9c56d (diff) |
implement full control of DACs 8-15
Diffstat (limited to 'device-functions.c')
-rw-r--r-- | device-functions.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/device-functions.c b/device-functions.c index eeddd67..d32c933 100644 --- a/device-functions.c +++ b/device-functions.c @@ -4647,6 +4647,8 @@ void Main_update_shift_registers() bus_setpin(out_STROBE_LINE, 0); // release latch for (i=0; i<std_dacs; ++i) { + // OP1B on-board DACs + /* load the upper-nibble latch */ bus_writebyte ((uint8_t) (Octal_DACportCS_high), (uint8_t) (globals.Registers.parallel_DAC_reg[i] >> 8)); @@ -4654,6 +4656,19 @@ void Main_update_shift_registers() bus_writebyte ((uint8_t) (Octal_DACportCS_low + i), (uint8_t) (globals.Registers.parallel_DAC_reg[i] & 255)); } + for (i=std_dacs; i<max_dacs; ++i){ + // expansion DACs on PCB 313A + int addr; + addr = i-std_dacs; // shift down by 8 + + I2C_Write(PCF8574+Extra_DACs_Addr_Port, addr + 8); // load address, AD7839 WR high + I2C_Write(PCF8574+Extra_DACs_Data_Port, globals.Registers.parallel_DAC_reg[i] >> 8); // load upper byte data + I2C_Write(PCF8574+Extra_DACs_Addr_Port, addr + 16 + 8); // latch into HC574 + I2C_Write(PCF8574+Extra_DACs_Data_Port, globals.Registers.parallel_DAC_reg[i] & 255); // load lower byte data + I2C_Write(PCF8574+Extra_DACs_Addr_Port, addr); // latch into AD7839 + I2C_Write(PCF8574+Extra_DACs_Addr_Port, addr + 8); // latch into AD7839 + } + /* keep trigger suppressed for a time (normally 5ms) after a relay update */ if ( globals.Registers.last_relay_driver_settings[0]!=globals.Registers.shift_reg_out[2] || globals.Registers.last_relay_driver_settings[1]!=globals.Registers.shift_reg_out[3] |