diff options
author | root <root@avtech.domain.avtechpulse.com> | 1999-12-31 19:56:57 -0500 |
---|---|---|
committer | root <root@avtech.domain.avtechpulse.com> | 1999-12-31 19:56:57 -0500 |
commit | 6909a50a3cf11ccfcf111f54e848347fb7bdcd0a (patch) | |
tree | 79e15e334508f04b9ca65af2c12c6fd266a0fe30 | |
parent | 2e0b83cc8a95fabaf9e57012d55ed252e9338b6c (diff) |
Boost "fixed" pw from OP1B in units with volt-ctrl-pw at low PRFs.
Makes PRF calibration work properly. Otherwise duty cycle is too low.
-rw-r--r-- | device-functions.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/device-functions.c b/device-functions.c index a0db6d9..5379741 100644 --- a/device-functions.c +++ b/device-functions.c @@ -455,13 +455,34 @@ int Set_Pw(int check_possible_only,int word_override,int range_override,int chan /* use DAC8420 to control PW in lowest PW range */ if (!relay_range) { + // set the voltage to the actual PW-control circuit (normally in a module) set_dac(globals.Flash.pw_dac[channel],word_out); + + // This word is fed to the PW circuit on the OP1B board, not the module + // Set to a fixed value. Isn't actually used to control PW in this mode, + // but triggers following stages. word_out=globals.Flash.fix_pw_dac_val[channel]; - /* Set to fixed value. */ - /* Isn't actually used to control PW in this mode, but may trigger following stages */ - /* Zout hardware/software is used in AVPP to control PW ranges, not Zout */ + // Also, boost the internal PW range so that PRF calibration works at + // low PRFs (i.e., reasonable duty cycle for scope to see). + // Bit of a hack based on the period. + int rough_range = ((int) log10 (1.0/globals.ChannelState[channel].frequency)) + 6; + if (rough_range < 0) { + rough_range = 0; + } + if (rough_range >= timing_ranges) { + rough_range = timing_ranges-1; + } + if (rough_range==0) { + cap_range_control=0; + } else { + cap_range_control = 1 << (rough_range-1); + } + + /* Zout hardware/software is used in AVPP to control PW ranges in the + * external circuitry, not Zout */ Set_zout(channel,globals.Flash.zout_min[channel],0); + } else { Set_zout(channel,globals.Flash.zout_max[channel],0); |