First version of this should be simple. Desire is to add a method
hcalDCCManager::warmInit()
which restores the DCC to a state for start of a new run.
Here for reference is Wu's official documentation on how to initialize the DCC2 with steps numbered for convenient reference:
Standard initialization procedure:
operation comments
1. write 0xffff0000 to 0x4 clear configuration register
2. write n to 0x8 set up monitoring event scale factor to n+1
3. write 0x????? to 0xc set up HTR enable register
4. write I2C_ID to 0x10 set up I2C ID register
5. write 0x4 to 0x0 reset TTCrx
6. set up configuration register, but do not put into run mode
7. write 0x3 to 0x0 reset all registers and slink
8. write 0x3 to 0x4 set to run mode and enable slink
9. write 0xb to 0x0 reset all registers and slink after run started
This stuff is spread all over the DCC code, but as a crude first step we could just do steps 7, 8, 9 in a
warmInit()
.
To do it properly requires duplicating significant code, first from
hcalDCCManager::connect()
--
EricHazen - 22-Apr-2010